Automatically Price Calculation on Quantity Change

  • Jibon Costa
  • Jibon Costa's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
More
4 years 3 months ago - 3 years 8 months ago #3 by Jibon Costa
Jibon Costa created the topic: Automatically Price Calculation on Quantity Change
Hello Everyone,

I just discovered a very interesting feature in Virtuemart that is automatically calculate price on the based on quantity change. When you will change custom fields on cart item, ajax will fired to calculate total price & that time quantity will post also but for some reason VM developer hasn't activated that feature. But you can activate it easily by following this:

Go TO : JOOMLA ROOT/administrator/components/com_virtuemart/helpers
& open calculationh.php file.

Now search this method:
public function getProductPrices(&$product, $variant=0.0, $amount=0)
that will be located around line number 292.
Under that method search this line:
$price = round($price,$this->_internalDigits-4);
it should be around 484 line. Now change this code by following way:
$price = round($price,$this->_internalDigits-4) * $this->_amount ;
Now save the files & check the shop :). You will see during changing quantity, price is automatically calculating :)
EnJoy :)
Last edit: 3 years 8 months ago by Jibon Costa.
The following user(s) said Thank You: ssnobben

Please Log in or Create an account to join the conversation.

More
1 year 7 months ago #120 by life color
Automatically Price Calculation on Quantity Change
sorry..
in product details change the price on change quantity and this is perfect..
but if i add to cart the total price is multiplied again..
Can you help me?

Please Log in or Create an account to join the conversation.