EDIT: I'm on OpenCart 3.0.3.2
I want to get the product's stock number on my Category page, so i added this to catalog/controller/product/category.php
$data['products'][] = array(
...,
'stock' => $result['quantity'],
);
and when i add this to [mytheme]/template/product/category.twig:
<p>TEST {{ product.stock }}</p>
it only shows the 'TEST' string without the variable, i just can't pass the .stock variable's value to my .twig file, any suggestions?
TEST {{ product.stock }}
` placed on twig file not in products loop. Try to place it below this string... `{{ product.name }}
` – K. B. Jun 01 '20 at 15:31