Is there a way to set custom url redirect for items in certain category only?
I’ve searched & found this but this is redirecting all add to cart items to checkout page.
add_filter ('add_to_cart_redirect', 'redirect_to_checkout');
function redirect_to_checkout()
{
global $woocommerce;
$checkout_url = $woocommerce->cart->get_checkout_url();
return $checkout_url;
}
This will redirect for items added to the cart that are in the product category “payments” (skips the cart and redirects to checkout for those items only). Items added to the cart from other taxonomies are not effected.