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

Field product_unit should have CHAR(5) instead of CHAR(4)

Started by Uke, August 30, 2013, 12:38:57 PM

Previous topic - Next topic

Uke

Hello!

I have updated from v2.0.22a to V2.0.22b and the update info says that the db field "product_unit" was changed to 4 chars:

QuotealterTable CHANGE rq5io_virtuemart_products.product_unit : ALTER TABLE `rq5io_virtuemart_products` CHANGE COLUMN `product_unit` `product_unit` CHAR(4)

In /administrator/components/com_virtuemart/helpers/shopfunctions.php there is the function renderUnitIsoList:

Quotestatic function renderUnitIsoList($name, $selected){

      $weight_unit_default = array(
         'KG' => JText::_ ('COM_VIRTUEMART_UNIT_SYMBOL_KG')
      , '100G' => JText::_ ('COM_VIRTUEMART_UNIT_SYMBOL_100G')
      , 'M'   => JText::_ ('COM_VIRTUEMART_UNIT_SYMBOL_M')
      , 'SM'   => JText::_ ('COM_VIRTUEMART_UNIT_SYMBOL_SM')
      , 'CUBM'   => JText::_ ('COM_VIRTUEMART_UNIT_SYMBOL_CUBM')
      , 'L'   => JText::_ ('COM_VIRTUEMART_UNIT_SYMBOL_L')
      , '100ML'   => JText::_ ('COM_VIRTUEMART_UNIT_SYMBOL_100ML')
      );
      foreach ($weight_unit_default as  $key => $value) {
         $wu_list[] = JHTML::_ ('select.option', $key, $value, $name);
      }
      $listHTML = JHTML::_ ('Select.genericlist', $wu_list, $name, '', $name, 'text', $selected);
      return $listHTML;
   }

So i think the field "product_unit" should be changed not to 4 but to 5 chars to fit even the "100ML"?

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/