• Hello,

    I’m on the cart page. When clicking on a product in the cart, I don’t want to go to the woocommerce single-product-page but to another page: to a custom product page.
    Is there a way to auto-redirect the product on the cart-page to the custom product url?

    The backstory:
    I created a custom product page. It’s not using the woocommerce single-product-page template. It’s just a normal wordpress site as a product page with a BUY NOW button, added with woocommerce shortcode [add_to_cart id=”myproduct”].
    Of course there is a woocommerce single-product-page with all the product information, but I don’t want to show it on the front end…

    Thanks for helping out,
    Michael

Viewing 1 replies (of 1 total)
  • Thread Starter mappel

    (@mappel)

    Okay, I’ve found a great plugin that does just that!
    IW Woocomerce Cart Item Redirect

    my beginner’s mind solution was something like:

    add_action( ‘template_redirect’,’myfunction_redirect’ );

    function myfunction_redirect() {
    if ( is_product() ) {
    return wp_redirect( site_url() );
    exit();
    }

    so every woocommerce single product page is redirected to let’s say a WP overview-product page…

    I really would love to find out, how the plugin is doing what it’s doing, because I want to learn more about WP and woocommerce…
    someone any ideas?
    thanks, mika

Viewing 1 replies (of 1 total)
  • The topic ‘Redirect from Cart-Page to Custom Product Page when clicking the product in cart’ is closed to new replies.