News:

Support the VirtueMart project and become a member

Main Menu

How to override default price with custom field price

Started by Lexiboy, February 02, 2012, 12:52:44 PM

Previous topic - Next topic

Lexiboy

My question is as the topic, how can I make the price in the custom fields override the productprice instead of adding to it? (I am using Virtuamart 2.0 on Joomla 1.7)

Right now I made the default price NULL and the custom field price is set to the actual price.

This does work by itself, though now the price is only listed at the custom fields and not at the place where you would normally find the custom price. What I did is just not how it is supposed to be...

Any advise is welcome.

Should I just wait for version 2.01?
With kind regards,
Alex Stienstra

nebular

I need this funcionality too.

Please I wondering if there are someone that know how override the default price instead of adding to it?


Thanks in advance.

Georgios Kolomvos

Quote from: Lexiboy on February 02, 2012, 12:52:44 PM
...how can I make the price in the custom fields override the productprice instead of adding to it? (I am using Virtuamart 2.0 on Joomla 1.7)

I use VM 2.5.1 and the problem is still there. I found a workaround that works fine to me:
Edit file administrator/components/com_virtuemart/helpers/calculationh.php
change line 316 from:
$basePriceShopCurrency = $basePriceShopCurrency + doubleval($variant);
to
$basePriceShopCurrency = doubleval($variant);

This way it replaces the base price with the variant price i.e. the price of the custom field instead of adding it.
Georgios Kolomvos
Patras, Greece

Lexiboy

Quote from: gkolomvos on March 04, 2012, 01:54:46 AM
Quote from: Lexiboy on February 02, 2012, 12:52:44 PM
...how can I make the price in the custom fields override the productprice instead of adding to it? (I am using Virtuamart 2.0 on Joomla 1.7)

I use VM 2.5.1 and the problem is still there. I found a workaround that works fine to me:
Edit file administrator/components/com_virtuemart/helpers/calculationh.php
change line 316 from:
$basePriceShopCurrency = $basePriceShopCurrency + doubleval($variant);
to
$basePriceShopCurrency = doubleval($variant);

This way it replaces the base price with the variant price i.e. the price of the custom field instead of adding it.

It would be safer to test if there is a variant before you replace anything. Thank you for sharing where to find the code.
With kind regards,
Alex Stienstra

malibu2792

How is this working for you ? Are you having any problems?

alpertheidiot

cant find this in VM 2.0.3 (H). what do we need to change on this version?