• Resolved bharti18

    (@bharti18)


    Hello,

    I want to add Continue shopping button on a single product pages after view cart button. Instead of that, How to change the “Add to cart” to “Continue Shopping” Once the product is added to the cart.?

    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi

    // Add continue shopping button to Single product page, Cart page and Checkout page.
    
    /* Single product
    
    add_action( 'woocommerce_after_add_to_cart_button', 'ahirwp_continue_shopping_button_to_single_product' );
    function ahirwp_continue_shopping_button_to_single_product() {
     $shop_page_url = get_permalink( woocommerce_get_page_id( 'shop' ) );
     echo ' <a class="continue button" href="'.$shop_page_url.'">Continue Shopping</a>';
    
    }
    
    /* Cart
    
    add_action( 'woocommerce_cart_actions', 'ahirwp_continue_shopping_button_to_cart' );
    function ahirwp_continue_shopping_button_to_cart() {
     $shop_page_url = get_permalink( woocommerce_get_page_id( 'shop' ) );
     echo ' <a class="continue button" href="'.$shop_page_url.'">Continue Shopping</a>';
    
    }
    
    /* Checkout
    
    add_action( 'woocommerce_review_order_before_submit', 'ahirwp_continue_shopping_button_to_checkout' );
    function ahirwp_continue_shopping_button_to_checkout() {
     $shop_page_url = get_permalink( wc_get_page_id( 'shop' ) );
    echo ' <a class="continue button" href="'.$shop_page_url.'">Continue Shopping</a>';
    
    }

    Code goes in functions.php

    Thanks
    Ahir Hemant

    Plugin Support Gabriel – a11n

    (@gabrielfuentes)

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – we’ll be here if and/or when you are ready to continue.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘adding continue shopping button’ is closed to new replies.