opencart2.x

Opencart 2.1.0.2 Getting error from installing ocmod.zip

白昼怎懂夜的黑 提交于 2019-12-11 11:49:22
问题 I've just started to use 2.1.0.2 and I'm trying to convert over some of my own extensions I built for my 1.5.6.4 store. I have started with a fresh install of 2.1.0.2 and I built a very basic extension, I'm wanting to move over to the extension installer to install my future additions to my store instead of using vqmod. I have made my testerextension.ocmod.zip, inside this is: install.xml /upload/ /admin/ /catalog/ However when I use the installer to upload testerextension.ocmod.zip I'm

How to show subcategory image in header category menù?

我是研究僧i 提交于 2019-12-11 10:57:31
问题 On Opencart version 2.0.2.0 I need to display the subcategory image (thumb) beside the name when the header category dropdown menu is open. I try to get it by myself acting on code but nothing tried has worked. I need your help thanks in advance. In the code below header.tpl you see where I want the subcategory image. It wil appear in the dropdown menu. How to customize the header.php file to achieve that? <?php if ($categories) { ?> <div class="container"> <nav id="menu" class="navbar"> <div

How to add product options in category page in opencart 2.0

ぃ、小莉子 提交于 2019-12-11 03:46:31
问题 I want to add product options in the category page in opencart 2.0. I have added this code in \catalog\model\catalog\product.php public function hasOptionPriceIncrease($product_id) { $option_data = $this->getProductOptions($product_id); if (is_array($product_option_value)) { foreach ($product_option_value as $option) { if (is_array($option['product_option_value'])) { foreach ($option['product_option_value'] as $value) { if ($value['price'] > 1) { return true; } } } } return false } and then

How to add Telephone field in OpenCart 2.0.2.0 contact form

為{幸葍}努か 提交于 2019-12-11 00:28:30
问题 How can I add extra input fields in OpenCart contact form (under information)? Specially I want to add a telephone number field in my contact form and I've followed a tutorial but it didn't work for me. Is there any alternative? 回答1: I know it's possible that you already resolved this issue, but this is for those who still want to add custom field to contact form. In OpenCart 2.0 default Contact Us page (/index.php?route=information/contact) - Contact Form has only 3 fields: Your Name, E-Mail

Fatal error: Call to undefined function utf8_substr() Opencart

梦想的初衷 提交于 2019-12-10 14:57:33
问题 My site was working fine from last 2 3 months but now it shows 500 Server error message. Then I saw the error.log file it says that PHP Fatal error: Call to undefined function utf8_substr() in public_html/catalog/model/tool/image.php on line 11 And the code at the given location is: $new_image = 'cache/' . utf8_substr($filename, 0, utf8_strrpos($filename, '.')) . '-' . $width . 'x' . $height . '.' . $extension; Then I thought may be its because of cache and then I cleared the cache and still

How to change urls in <a> to seo in Opencart 2.x automatically?

旧巷老猫 提交于 2019-12-10 11:47:05
问题 I'm using Opencart 2.x version and shop installed in /shop subdirectory. I know how to enable seo_url (.htaccess.txt -> .htaccess, set RewriteBase to /shop/ and enable SEO urls in admin panel). Seo urls works and my links like information/information_id=1 changed to /faq etc. Problem is that if I add in url_alias table records: inforamtion/contact = contact - this url works, but on the site it still looks like /shop/index.php?route=information/contact not as /shop/contact I supposed that it

Change number of products in a row on category view in Opencart 2.x

前提是你 提交于 2019-12-10 11:36:29
问题 I have a working on a shop right now, and i want to display 4 products in a row in category view, but i cant figure out, how to solve that. When i toggle inspect element in browser i see this code: <div class="row"> <div class="product-layout product-grid col-lg-4 col-md-4 col-sm-6 col-xs-12">..</div> <div class="product-layout product-grid col-lg-4 col-md-4 col-sm-6 col-xs-12">..</div> <div class="product-layout product-grid col-lg-4 col-md-4 col-sm-6 col-xs-12">..</div> <div class="clearfix

Display block HTML only on main page?

谁说胖子不能爱 提交于 2019-12-10 11:15:26
问题 I tried to modify home controller adding new variable: $data["header_home"] = true; Then I try to check this in header.twig tetmplate like as: {% if header_home %} <div>Home</div> {% else %} <div>Not Home</div> {% endif %} When I open home page by index.php or just url address it does not work, I mean I dont see <div>Home</div> . How to fix it, what do wrong? This is home controller: <?php class ControllerCommonHome extends Controller { public function index() { $this->document->setTitle(

get third level category in opencart 2

泄露秘密 提交于 2019-12-08 12:58:12
问题 Im editing template for 2.0.x open cart, and found out that the Menu one the top side - shows only upto second sub category.. and i'v been looking up controller files, template files, to edit it as I want - show just one more level (or all levels..as long as I can get more deeper level of sub sub cats..) of sub categories on the navigation on the left --- for couple weeks..and could not find the way. header.tpl <ul> <?php foreach ($categories as $category_1) { ?> <li class="sub-menu"><a href=

how to put opencart 2.0 customer first name and last name on header?

坚强是说给别人听的谎言 提交于 2019-12-08 10:08:12
问题 Can anyone please tell me how to put customer's first and last name into the header in OpenCart 2.0? I am already using this code for OpenCart 1.5.6: <?php echo $this->customer->getFirstName(); ?> <?php echo $this->customer->getLastName(); ?> But this code is not working for OC 2.0 I am getting this error : Undefined property: Loader::$customer in header.tpl Please help me anyone. 回答1: To fix this error you need to call them in the controller instead of in the template. In catalog/controller