Last active
May 31, 2016 23:52
-
-
Save BFTrick/1508c837d8ef54b43fe175d27057e5d9 to your computer and use it in GitHub Desktop.
Redirect to a specific product category after a product is added to the cart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'woocommerce_add_to_cart_redirect', 'patricks_custom_cart_redirect' ); | |
function patricks_custom_cart_redirect() { | |
// our prodcut category ID | |
$product_cat_id = 10; // replace this number with your category ID | |
// redirect to the page | |
return get_term_link( $product_cat_id, 'product_cat' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment