Custom View Cart Button Via WooCommerce Hook / function php

I am developing an ecommerce store based on WooCommerce.

I would like to add an View Cart Below the Add To Cart Button. It would be even better if it could only shown after adding at least 1 item in the cart successfully.

//add view cart button after add to cart button

add_action('woocommerce_after_add_to_cart_button','view_cart_store');
function view_cart_store() { ?>
<a class="button wc-forward" href="https://example.xxx/cart/"><?php _e( 'View Shopping Cart', 'woocommerce' ) ?></a>
        <?php
        }

Thank you in advance!

Read more here: Custom View Cart Button Via WooCommerce Hook / function php

Leave a Reply

Your email address will not be published. Required fields are marked *