I can't figure out how to change the button in the category page.
I am trying to redirect to the checkout page, when that customer press the add to cart button.
With this code in the function.php
I got this working for the single product page.
add_filter('woocommerce_add_to_cart_redirect', 'themeprefix_add_to_cart_redirect');
function themeprefix_add_to_cart_redirect() {
global $woocommerce;
$checkout_url = wc_get_checkout_url();
return $checkout_url;
}
But this doesn't affect the category page. If the customer press the button here, nothing changes...
Hope someone has a solution for that.