How to Quick Add to Cart

Buddings
Excursionist
37 1 3

Hello I am using Ira theme. When I click the quick add button, it brings me to another add to cart popup. How do I skip this popup and add 1 quantity whenever i click quick add?

website: buddings.co

From this Screenshot 2021-07-01 110127.png ,

skip this Screenshot 2021-07-01 110144.png

to this Screenshot 2021-07-08 115525.png

0 Likes
EyeR
Excursionist
36 3 5

The code for the add to cart calls the section you'd not want ...  then after in that section you do want, it actually adds to the cart...

If you was to steal the code from the section you do want, and paste it over the section you don't, when that function is called by clicking the button it'll logically jump to the code you want.  Might be good to comment out the excess you create in this process, and might be even better to do so to a child theme to prevent updates to the theme clobbering your changes.

0 Likes
Buddings
Excursionist
37 1 3

@EyeR Hello do you mind going into more details regarding this? I am not very proficient in code.

I tried to replace the button but it ended up going to the cart page without adding the quantity

0 Likes
EyeR
Excursionist
36 3 5

Taking a little poke around your site .... Are you sure you want to do that?

Currently, there's 'an extra click' to get it into the cart - but this stage allows the user to select a quantity, and other options...  The 'extra' click is a small price to pay...

However, it seems you can adjust quantities from the cart - so this stage could be eliminated with little function loss.

You may be able to swap out your cart - or augment it - using an 'app', which is likely to be your easiest path.  A quick skim through the code suggests that when you click the quick add it fires up the dialog to select quantities, and the 'go' button in there submits the details to the cart. To eliminate this stage you'd need to populate and fill the form directly - as you've noticed, it doesn't gain a quantity value, it might be possible to 'hard set' that to '1' and otherwise recycle the submission code from the product page view's add to cart button.

The 'how' of that is a little more complex than I was anticipating, I was going to paste a few lines of the existing code but there was more than I'd thought, and ultimately cascades across a few functions.  It occurs to me that you might be able to remap the button to post a common HTML form composed of the item ID along with the fixed quanity of one to the cart  - which is about as simple as code can get - but I'm not sure if the cart is expecting any other information, or what will break by doing this.



0 Likes
Buddings
Excursionist
37 1 3

@EyeR Hello sorry for the late reply! Could you show me the code for "remapping the button to post a common HTML form composed of the item ID along with the fixed quantity of one to the cart", I'll try to add it in the code and see if anything changes

Thanks alot

0 Likes