VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: ukfish1 on October 03, 2016, 11:26:22 AM

Title: Remove +£10 from custom fields.
Post by: ukfish1 on October 03, 2016, 11:26:22 AM
Hi

VM 3.0.14
Joomla 3.6.2

I have removed "no additional charge" from the custom fields by editing the language file. How do I remove "+£10" from the custom fields?

Thanks, Paul
Title: Re: Remove +£10 from custom fields.
Post by: ukfish1 on October 06, 2016, 12:05:16 PM
can anyone help with this please?

Paul
Title: Re: Remove +£10 from custom fields.
Post by: GJC Web Design on October 06, 2016, 23:30:52 PM
exactly want custom field? There's loads of them

url? screenshot? info?
Title: Re: Remove +£10 from custom fields.
Post by: ukfish1 on October 27, 2016, 21:12:03 PM
the custom filed is a "string" showing different prices for different variations on each product. See attached screen shot. I want to remove the +£20 but still want the displayed price to change when each variation is selected.

I was able to remove "no additional charge" if the price is the same but can't find where to hide the plus or minus amount.

thanks, Paul
Title: Re: Remove +£10 from custom fields.
Post by: ukfish1 on October 31, 2016, 13:03:42 PM
any further thoughts on this??
Title: Re: Remove +£10 from custom fields.
Post by: kishoreonwork on October 31, 2016, 13:12:55 PM


what is the name of custom field and what type of custom field you are using ? It is probably the default value set in the custom field

Thank
Kishore
Title: Re: Remove +£10 from custom fields.
Post by: ukfish1 on October 31, 2016, 13:17:17 PM
the custom filed is a "string" showing different prices for different variations on each product. See attached screen shot attached in earlier post. I want to remove the +£20 but still want the displayed price to change when each variation is selected.

I was able to remove "no additional charge" if the price is the same but can't find where to hide the plus or minus amount.

Think it has something to do with editing line 906 in /administrator/components/com_virtuemart/models/customfields.php but not exactly sure which code to remove.

Paul
Title: Re: Remove +£10 from custom fields.
Post by: ukfish1 on November 02, 2016, 11:25:29 AM
906 in /administrator/components/com_virtuemart/models/customfields.php

static function _getCustomPrice($customPrice, $currency, $calculator) {
      if ((float)$customPrice) {
         $price = strip_tags ($currency->priceDisplay ($calculator->calculateCustomPriceWithTax ($customPrice)));
         if ($customPrice >0) {
            $price ="+".$price;
         }
      }
remove the + and .$price from the above and it removes the price variation

paul
Title: Re: Remove +£10 from custom fields.
Post by: jenkinhill on November 02, 2016, 12:14:48 PM
Yup, like this http://forum.virtuemart.net/index.php?topic=133755.msg464202#msg464202  - but it is a hack that needs re-applying whenever VM is updated.

Or this is a config option in https://breakdesigns.net/extensions/customfields-for-all
Title: Re: Remove +£10 from custom fields.
Post by: K&K media production on November 03, 2016, 19:31:42 PM
or use a override for the sublayout customfield.php and remove the $price around line 526/528