opencart2.x , Issue in defining custom variable & showing in category page in opencart

Issue in defining custom variable & showing in category page in opencart


Tag: opencart2.x

I am facing 1 weird issue in opencart. My version is

My approach to show any custom variable's value in header & footer is....I go to language file & add a variable there then in controller file with $data['...'] & then use that variable in view file.

But my issue here is I can not do this for category page. I wrote a variable in 1) language/english/product/category.php then in 2) catalog/controller/product/category.php & then in 3) template/product/category.tpl but that variable is not coming & instead giving error that.....that variable is not defined so what should I do to achieve that?



If you installed any extension that modified category, then check if there is a category.php file there, if so, modify that file instead.



OpenCart 2.0 I can't add modules (ControllerModuleMinicart::redirect() error)

I'm trying to add modules to the latest OpenCart version and so far no one worked. First I'm trying to add side cart, I found couple modules, but all of them are for earler versions and doesn't work with 2.0, also I tried to add facebook like box extension and...

How to make vertical navigation bar in Opencart v2.0.1.1?

I am using Opencart V2.0.1.1. Please suggest how to change the default Opencart navigation bar(Horizontal) to the Vertical. With Sub-Categories popping in right side.

Fatal error: Call to undefined method in opencart

When i am trying to save a module details, it shows the below error, i don't know what is the mistake over there, but the data's are stored but every time i try to save i get this error. ERROR Fatal error: Call to undefined method ControllerPaymentIcicipg::redirect() in C:\xampp\htdocs\usa\admin\controller\payment\icicipg.php on...

page specific product template opencart

I would like to create page specific template files for opencart using the "location" field. I would like to know can this work with seo url's I have found this at the bottom of the header.php for opencart // For page specific css if (isset($this->request->get['route'])) { if (isset($this->request->get['product_id']))...

Opencart 2 - Custom shipping Methods

I was wondering whrere the shipping methods are set up in Opencart 2 - not in the Admin-Panel, but on the server and database. I would like to set up my own (stub-) shipping method without the use of Extensions - maybe by cloning and customizing an existing one, but...

Opencart how to show free shipping if order is above X amount otherwise X delivery charges?

I would like to if order is above x amount then free shipping otherwise need to charge x amount. In Free Shipping i already set X amount. In Flat Rate i set X amount. But in frontend if order is above x amount then it display both Free Shipping &...

Opencart Payment gateway error after opencart 2.0 upgrade

We have a payment gateway called atom for our opencart store. Recently we have upgraded Opencart from to version. Due to this payment method stopped working. I have gone through this post to understand the changes in opencart 2.0 Below is my updated code //catalog/controller/payment/atompay.php <?php class ControllerPaymentAtompay...

How does free checkout work in Opencart 2?

I am trying to make a development site where I can add products to my cart and delivery options - and then checkout. I want to be able to do dummy orders without using real cards or payment gateways I have enabled free checkout but it does not appear on...

Opencart 2 : Add currently logged admin id to oc_product table on product insert

I would like to monitor which dashboard user ("admin") added new product to the database. The solution i was thinking about is simply adding another insert under admin > model > catalog > product.tpl under function addProduct(), which adds the user id to the custom column added before under oc_product....

Opencart mail error on mail.php line 168

I have recently updated opencart to opencart The day I updated, Mail stopped working. Now I am unable to register any user or retrieve password. I was happily using the mail before, now with the same settings I can't send any email. Following are the mail settings I...

Jquery selector not pulling text out

Im working inside of opencart's framework. The base install has the exact same code but mine doesn't seem to be working. I'm not seeing any errors. Im unsure how to make my selectors in jquery work. When the below code is ran it doesn't find the text in the span....

Modification requires a unique ID code! Opencart OCMOD

In Opencart, I tried to upload an OCmod configuration file with right name format .ocmod.xml but I get the error Modification requires a unique ID code!

Proper way to work using the real image of a product on OpenCart 2

I'm currently looking for the proper way to work on a theme using the real image of a product and not its thumbnail (identified as $thumb in the default theme). I have found a abrupt trick by adding a line in the controller file: $this->data['cover'] = $product_info['image']; But does anybody...

opencart 2.x: How to identify which submit button was pressed?

