Joomla 2.5.28
VM 3.0.9
PHP 5.4
I'll update later to newer version but right now I need to make it to SKU and GTIN show in product and category layout..any help?
I tried a lot of thing but it didn't work.
Copy /components/com_virtuemart/sublayouts/products.php to /templates/yourtemplate/html/com_virtuemart/sublayouts. Create the folder if it doesn't exist. Edit this new products.php file (which is now placed in your template folder). Put the shown code wherever you want SKU/GTIN to show up.
also for details Copy /components/com_virtuemart/views/productdetails/default.php to /templates/yourtemplate/html/com_virtuemart/productdetails and add the code
IMHO - adding a few lines to a template override, is far easier and more manageable than using customfields
e.g. for the category view:-
\templates\yourtemplate\html\com_virtuemart\sublayouts\products.php
//GTIN may be empty for a product
if(!empty($product->product_gtin){
echo $product->product_gtin;
}
echo $product->product_sku;
You can then forget about customfields and the data will be shown if entered on the product record
Yes, EvanGR, as AH mentioned earlier.
A moderator should just delete all the misinformation about custom fields to get a clear path here.
A template override is the only viable solution.
Stefan