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

probably unit mapping bug in function renderLWHUnitList in shopfunctions.php

Started by jimijot, September 26, 2013, 23:49:41 PM

Previous topic - Next topic

jimijot

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.

Milbo

imho there is a stroupper, which is transforming the string to upper case
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/