Hi, 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; <?php echo '<p>Hello World</p>'; ?> 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.
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!
...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!
just to reply, just better don't expect much, when it comes to socalled 'upgraded' Shops, especially, if
one does not EXACTLY inform others, on, how such an attempted 'Upgrade' has been done, or at least, tried.
This, because, there is, and never was, no such Thing as an official UPGRADE for v.1.5.x to v.2.x Versions,
just a handfull of Custom Attempts, and most of them only contain 'parts' of, what eventually would have to
be done, and changed, moved, and replaced, to really 'upgrade' an older Version. Not to speak about Mod's,
most of them won't work anymore. In addition, every V-2 release was different from the other, for each one,
specific Things would matter...
It would take time, lot's of time, and time is money, for Shop owners equally as for Dev's. One has to accept this.
Good Luck, no offense, just information!
Ernie
one does not EXACTLY inform others, on, how such an attempted 'Upgrade' has been done, or at least, tried.
This, because, there is, and never was, no such Thing as an official UPGRADE for v.1.5.x to v.2.x Versions,
just a handfull of Custom Attempts, and most of them only contain 'parts' of, what eventually would have to
be done, and changed, moved, and replaced, to really 'upgrade' an older Version. Not to speak about Mod's,
most of them won't work anymore. In addition, every V-2 release was different from the other, for each one,
specific Things would matter...
It would take time, lot's of time, and time is money, for Shop owners equally as for Dev's. One has to accept this.
Good Luck, no offense, just information!
Ernie
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
I appreciate the response, you did answer one of my questions about modules not being compatible.
The main question I have though is not in regards to modules. It's in regards to defining a variable of any of sort (preferably the attributes) on the category.php page, and the printing out that variable in the category.tpl page.
I don't care how basic the example is, I just want to start from square 1 to see if anything is working in that regard (like i said i feel like it's not referencing correctly). And keep in mind I am using 2.3.0.2.
-Thanks, Michael.
The main question I have though is not in regards to modules. It's in regards to defining a variable of any of sort (preferably the attributes) on the category.php page, and the printing out that variable in the category.tpl page.
I don't care how basic the example is, I just want to start from square 1 to see if anything is working in that regard (like i said i feel like it's not referencing correctly). And keep in mind I am using 2.3.0.2.
-Thanks, Michael.
May be to add product attribute you can learn from how to add product option, because attribute and option have similarity.
http://stackoverflow.com/questions/1983 ... f-opencart
Yes, you need add code to category.php and category.tpl
Attention code for public function getProductAttributes($product_id) and public function getProductOptions($product_id)
at catalog/model/catalog/product.php
http://stackoverflow.com/questions/1983 ... f-opencart
Yes, you need add code to category.php and category.tpl
Attention code for public function getProductAttributes($product_id) and public function getProductOptions($product_id)
at catalog/model/catalog/product.php
well, for those, eager to find out first, instead of wasting time later, it has been explained in detail on multiple Sites,
as well as in uncounted Postings around this Place.
It's one of those things, required to know, for everyone, trying to 'manipulate' such a comprehensive System.
Ernie
http://ocextensions.co.uk/ocmod/ocmod
http://docs.opencart.com/extension/modifications/
http://www.opencartexpress.com/how-to-use-ocmod
https://isenselabs.com/books/allbooks
as well as in uncounted Postings around this Place.
It's one of those things, required to know, for everyone, trying to 'manipulate' such a comprehensive System.
Ernie
http://ocextensions.co.uk/ocmod/ocmod
http://docs.opencart.com/extension/modifications/
http://www.opencartexpress.com/how-to-use-ocmod
https://isenselabs.com/books/allbooks
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Who is online
Users browsing this forum: Google [Bot] and 164 guests