Show sku or location on opencart product page

Posted by Flo on 31 Jul 2011

If you want to display the sku or location fields in the product description in opencart this is how you proceed:

Edit the file catalog/ controller/ product/ product.php

Find the line:

$this->data['reward'] = $product_info['reward'];

Below it , post the line:

$this->data['sku'] = $product_info['sku'];

hit save.

Now edit the file:

catalog/view/theme/yourtheme/template/product/product.tpl

Find the line:

<span><?php echo $text_model; ?></span> <?php echo $model; ?><br />

Below it add the line:

<span>New field name</span> <?php echo $sku; ?><br />

And save.

You can do the same thing for location , only use the word location instead of sku.

Now , what you will insert in admin in the sku field will apear in product page below model(or product code)