News:

Support the VirtueMart project and become a member

Main Menu

Custom Plugin required

Started by lbar, October 15, 2012, 18:47:50 PM

Previous topic - Next topic

lbar

VM: 2.0.10
JOOMLA: 2.5.6

Hi guys, i'm gonna to develop a custom plugin for my virtuemart.
Basically it's a copy of textinput (with cart modification true), that i wanna become a required field (actually if the user doesn't write anything on this field the product will be added however on the cart, instead i want that the user must write something there).

I'm trying to bind  .submit() function with jquery on tmpl/default.php file but no luck. It's look like that the .submit() of the form is before.

Someone can put me on the right direction on how can do that?

Thank you for your support.
:)

PolishedGeek

Hi, do you have any experience with Breezing Forms?  If you do, you could do this with an embedded Breezing Form inside the product page, rather than a custom plugin.  We have shared some info here in the 3rd party extension forum: http://forum.virtuemart.net/index.php?topic=108824.msg364211#msg364211
~ Deb Cinkus, CEO
Polished Geek, LLC   |    www.PolishedGeek.com

Creators of JoomLister - eBay Lister for Joomla!

lbar

Thank you, but i prefer develop plugin myself.

Someone can put me on the right direction on this matter?

Thank you.

lbar

Solved, with a tuning of /com_virtuemart/assets/js/vmprices.js, inside:

product : function(carts) {
.....

added:

if (jQuery('input.required_attr').exists()){
                                                 required  = jQuery('input.required_attr').val();
                                                 if (required==""){
                                                   alert("Please insert the data");
                                                   return false;
                                                 }
                                                }

just before Virtuemart.sendtocart(cart);
In my virtuemart plugin added "required_attr" in the field added....
Not sure that this is the better way, but actually works... :)


PolishedGeek

Congrats! Simple solutions are always good.
~ Deb Cinkus, CEO
Polished Geek, LLC   |    www.PolishedGeek.com

Creators of JoomLister - eBay Lister for Joomla!