VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: vigier on May 27, 2012, 03:19:45 AM

Title: How can I add a procedure for a check when the user hits add-to-cart
Post by: vigier on May 27, 2012, 03:19:45 AM
Hi,

I want to add a sort of check on the options before an item can be added to the cart. Some products have 2 custom_text_plugin fields where the user must fill in the dimensions of the product that he wants. What I want to check before an item is added:
After it has checked the fields:

I think I have to add something to default_addtocart.php...Does anybody know how to do this?
Title: Re: How can I add a procedure for a check when the user hits add-to-cart
Post by: vigier on May 27, 2012, 03:57:57 AM
Hi,

been searching around myself a little more and found the components\com_virtuemart\helpers\cart.php. There is the check for the quantity and it can also show a popup.
So to see there is also access to alle the fields of product that's being added. Don't see how to get access to the custom fields, but I might find that out to.

I think I have to create a similar function like checkForQuantities with a possible false return value and add this new function as an extra check to the add function?
Am I right?

But that's something for tomorrow, it's 4 in the morning over here...