News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

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

lukab

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.

Ghost

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 https://www.gjcwebdesign.com
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
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

AH


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
Regards
A

Joomla 3.10.11
php 8.0

StefanSTS

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
--
Stefan Schumacher
www.jooglies.com - 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.