VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: bsjelin on March 06, 2017, 21:26:10 PM

Title: Product Addons
Post by: bsjelin on March 06, 2017, 21:26:10 PM
Hello - this is a super simple question, but I cant seem to find a straight answer on any of the other forum posts.

What I'm trying to do is simple... a product addon that can be attached to any product without creating 5,000 child products.

Example:

Gift Wrapping: +$5.00
Autographed: +$5.00

Just a simple checkbox to increase the price of the product by the amount mentioned. Hopefully that make sense. I tried using the multi-variation option but that still just creates tons of child products.

Thanks in advance!

PS~ Forgot to mention I am working with the newest version of Virtuemart at the moment. 3.0.18
Title: Re: Product Addons
Post by: Studio 42 on March 06, 2017, 22:40:43 PM
You can use the list option with value Yes/No and set price to +$5.00 in case of yes.
YOu can use this for customfield string, and  you see then in cart
Gift Wrapping : yes(or no)
Autographed : yes(or no)
in the cart
Title: Re: Product Addons
Post by: bsjelin on March 06, 2017, 23:40:00 PM
I think I tried that once and it wouldn't update if they went back to NO after - say if they changed their mind and switched it back to NO, the total price remained the same.

Is there any way to set it up as a checkbox option instead maybe?
Title: Re: Product Addons
Post by: Studio 42 on March 07, 2017, 00:33:12 AM
YOu can siwtch from list to ratio button directly.
Else for checkbox You can override the layout in your template
YOURSITE\components\com_virtuemart\sublayouts\customfield.php
search for
            case 'B':
            case 'S':
            case 'M':

and modify the code after.
Title: Re: Product Addons
Post by: bsjelin on March 07, 2017, 01:16:04 AM
I found this - not EXACTLY what I was looking for but seems to have done things a little easier.

https://forum.virtuemart.net/index.php?topic=127362.0

Hopefully it stays up to date - I'd prefer to do it without any plugins or hacks.
Title: Re: Product Addons
Post by: balai on March 07, 2017, 13:07:15 PM
Check also that
https://breakdesigns.net/extensions/customfields-for-all
Title: Re: Product Addons
Post by: Studio 42 on March 07, 2017, 14:09:54 PM
Quote from: bsjelin on March 07, 2017, 01:16:04 AM

Hopefully it stays up to date - I'd prefer to do it without any plugins or hacks.

Hi,
overriding a file is not a hack
And "without any plugins", is what you do now ;)