VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product pricing => Topic started by: OriyanJ on March 01, 2016, 09:37:05 AM

Title: How to manually change product's price with a custom field of my own
Post by: OriyanJ on March 01, 2016, 09:37:05 AM
I'm trying to create a drop-down that acts just like a custom field, different options will add different price values to the product.
I know I can do that with a custom field, but in case I don't want or I have a bigger plan\reason to, do you know a way to make the price change by a manual field I've created?

I'm basically selling tours. Quantity acts as number of travelers, I just want another + and - buttons to add travelers with discount (children or students) -

(http://i.imgur.com/YExEUC3.png)

I can add a string custom field that has 10 options that each add price value, but that's (1) bad practice, (2) doesn't affect product's quantity, (3) needs to be added 10 times for each product.

(http://i.imgur.com/SNz1CkH.png)
Title: Re: How to manually change product's price with a custom field of my own
Post by: Studio 42 on March 02, 2016, 02:11:00 AM
Hi,
Check existing testinput plugin in plugins/vmcustom/textinput.
If you don't understand how it work, then you cannot do your own plugin.
But your plugin is possible to do.
Regards,
Patrick
Title: Re: How to manually change product's price with a custom field of my own
Post by: OriyanJ on March 02, 2016, 08:08:38 AM
Thank you, I've managed to achieve the solution needed.