Hi,
I want users to redirect to the checkout page when woo-commerce individually sold products have already been added to the cart.
Now following code is working fine with other themes but why it is not working with your theme.
Individually sold product Add to cart URL – https://attnsatishk.sg-host.com/hi-vichar-niyam/
I have added this code in WP Admin –> Snippet –> Add New
add_filter( 'woocommerce_add_to_cart_sold_individually_found_in_cart', 'handsome_bearded_guy_maybe_redirect_to_cart' );
function handsome_bearded_guy_maybe_redirect_to_cart( $found_in_cart ) {
if ( $found_in_cart ) {
wp_safe_redirect( wc_get_page_permalink( 'checkout' ) );
exit;
}
return $found_in_cart;
}