1

I'm new to opencart, but am an experienced web developer. I am in the process of upgrading an old website, to a new website (1.5.4 to 2.3.0.2). We are almost done, but have come across an issue where our catalog\view\theme\journal2\category.tpl files are having trouble referencing any of the pre-made attributes / attribute groups... Previously, on the old website, the category pages showed attributes in the product listing (category.tpl), and we would like to do the same on the new website.

Problem: When I try to add those attribute variables into the code I get an error; "Notice: Undefined variable:" ... digging around the internet and forums, it is said that you need to add the code into the catalog\controller\product\category.php file.; 'attribute_groups' => $this->model_catalog_product->getProductAttributes($result['product_id']), ...Upon adding that, nothing happened.

So I got to thinking, what happens if I created a simple variable on the category.php file; $variable= 'variable'; and then echo $variable, on the category.tpl file? "Notice: Undefined variable:"

Then I tried to echo a simple hello world; Hello World

'; ?> within the catalog\controller\product\category.php file (nothing happened).

Next I decided to comment out the entire category.php file, and the page did not break...

I then confirmed that the page is indeed being referenced in some way by changing the page name category0.php, and I did get an error and a white screen (which is good that it is referenced).

I get the feeling that the page isn't referencing CORRECTLY or something. None of the variables I create are being referenced. I could be totally wrong on my prediction, but any thoughts? Is there anyway that I can get any simple variable to work? I can't even debug this any further.

-Thanks, Michael P.

1
  • Does anyone have any idea why this could be happening? ...Is this an issue caused by upgrading? Or are the variable declared wrong? Any help would be greatly appreciated. Or any tips to how I might go about debugging my problem. -Thanks!
    – Michael
    Nov 3 '16 at 12:22
1

It was as simple as a caching issue! ... Within the Admin Panel > Opencart modifications had to be refreshed.

...This is not something that someone new to Opencart would know.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.