VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Coding Central => Topic started by: jimijot on September 26, 2013, 23:49:41 PM

Title: probably unit mapping bug in function renderLWHUnitList in shopfunctions.php
Post by: jimijot on September 26, 2013, 23:49:41 PM
There is a problem with displaying unit in category or product page. Displayed unit are uppercase: MM, CM, etc instead of normal case: mm, cm, etc. I've found a bug in function "renderLWHUnitList " in file:
\administrator\components\com_virtuemart\helpers\shopfunctions.php. While the user is choosing unit for product length, width, height or weight in product edit page - the function returns values CM, MM, YD mapped directly in code:

      $lwh_unit_default = array('M' => JText::_ ('COM_VIRTUEMART_UNIT_NAME_M')
      , 'CM'                        => JText::_ ('COM_VIRTUEMART_UNIT_NAME_CM')
      , 'MM'                        => JText::_ ('COM_VIRTUEMART_UNIT_NAME_MM')
      , 'YD'                        => JText::_ ('COM_VIRTUEMART_UNIT_NAME_YARD')
      , 'FT'                        => JText::_ ('COM_VIRTUEMART_UNIT_NAME_FOOT')
      , 'IN'                        => JText::_ ('COM_VIRTUEMART_UNIT_NAME_INCH')
      );


I think the function should rather return mapped values taken from variables:
COM_VIRTUEMART_UNIT_SYMBOL_MM
COM_VIRTUEMART_UNIT_SYMBOL_G
...etc...

defined inside languege files.

I'm not advanced virtuemart user, if it is not a right please let me know.
Title: Re: probably unit mapping bug in function renderLWHUnitList in shopfunctions.php
Post by: Milbo on October 01, 2013, 11:06:02 AM
imho there is a stroupper, which is transforming the string to upper case