Is there a reference list of all the possible product variables in OC 3.0.2.0?
For example, in the category.twig and product.twig files, there are references to things like:
{{ product.href }}
{{ product.name }}
{{ product.description }}
{{ product.price }}
{{ product.special }}
etc.
Is there a list of ALL the available variables? Somewhere?
Alternately, does anyone know how to display the product SKU on the category page & product page? That's the one I'm really looking for.
No there isnt such reference list. You can track them down though, going to the respective controllers and models called.
Most of them refer to their database table siblings.
Most of them refer to their database table siblings.
Opencart Developer - My Extension Showcase
Contact me at aeon.yoda@gmail.com
Well, my problem is, I would like to display the SKU on the category page & product page... but there's NO such reference in the templates.
I had it custom-hacked in the previous version (OC 2.0), but that's PHP and it's NOT working in this version on Twig.
I had it custom-hacked in the previous version (OC 2.0), but that's PHP and it's NOT working in this version on Twig.
To make sku available in twig on product page, edit catalog/controller/product/product.php, after line 161 add :
To make sku available in twig on category page, edit catalog/model/catalog/product.php, and on line 60 add a reference to sku :
and also on catalog/controller/product/category.php afther line 213 :
All these changes should be made using OCMod or VQMod, instead of altering the original files, but this is what you need to have sku available inside the respective twig template files for those pages.
Code: Select all
$data['sku'] = $product_info['sku'];
Code: Select all
$sql = "SELECT p.product_id, p.sku,
Code: Select all
'sku' => $result['sku'],
Opencart Developer - My Extension Showcase
Contact me at aeon.yoda@gmail.com
Who is online
Users browsing this forum: No registered users and 443 guests