WooCommerce Add to Cart (use default)

Hello,

I have a custom Side Cart for WooCommerce plugin that I am using on this store (necessary as it has specific features for upselling).

How can I output the default WooCommerce Add To Cart button on a Shop Archive, instead of adding a button block with a Link Action > WooCommerce > Add to Cart?

I needed to do the same with the Single Product Template but managed to get that one working as there is the “Add to Cart with Options” block available on a Single Product template

1 Like

I think I got it working with the below PHP inside a Code block but wondering if there is a more elegant way using Cwicly?

<?php

echo do_shortcode ( '[add_to_cart id="' . get_the_ID() . '"]' );

?>

As an alternative, I added a Hook element for the hook “woocommerce_after_shop_loop_item” but the output is the first child items inside and not output in the loop where it should be (i…e you can see all the Add to cart buttons up the top of my screen on the right)

Any ideas?

Hi @grantambrose,

Thanks for bringing this up.
I won’t be able to take a look at this today, but will add it to my to-do and see what’s happening. Moving to bugs to keep track of it.

Cheers,

1 Like