Search code examples
phpwordpresswoocommerceproductcart

CartFlows: Force add to cart redirection to cart page in WooCommerce


In my WooCommerce website, I have installed WooCommerce Checkout & Funnel Builder by CartFlows plugin to make my WooCommerce checkout page more neath, but for some reason if I click add to cart in my site, it redirects to Checkout page not in cart pages. I'm thinking that the problem is the CartFlows plugins cause the steps of CartFlow: as you can see in the screenshot, it is only 2 pages:

enter image description here

How can I make my add to cart button redirect to cart page.

In the screenshot, you can see that it redirects to the checkout page upon clicking on add to cart button:

enter image description here


Solution

  • Try to use the following code snippet, without any guaranty:

    add_filter ('woocommerce_add_to_cart_redirect', function( $url, $adding_to_cart ) {
        return wc_get_cart_url();
    }, 999999, 2 ); 
    

    It could work with Cartflow plugin.