Author Topic: How to display unit measurement in product details?  (Read 2305 times)

coldshot

  • Beginner
  • *
  • Posts: 17
How to display unit measurement in product details?
« on: June 28, 2010, 03:37:51 am »
Hi there.

I'm new to VM so i would very much appreciate some assistance.

I'm running an online store selling clothes using VM 1.1.14

I have an issue trying to get the unit measurement(cm) to show up when i click on product details.

I've attached the product type to my products.

Its showing the value of the measurement but not the unit as per the attached

I've gone through the manual but can't seem to find a solution.

Appreciate if someone could point me in the right direction.

Thank you

[attachment cleanup by admin]

rb

  • Advanced
  • Full Member
  • *****
  • Posts: 1503
Re: How to display unit measurement in product details?
« Reply #1 on: June 29, 2010, 01:05:34 am »
coldshot,
I believe you have found a problem in a theme template.

To enable a "Product Type" to display the "unit" associated with a parameter of that Product Type  (not the "unit" in the Product table), make a copy of, then edit:
     components/com_virtuemart/themes/default/templates/common/product_type.tpl.php

Find these 3 lines near the bottom:
Code: [Select]
if ( !empty($product_type_params["unit"] ) ) {
echo " ".$product_type_params["unit"];
} ?>

Change them to this:
Code: [Select]
if ( !empty($product_type_params["parameter_unit"] ) ) {
echo " ".$product_type_params["parameter_unit"];
} ?>

Save and test.

coldshot

  • Beginner
  • *
  • Posts: 17
Re: How to display unit measurement in product details?
« Reply #2 on: June 30, 2010, 18:14:10 pm »
Thank you very much!!