News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Custom Field Validation & AJAX add-to-cart

Started by sleepigrl, August 24, 2012, 22:44:24 PM

Previous topic - Next topic

sleepigrl

I'm working on modifying a version of the Custom Input Text customfield to require that the field be completed before the item can be added to the cart.

Attaching the built-in validationEngine to my add to cart form works great as long as the "Display modal popup upon 'Add to cart'" option in the VM config is not selected.  As soon as that's selected, the validation no longer works.  The item is being added to the cart prior to the validation.

Any hints about what I can look for here so that validation is tested prior to the item being added to the cart?

earlybird

Hey I've the same problem did you find a solution for it ?

sleepigrl

Not really.  The validation works fine as long as I don't use an ajax cart and, since the validation was more important, that's where I left it.

earlybird

I got it working now by editing the

components/com_virtuemart/assets/js/vmprices.js

by adding the validator in the beginning of the function cartEffect

if(document.formvalidator.isValid($$('form.product')[0])){


so it is only added, if the form is valid

cheers
Tobi