B-219 Sec-55 Noida, India

Add a view cart button to woocommerce product pages

Do you want to add a “view cart” button to woocommerce product pages? Use the below code for it

add_action( 'wp_head', 'add_cart_btn_on_product_page' );

function add_cart_btn_on_product_page() {

var html = '<div class="cart_btn"><a href="<?php echo get_site_url(); ?>/cart/" class="button wc-forward">View Your Cart</a></div><br/>';
$('.single-product form.cart').after(html);

(Visited 70 times, 1 visits today)