stuart-d
5/26/2017 - 3:35 PM

This will redirect the customer the referring url on login to WooCommerce.

This will redirect the customer the referring url on login to WooCommerce.

function wc_custom_login_redirect() {
	// This will redirect the customer the referring url on login to WooCommerce..
	$location = $_SERVER['HTTP_REFERER']; 
	wp_safe_redirect($location); 
	exit(); 
}
add_filter('woocommerce_login_redirect', 'wc_custom_login_redirect');