Custom Woo add to cart button linking directly to cart (not product single page)

Hi!

I would like for my 3 custom add product to cart buttons on http://dev.sbdagarna.se.loopiadns.com/ to bypass product single page and link directly to cart page http://dev.sbdagarna.se.loopiadns.com/varukorg/.

This is the button-link for one product: http://dev.sbdagarna.se.loopiadns.com/produkt/standard/?add-to-cart=63483. It puts the product in the cart but it unnecessarily links the user to the product single page.

This can be done right?

Also, I’m not sure how to add an ID to a product.

Please help.

<3

@Lobsterass,

Thanks for reaching out.

Your issue can be done with customization. Regretfully, customization is outside the scope of our theme support. You may seek help for a 3rd party developer or you avail our One, where it will answer everything about your question.

Hope that helps and thank you for understanding.

…Oh…the old suport guys used to help out with little things like this.

Could you please tell me why my buttons add the wrong product in the cart then?

Basic - Standard - Pro is the order.

Hi @Lobsterass,

Thank you for reaching out to us. To redirect your page to cart page directly please change your links to this format:

https://yourdomain.com/cart/?add-to-cart=25

Since your cart page name is varukorg so you can replace cart with varukorg in the above link so that your new link will look like this:

http://dev.sbdagarna.se.loopiadns.com/varukorg/?add-to-cart=63483

I checked your setup and It seems like you’ve inserted wrong IDs of the product in the links that’s why they are adding not correctly, please use the correct product IDs to fix this issue. To find out product IDs please see products section here https://docs.woocommerce.com/document/woocommerce-shortcodes/#section-9

Hope this helps!

Hi!

Thanx. I read that and that’s how I got here. It still doesn’t say where I can find out the ID:s of the individual products.

I got my ID:s by copying the link on “related products”. What’s wrong with these?

(That first link leads to the correct BASIC product but it adds PRO to the cart.)

Also, it seems illogical to me that there wouldn’t be a better solution for this woo flow. I mean, why do you even have the possibility to add prices (basic-standard-pro) with a buy button, when a click on that button adds the product to the cart (good) but you STILL have to go through the product single page for no reason? The user might think he has to add the product again on the product single page and then he’ll have 2 products in the cart instead of the one he wanted.

Is there a better way to achieve this than using the cornerstone BUY buttons? Please feel free to suggest what to do to achieve what my client wants (see pic below). I was gonna do my own 3 column designs with this info and add the above discussed custom BUY buttons.
<3

Hi @Lobsterass,

While you are adding the product to the cart by adding the add-to-cart attribute it works like the Add to Cart button of the single product page.
Now if you want to open the cart page once it added to the cart, you just need to enable the option Redirect to the cart page after successful addition from WooCommerce > Settings > Product > General > Add to cart behaviour.

Once it is set, the cart page will open directly once the product added through the URL.

Hope it helps.

Thanks

1 Like

@tristup thank you! This is EXACTLY what I was looking for. Great! Happy camper again!

Awesomeness!

<3

You are most welcome.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.