VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: borro on November 25, 2015, 10:11:42 AM

Title: How to add the second "Add to cart" button?
Post by: borro on November 25, 2015, 10:11:42 AM
Hello, friends.

Does somebody have an idea about how to add the second "Add to cart" button?
I need such button to enable simulation of an adding the product with some predefined customfield value. That is when I click a standard "Add to cart" button i should see the "product1" in my cart, and when i'm pressing this second special "addtocart" button cart should be filled with a "product1" having some customefield "color" appointed to "red" for example.

May be I have to use some javascript, which will create a fake addtocart button which initialise a real click on a native button. And of course there have to be a hidden customfield on a product page. if you are clicking at native addtocart button before initialising the real click script have to delete such hidden customfield html code from a code of a whole page to not send any customfield to a cart. What do you think about it? But stop, if a product can have any customfiled as an atribute of a card even clicking on a native "addtocart" button will lead to showing such customefield in a cart and in a e-mail message. I don't need it. So I simply need to hide an output of such customfields by template override, don't I? I ask your advice.

Thank you

Virtuemart 3.0.9
Title: Re: How to add the second "Add to cart" button?
Post by: borro on December 09, 2015, 07:47:42 AM
Any ideas?