Title: REDIRECTION
Last modified: June 26, 2020

---

# REDIRECTION

 *  [shayed](https://wordpress.org/support/users/shayed/)
 * (@shayed)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/redirection-58/)
 * Bro thanks for your code which direct customer to vendor page when click to add
   to cart. But problem arise
 * when there is a item already in cart.
    click add to cart from single product 
   page shows Item(s) from one store already in your cart. First checkout with those
   and then purchase from other stores!. but when u click add to cart from shop 
   page or product archieve page instead of show that message it redirect to homepage.
   NOTE: i am using one vendor at a time for check out.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [WC Lovers](https://wordpress.org/support/users/wclovers/)
 * (@wclovers)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/redirection-58/#post-13075614)
 * Can you please share which code previously I provided you?
 *  Thread Starter [shayed](https://wordpress.org/support/users/shayed/)
 * (@shayed)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/redirection-58/#post-13075683)
 * add_filter( ‘woocommerce_add_to_cart_redirect’, function( $url, $product ) {
   
   if( $product && is_object( $product ) && method_exists( $product, ‘get_id’ ) &&
   function_exists( ‘wcfm_get_vendor_id_by_post’ ) ) { $vendor_id = wcfm_get_vendor_id_by_post(
   $product->get_id() ); if( $vendor_id && function_exists( ‘wcfmmp_get_store_url’)){
   $url = wcfmmp_get_store_url( $vendor_id ); } } return $url; }, 500, 2 );
 *  Plugin Author [WC Lovers](https://wordpress.org/support/users/wclovers/)
 * (@wclovers)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/redirection-58/#post-13093098)
 * > but when u click add to cart from shop page or product archieve page instead
   > of show that message it redirect to homepage.
 * – Does your theme has any special redirect option after add to cart?
 *  Thread Starter [shayed](https://wordpress.org/support/users/shayed/)
 * (@shayed)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/redirection-58/#post-13094555)
 * I am using oceanwp theme. I dont know whether it has or not but from woocommerce
   i have activated that option.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘REDIRECTION’ is closed to new replies.

 * ![](https://ps.w.org/wc-multivendor-marketplace/assets/icon-256x256.gif?rev=2611991)
 * [WCFM Marketplace - Multivendor Marketplace for WooCommerce](https://wordpress.org/plugins/wc-multivendor-marketplace/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wc-multivendor-marketplace/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wc-multivendor-marketplace/)
 * [Active Topics](https://wordpress.org/support/plugin/wc-multivendor-marketplace/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wc-multivendor-marketplace/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wc-multivendor-marketplace/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [shayed](https://wordpress.org/support/users/shayed/)
 * Last activity: [5 years, 11 months ago](https://wordpress.org/support/topic/redirection-58/#post-13094555)
 * Status: not resolved