Post by BGamer » Tue Oct 22, 2019 8:26 pm

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

Newbie

Posts

Joined
Tue Oct 23, 2018 7:56 pm

Post by DigitCart » Tue Oct 22, 2019 9:24 pm

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.

My Extensions


User avatar
Active Member

Posts

Joined
Thu Jun 22, 2017 5:32 pm


Post by BGamer » Wed Oct 23, 2019 3:09 pm

Thank you, this method works in 3.0.2.0 ::)

Newbie

Posts

Joined
Tue Oct 23, 2018 7:56 pm

Post by DigitCart » Wed Oct 23, 2019 4:39 pm

You are welcome.

My Extensions


User avatar
Active Member

Posts

Joined
Thu Jun 22, 2017 5:32 pm


Post by Ehsan Samara » Fri Sep 01, 2023 12:57 am

Hello... can you please help me how to do it in 4.0.2.2 version..
Thanks

Newbie

Posts

Joined
Tue Aug 06, 2019 10:20 pm
Who is online

Users browsing this forum: No registered users and 148 guests