D
D
Denis2015-10-05 01:51:33
PHP
Denis, 2015-10-05 01:51:33

OpenCart - how to pass attribute to cart?

1. There was a need to display one of the attributes in the basket, just as it happens with properties.
Those. when adding a product to the cart, we get the following:
The cart contains a product with an image, the name of the product and under this name the product properties (size, color, etc.) we display the attribute (in my case, the delivery time is "On order - x days" ( it had to be done that way.
UJaAo62Lzqw.jpg
For example, the first product has options, and they are displayed.
The second one has no options, but there is an attribute that needs to be displayed in the same way as the options.
Knowledgeable experts, tell me where to dig.
2. And one more question:
We have catalog/controller/product/category.php, where I added the logic for delivery times.
I display this data through catalog/view/theme/my_theme/template/product/category.tpl
with the following code: <?php echo $product['stock2'];?>
How can I use the same stock2 in catalog/view/theme/my_theme /template/product/product.tpl?
I'm just learning how to work with OpenCart, three days of work on this issue led to a stupor, so I'm asking for help here.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question