• Resolved jasmin321

    (@jasmin321)


    In which file I can change the link (Button ‘Add to Cart’) from the product page to the shopping cart??

Viewing 3 replies - 1 through 3 (of 3 total)
  • Mina

    (@purpleberryservices)

    Add this snippet to your child theme’s functions.php file

    add_filter (‘add_to_cart_redirect’, ‘pbs_custom_add_to_cart_url_to_cart’);

    function pbs_custom_add_to_cart_url_to_cart($newUrl) {

    global $woocommerce;
    $newUrl = $woocommerce->cart->get_cart_url();
    return $newUrl;
    }

    Thread Starter jasmin321

    (@jasmin321)

    Thank you for your answer!
    But the function doesn′t work, do you have another tip for me?

    • This reply was modified 8 years, 5 months ago by jasmin321.
    Mina

    (@purpleberryservices)

    Function is well tested and works.

    Can you please let me know where did you copy this code?
    Which theme you are using?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘change link – add to cart page’ is closed to new replies.