VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product creation => Topic started by: mohtashimj on June 18, 2019, 23:09:21 PM

Title: Price calculation with custom field and more then 1 quantity
Post by: mohtashimj on June 18, 2019, 23:09:21 PM
I am also getting issue for my Virtuemart Store LIKE I have product price as $10 and custom field (for Set Up charges) created with price $50 and when user adding this products with quantity 10 then the products total price is calculating as $600 and which should calculate as $150 ($100 + $50) .
Please any one let me know if I can do that with the help of custom fields?
Title: Re: Price calculation with custom field and more then 1 quantity
Post by: Studio 42 on June 19, 2019, 13:01:07 PM
The price is always added for 1 product. So if you need to have same price for 10, you have to create a plugin which divides the price of the fields eg. for your case 50/10 in the plgVmPrepareCartProduct function.
This need to create your own product custom field.(i can do the work and some other devs here)
Title: Re: Price calculation with custom field and more then 1 quantity
Post by: mohtashimj on June 19, 2019, 21:49:58 PM
Thank you for your reply.

I am also a developer. Can you please let me know what exactly I need to do with the plugin so that I can work on it and will make as I needed.

In my case for one product I have one custom field which need the price to apply only once if customer have more then 1 quantity ie 20 or 10 and will have one more custom field for which price will apply on all the quantity.

Please let me if that will possible from the way you are suggesting?
Title: Re: Price calculation with custom field and more then 1 quantity
Post by: Studio 42 on June 20, 2019, 01:51:21 AM
Check the core vmcustom textinput plugin, you have all the code.
You need to adapt plgVmPrepareCartProduct function ti charge the right price per quantity.