I am trying to display sku field on the product page.
I have defined the following in controller>product.php
$data['sku'] = $product_info['sku'];
and following code in view> product.tpl
<?php if ($sku) { ?>
<li>SKU: <?php echo $sku; ?></li>
<?php } ?>
but it still gives Notice: Undefined variable: sku in /home5/uzisport/public_html/.../catalog/view/theme/journal2/template/product/product.tpl on line 301
Please help... where I am doing wrong? Using OC version 2.3.0.2
Try isset()
Also FOR TEST ONLY use
var_dump($product_info[$sku]); in your controller
to check if $sku really has any value
Code: Select all
<?php if (isset($sku)) { ?>
<li>SKU: <?php echo $sku; ?></li>
<?php } ?>
var_dump($product_info[$sku]); in your controller
to check if $sku really has any value
Software Support And Development www.sdware.eu
Ccookie Module || Admin Category/Manufactory/Attribute Filter || Admin Customizer || Bank Tranfer Extended
Business Inquiries Here
My extensions Page Here
Ccookie Module || Admin Category/Manufactory/Attribute Filter || Admin Customizer || Bank Tranfer Extended
Business Inquiries Here
My extensions Page Here
As above, isset() is the one.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Who is online
Users browsing this forum: Majestic-12 [Bot] and 11 guests