Need to display sku in product list at virtuemart

394 Views Asked by At

I need to display the product sku in the product list of virtuemart joomla. Is there a way to accomplish this?

1

There are 1 best solutions below

0
Kevin Ballard On

This may depend on the version of Virtumart you are running, but you should be able to do this through the use of a template override.

  1. In your websites file system copy the following file. /component/com_virtuemart/sublayouts/products.php
  2. In the template folder of the template you are running on your site create the folder, /templates/yourtemplate/html/com_virtuemart/sublayouts and paste in the products.php file
  3. Open the products.php file in your text editor of choice
  4. Locate this code (or similar depending on the version) foreach ( $products as $product ) {
  5. You are now inside the loop which outputs the list of products. Locate where you want to place the SKU and paste in echo $product->product_sku;
  6. Save the file
  7. Refresh the category page

If done correctly, where an SKU exists for the product it will appear in the product box where you have placed the code.

It's important to put this change in your template overrides to avoid your change being lost when you next update Joomla and Virtumart.

Good luck with your updates.

KevBallard