Page 1 of 1
[SOLVED] - how to grab product id, UPC, SKU, etc. data for product.tpl page??
Posted: Mon May 18, 2020 12:55 pm
by takayuki
Hi,
I'd like to add the UPC, SKU and some other product data (also the product id) to each product page.
I'm editing the product.tpl page here: /catalog/view/theme/journal2/template/product
Any help here appreciated.
Dave
Re: how to grab product id, UPC, SKU, etc. data for product.tpl page??
Posted: Mon May 18, 2020 2:26 pm
by thekrotek
Add the desired data to $data array and then read this data in TPL.
Re: how to grab product id, UPC, SKU, etc. data for product.tpl page??
Posted: Mon May 18, 2020 5:37 pm
by takayuki
thanks for the reply, but can you be more specific?
do you mean add an entry to the array here in the controller/product/product.php page?
line 440:
Code: Select all
$data['products'][] = array(
'product_id' => $result['product_id'],
'thumb' => $image,
'name' => $result['name'],
'upc' => $upc
and then grab the $upc var in view/theme/journal2/template/product/product.tpl?
thanks

Re: how to grab product id, UPC, SKU, etc. data for product.tpl page??
Posted: Mon May 18, 2020 5:45 pm
by thekrotek
Exactly.
Re: [SOLVED] - how to grab product id, UPC, SKU, etc. data for product.tpl page??
Posted: Thu May 21, 2020 11:44 am
by takayuki
I can't get the upc value doing what I described below. Is there anything else I need to do in the product.php page?
I'm trying to access the upc value in the product.tpl page via $upc.
Any thoughts here as to what is wrong?
thanks