Post by takayuki » Mon May 18, 2020 12:55 pm

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

New member

Posts

Joined
Thu Aug 13, 2009 10:16 pm

Post by thekrotek » Mon May 18, 2020 2:26 pm

Add the desired data to $data array and then read this data in TPL.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by takayuki » Mon May 18, 2020 5:37 pm

thanks for the reply, but can you be more specific? :choke:

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 :)

New member

Posts

Joined
Thu Aug 13, 2009 10:16 pm

Post by thekrotek » Mon May 18, 2020 5:45 pm

Exactly.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by takayuki » Thu May 21, 2020 11:44 am

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

New member

Posts

Joined
Thu Aug 13, 2009 10:16 pm
Who is online

Users browsing this forum: Google [Bot] and 50 guests