WooCommerce Add to Cart Custom Redirect creates a WooCommerce product data field under the General Product Data tab of a product’s edit page. As a WooCommerce admin, you can insert a URL into the field and when that product is added to the cart by your customers, they will be redirected to the URL. This concept works great if you are prompting your customers to preview Product B after Product A is added to the cart.
Ren Ventura
Featured Blog Post
We host EngageWP on SiteGround WordPress hosting service. Read our SiteGround review to find out why we love them so much.
Affiliate Disclosure
Some of the links in this post may be "affiliate links." This means that if you click on the link and purchase the item to which we are linking, we may receive an affiliate commission. We want to emphasize that we do not, and never will, link to a product only for possible financial gain. Doing so does not provide real value, and is a disservice to our readers. We do not link to products we feel are inferior, and we are not compensated for any positive review. Privacy Policy
Dave says
Hi Ren,
Being cheeky here I know, so, firstly I’d like to thank you for this excellent plugin and was wondering if you could help me add one more bit of functionality?
I’d like to add products into the database that can be searched for, have detailed descriptions but… when ordered go to an external site for order processing. Your plugin works excellently except that I’d like to add a routine that deletes the (clicked) ordered item from the cart therefore leaving only ‘normal’ internal products to be ordered via the usual checkout process.
Basically add a routine inside rv_redirect_to_url() before wp_redirect( $rv_woo_redirect_url ); of the ilk;
foreach ($woocommerce->cart->get_cart() as $cart_item_key => $cart_item) {
if ($cart_item[$FOO] == $BAR[$BAZ] ) {
$woocommerce->cart->get_remove_url($cart_item_key);
}
}
Is this possible, or indeed advisable? Any pointer comments most welcomed.
Kind regards,
Dave
Glen Schaefer says
I simply want to redirect the product links so that they go to a custom URL that I can set for each product. i.e. I don’t want to use the default Woocommerce shop.
I have searched for hour trying work out how to do this but can’t seem to find a way that works.
Any solution would be greatly appreciated.