On my front page in opencart I've got a panel with login (which says that user is logged or if not then asks for login and password) and it has IF condition inside the controller: if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) { The contact page also has the same IF...

Admin is showing different price to Front End

I have set up an OpenCart store for my Australian company. In System>>Localisation>>Currencies I created a new Currency for Australian Dollars with the code AUD. Then in System>>Settings>>Store Name>>Local I set the Country to Australia and the Currency to AU Dollar: But when I add a new product and set...

How to call one controller on every page

If I want to load controller or module on every page , Should I load controller every time? My question is what is the best practice to load controller on every page?

Add Slider Extension in Opencart?

I am Creating a Opencart Page with 1500 products. In homepage I want Slider Extension For Products With Time interval. . How can i Add the extension . . Help me Out Here. . For Extension Code.....

Send Attachment in PHP with OpenCart

Does anyone with knowledge of OpenCart know how I could implement the following addAttachment function found in system/libary/mail.php: public function addAttachment($filename) { $this->attachments[] = $filename; } into catalog/controller/information/contact.php - so that the default contact form can also include an attachment upload feature? I tried this but no dice. if...

In OpenCart, How can I customize the info visible on the product page

Okay, first I want to say that I am not a geek programmer. I am intermediate to programming. I was recently learning Php through teamtreehouse, which I have not finished yet. But instead I started making an online store from OpenCart. I watched some youtube videos and added some products,...

Insert based on conditions

I am trying to insert some data in mysql table. I have an option in opencart with option_id = 6, I want to insert into all products containing option_id=6 a new option with option_id=9. insert into oc_product_option (`option_id`) select 9 where (SELECT `option_id` FROM oc_product_option WHERE `option_id` == 6); is...

Issue in defining custom variable & showing in category page in opencart

I am facing 1 weird issue in opencart. My version is My approach to show any custom variable's value in header & footer is....I go to language file & add a variable there then in controller file with $data['...'] & then use that variable in view file. But my...

How to get current category id - OpenCart 2.0

I have a code for product tpl witch I need a condition if a category id=12 echo.. THe code below works on opencart but on 2.0 doesn't generate anything. <?php if(isset($this->request->get['path'])) { $path = $this->request->get['path']; $cats = explode('_', $path); $cat_id = $cats[count($cats) - 1]; } ?> <?php if (isset($cat_id)...

Change default country in OpenCart

I'm using latest version of OpenCart whenever I go to register page site/index.php?route=account/register it shows United states as default. I know how to change this default country to another default country. Here what I need is, if a user go to register page it will show please select instead...

$this->config->get('something') in opencart

I am newbie in opencart as well as in php. I am discovering opencart templates, I found $this->config->get this line, I am a little bit confused about this. I don't understand clearly. I this request we are using this object (current) access config object and call get method of config...

Adding price and total column in shipping invoice in opencart

Opencart by default doesn't show price and total in the print shipping at the admin side. So I added two more columns to the table in shipping invoice in order_shipping.tpl in admin/view/template/sale/order_shipping.tpl but I got the error as Notice: Undefined variable: column_price in /home/blossewp/public_html/admin/view/template/sale/order_shipping.tpl on line 69 Notice: Undefined index:...

Show unit of weight in product page for Opencart 2

Hi! How to display the unit of weight (kg., gr., oz., ml.,) in product page in Opencart Now only displays a number without units. I'm Using the default template in file template\product\product.tpl it looks like this: ...<li><?php echo $text_model; ?> <?php echo $model; ?></li> <?php if ($weight) { ?>...

How to install VQmod extension for opencart 2.0.x.x without using FTP

I have installed vqmod extension for opencart from following link I have followed installation steps till replaced files. Now, how I should upload Opencart modifications on localhost. On admin panel made following setting System->Setting->Store Edit->FTP FTP Host : localhost FTP Port : 22 FTP Username : XXXXXX FTP...

ocmod, replace in controller Opencart

I did asked this question on OpenCart's forum but didn't get any answers so i try to ask it here instead and hopefully get a good answer :). Ok let's go to my problem. I am trying to remove the required field for product name on product page in admin....

How to insert module in header tpl file in opencart 2.0?

How to insert a module in header.tpl file in opencart 2.0 ? I have a module. Does not have the layout position option for that module. So i need to place that manually in header.tpl file. I am already tried this but not working for opencart 2.0. Please any one...