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

Add to cart function

Started by jimpett81, June 24, 2016, 12:25:14 PM

Previous topic - Next topic

jimpett81

Hi All,

I am working on some code to allow customers to add a specific product to the cart from a second add to cart button. It will be a bespoke version of a bolt on type plugin/module. I can add to the cart and place a second button in the perfect place but have one issue, the add to cart button has to behave differently. Currently my client sends people to the cart on adding a product, I would like the extra add to cart button to just add the product and stay on the current page. Is it possible to control the add to cart function in this way?

Thanks,

James

Joomla! 3.5.0 and VirtueMart 3.0.14

Studio 42

The "standard" add to cart button can use modal and your not redirected to the cart, in this case.
Simply load your product (check product modules for eg) correctly and you get never redirect to the cart, if you don't need.

jimpett81

Thanks for the reply,

Can this be configured so that the add to cart button on the main product will take you to the cart but the extra one that I add will not add to cart. A pop up would be fine but I want to leave the main function as it is if possible.

Thanks,

James

Studio 42

Sorry, but this need custom code, because vm code add same javascript for all product forms(using modal or direct add to cart).
I think you have then to copy part of original JS code and change form class.

jimpett81

Okay thanks, I will have to see if I can figure out how to customise the code myself I guess.