VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product creation => Topic started by: JacoboPS on February 12, 2016, 23:35:58 PM

Title: Conditional Custom Field
Post by: JacoboPS on February 12, 2016, 23:35:58 PM
Hello,

I have a question, and I hope the answer isn't: "you can't".

I sell bulk spices, in 100 grs steps. But if anyone choses 3 units of 100 grs (that is, 300 grs.), I want to give them the choice of a single packaging or a 3 packages of 100 grammes. So to do that, I have created a string with two options (to be chosen by the client):

- A single package
- Single packages of 100 grs.

And I want to show that options "only" when the client choses more than one unit (100 grs). How can I do this?

Thank you very much,
Title: Re: Conditional Custom Field
Post by: GJC Web Design on February 12, 2016, 23:44:44 PM
I would try with JS..  choosing quantities triggers functions in the vmprices.js and you could either code there to unhide the custom fields or just detect clicks or a keyup in the quantity elements-- test the quantity if >1 unhide the custom fields display
Title: Re: Conditional Custom Field
Post by: JacoboPS on February 15, 2016, 13:45:18 PM
Thank you for the suggestions, GJC Web Design. I was hoping that the functionality could already exist, since I don't code (I can copy and test and copy and test, but... :-\). I'll consider about hiring a freelance for this and other changes I also need.