0

I have followed the instructions as per the following link: OpenCart 3.0.2.0 - how to display SKU on category & product pages

Please see the excerpt below:

For Product page:

Step 1: Open file catalog/controller/product/product.php

Find:

$data['heading_title'] = $product_info['name'];

Add after:

$data['sku'] = $product_info['sku'];

Step 2: Open file: catalog\language\en-gb(your language)\product\product.php

Find:

$_['text_model']               = 'Product Code:';

Add after:

$_['text_sku']               = 'SKU:';

Step 3: Open file: catalog/view/theme/default(your theme)/template/product/product.twig

Find:

<li>{{ text_model }} {{ model }}</li>

Add after:

{% if sku %}
<li>{{ text_sku }} {{ sku }}</li>
{% endif %}

My problem arose at STEP 3:

By doing the change as recommended in STEP 3 I noticed no change in the FrontEnd.

I then opened the following file: catalog/view/theme/theme_name/template/product/product.tpl

and directly below the following line:

<span><?php echo $text_model; ?></span> <span class="value"><?php echo $model; ?></span><br />

I added the following code:

<span><?php echo $text_sku; ?></span> <span class="value"><?php echo $sku; ?></span><br />

I now see SKU on the product page as follows: SKU: SKU

Any ideas?

TIA

Mujahid Bhoraniya
  • 1,518
  • 10
  • 22
tonphat
  • 11
  • 2
  • After change clear cache through admin panel – Nanhe Kumar Jul 28 '21 at 23:28
  • Please refresh ocmod cache and twig cache & then check it - https://stackoverflow.com/questions/61520968/opencart-3-system-cache-cleaning-ocmod-and-twig-i-made-changes-in-controller/61524855#61524855 – HDP Sep 11 '21 at 06:18

0 Answers0