Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Spleen

    (@sp1een)

    Can’t see your reply…

    Thread Starter Spleen

    (@sp1een)

    I found a solution here that seems to work, at least for me.

    I added this to the theme “functions.php” file:

    /**
    * Redirect to a specific page when clicking on Continue Shopping in the cart
    *
    * @return void
    */
    function wc_custom_redirect_continue_shopping() {
    return 'https://yourdomain.com/your-page/';
    }
    add_filter( 'woocommerce_continue_shopping_redirect', 'wc_custom_redirect_continue_shopping' );

    Ok sorry.. I found this that might solve my problem.

    Hi there,
    I’ve a got a little different problem: my “continue shopping” button redirects to the product page just added, instead to the shop page.

    How can I change this?

    I found that “wc-cart-functions.php” and “class-wc-cart.php” files contains pieces of code which implies the forward button with this link: <a href="%s" class="button wc-forward">%s</a> %s'

    Entirely (from wc-cart-functions.php) is:

    // Output success messages
    	if ( get_option( 'woocommerce_cart_redirect_after_add' ) == 'yes' ) :
    
    		$return_to 	= apply_filters( 'woocommerce_continue_shopping_redirect', wp_get_referer() ? wp_get_referer() : home_url() );
    
    		$message 	= sprintf('<a href="%s" class="button wc-forward">%s</a> %s', $return_to, __( 'Continue Shopping', 'woocommerce' ), $added_text );
    
    	else :
    
    		$message 	= sprintf('<a href="%s" class="button wc-forward">%s</a> %s', wc_get_page_permalink( 'cart' ), __( 'View Cart', 'woocommerce' ), $added_text );
    
    	endif;
    
    	wc_add_notice( apply_filters( 'wc_add_to_cart_message', $message, $product_id ) );
    }

    A second problem is that, when trying to edit this file, the “wc-cart-functions.php” is said to be “inactive”…

    Thanks in advance.

Viewing 4 replies - 1 through 4 (of 4 total)