As you may have guessed from the title, today we will talk about these fields such as SKU, UPC, ID. Sometimes our clients need on product page display any additional fields that are in the admin area editor of goods but not in the window of the store, and now I'll show you how to easily and quickly bring the above-mentioned fields. To display them, we all just need to tweak the two files is the controller product.php and the file product.tpl is your theme.
1. So open the file catalog/controller/product/product.php and after a line of code:
1 |
$this->data['model'] = $product_info['model']; |
Add the following line of code:
1 2 |
$this->data['upc'] = $product_info['upc']; $this->data['sku'] = $product_info['sku']; |
2. Then open the file catalog/view/theme/Your theme/template/product/product.tpl and add in the required place the following code:
1 2 3 |
<span>UPC:</span> <?php echo $upc; ?><br /> <span>Vendor code:</span> <?php echo $sku; ?><br /> <span>ID:</span> <?php echo $product_id; ?> |
For example, the default template you can insert the following lines just after the presence of a code:
1 |
<span><?php echo $text_stock; ?></span> <?php echo $stock; ?> |
That's the simple method we vyel SKU, UPC, ID card in our product.
No Comment
You can post first response comment.