Tuesday, 15 August 2017

WOOCOMMERCE - CART: REDIRECT EMPTY CART TO EMPTY CART PAGE

Here it the working code and you need to add this into your functions.php file:

WOOCOMMERCE HOOK- CART: REDIRECT EMPTY CART TO EMPTY CART PAGE


add_action("template_redirect", 'redirection_function');
function redirection_function()
{
global $woocommerce, $woocommerce_errors;
if (is_cart() && sizeof($woocommerce->cart->cart_contents) == 0)
{
wp_safe_redirect(get_permalink(get_page_by_path('cart/cart-empty')));
}
}

1 comment:

  1. Thank you for sharing excellent information. Your website is very cool. Fully useful your blog post... Online shopping website in india

    ReplyDelete

Google Map Filter Api Example

Here is Google Map Filter Api Example: