Page 1 of 1

Show product Code in Category Items / list / grid

Posted: Tue Oct 22, 2019 8:26 pm
by BGamer
Hello, how do I show the product code in the category graph? ( list / grid ) I have seen old reviews but do not fit my version 3.0.2.0

Re: Show product Code in Category Items / list / grid

Posted: Tue Oct 22, 2019 9:24 pm
by DigitCart
Hi

in this file:
catalog\controller\product\category.php

Find:

Code: Select all

$data['products'][] = array(
Add after it:

Code: Select all

'model' => $result['model'],
in this file:
catalog\view\theme\default\template\product\category.twig

Find:

Code: Select all

<h4><a href="{{ product.href }}">{{ product.name }}</a></h4>
Add after it:

Code: Select all

{% if product.model is defined %}Product Code: {{ product.model }}{% endif %}
This is for default theme.
you may need to refresh the modification and clear the caches.

Re: Show product Code in Category Items / list / grid

Posted: Wed Oct 23, 2019 3:09 pm
by BGamer
Thank you, this method works in 3.0.2.0 ::)

Re: Show product Code in Category Items / list / grid

Posted: Wed Oct 23, 2019 4:39 pm
by DigitCart
You are welcome.