Author Topic: [Improvement] Removed redundant code for custom price  (Read 638 times)

thelordofweb

  • Guest
[Improvement] Removed redundant code for custom price
« on: November 26, 2016, 14:22:35 pm »
It will be better if we do not show this string 'No additional charge' in the list with custom fields when the price is 0.

I edited the method _getCustomPrice in administrator/components/com_virtuemart/models/customfields.php

My arguments are:

  • the price of custom fields will never be empty string. It is always 0.000000 ($customPrice is equal to 0.000000).
  • this code is redundant vmText::sprintf('COM_VIRTUEMART_CART_PRICE_FREE',$currency->getSymbol()) because the constant COM_VIRTUEMART_CART_PRICE_FREE does not contain placeholders. The method vmText::sprintf will never replace any placeholders to $currency->getSymbol().
  • I guess, most people do not like the current result. I am pretty sure, most people will be happy if we remove that text from the drop down.

Cheers!

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9838
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: [Improvement] Removed redundant code for custom price
« Reply #1 on: November 26, 2016, 14:45:11 pm »
Some people may use the currency for something like "no extra $", or stuff like that.

Actually we need an option for, then it can be added to the core
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/