Support the VirtueMart project and become a member

Main Menu

How to show SKU and GTIN in product and category layout?

Started by lukab, February 25, 2016, 15:58:58 PM

Previous topic - Next topic


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.

GJC Web Design

also for details Copy /components/com_virtuemart/views/productdetails/default.php to /templates/yourtemplate/html/com_virtuemart/productdetails and add the code
GJC Web Design
VirtueMart and Joomla Developers - php developers
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
Contact for any VirtueMart or Joomla development & customisation


IMHO - adding a few lines to a template override, is far easier and more manageable than using customfields

e.g. for the category view:-


//GTIN may be empty for a product
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

Joomla 3.10.11
php 8.0


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 Schumacher - VirtueMart Invoice Layouts

Please use only stable versions with even numbers for your live shop! Use Alpha versions only if you know what risk you are taking.