A
A
Alexey Verkhovtsev2016-06-25 16:16:38
opencart
Alexey Verkhovtsev, 2016-06-25 16:16:38

How to display product description in OpenCart cart?

Tell me how you can display the description of the product in the cart OpenCart version 2.x. I did this once, but then the site was deleted, and I forgot, I remember that it seems like in the checkout/cart controller we add the line 'description' => htmlspecialchars_decode($product['description']), in the cart template, respectively <?php echo $product['description']; ?> but I don’t remember what to add to which model file, the only similar file is catalog/product, there is a selection of goods, but description is already selected there, and as a result, I still have an error in the basket Notice: Undefined index: description, but when I did it for the first time, I remember that somewhere I added something in the models, help, kind people

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Verkhovtsev, 2016-06-25
@seftomsk

I figured it out.
1) Go to catalog/controller/checkout/cart.php, look for the string 'name' => $product['name'], after it add 'description' => htmlspecialchars_decode($product['description']),
2) Go to system/library/cart/cart.php (for ocStore it will be system/library/cart.php) look for the line 'name' => $product_query->row['name'], after it add 'description' => $ product_query->row['description'],
3) Go to catalog/view/theme/name of your theme/template/checkout/cart.tpl and display the description there with <?php echo $product['description']; ?>
4) Enjoy :)

O
ognennyibayan, 2017-09-12
@ognennyibayan

Ругается, что именно в первом пункте не определено 'description' => htmlspecialchars_decode($product['description']),

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question