A
A
Alexander Savenko2018-09-19 23:55:24
Prestashop
Alexander Savenko, 2018-09-19 23:55:24

Prestashop how to add category image on product page?

Hello!
I can’t figure out how to change the behavior of the breadcrumb.tpl file. I
wrote the following code for the product page:
{if $page.page_name == 'product'}
{/if}
But I can't figure out how to get a list of all categories and determine that an image is affixed to the category . {php}{/php} doesn't work in the template and I don't know how to extend the ProductController.php class for the theme.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Savenko, 2018-09-20
@savenko

It turns out to be easy: in the root of the project we create /override/controllers/front/ProductController.php

class ProductController extends ProductControllerCore{
public function getTemplateVarProduct(){
$product = parent::getTemplateVarProduct();
...код...
}
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question