Answer the question
In order to leave comments, you need to log in
How to get product id in Opencart 2.x?
Hello, how can I get, for example, in category.tpl in a certain place the id of the product.
There are several products in a row, so you need to add a class for each product.
How can I implement it?
Thank you.
Answer the question
In order to leave comments, you need to log in
Go to the controller /catalog/controller/product file category.php , look for the code in it:
See if it is in the array
If yes, fine, if not, then add it. Next, go to
catalog/view/theme/*/template/product (where instead of an asterisk, the name of your theme) to the product.tpl file, after the construction, insert the output of your product ID throughecho $product['product_id'];
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question