Title: Disable a feature
Last modified: April 9, 2020

---

# Disable a feature

 *  Resolved [matthewnikolaeff](https://wordpress.org/support/users/matthewnikolaeff/)
 * (@matthewnikolaeff)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/disable-a-feature/)
 * Hello! My question is: You have a feature, allowing customers to buy products
   from different vendors in a single order. How can I disable this feature? I need
   a customer to do two different orders if he is buying from two vendors. Thank
   you

Viewing 1 replies (of 1 total)

 *  [DualCube](https://wordpress.org/support/users/dualcube/)
 * (@dualcube)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/disable-a-feature/#post-12654083)
 * Hi [@matthewnikolaeff](https://wordpress.org/support/users/matthewnikolaeff/),
   thanks for the query.
 * In order to restrict the customers to buy from more than one vendor, you have
   to use this code :
 *     ```
       add_action('woocommerce_add_to_cart_validation','woocommerce_add_to_cart_validation',10,3);
       function woocommerce_add_to_cart_validation($passed, $product_id, $quantity){
           foreach (WC()->cart->get_cart() as $cart_key => $cart_item ){
               $cart_vendor = get_wcmp_product_vendors($cart_item['product_id']);
               $product_vendor = get_wcmp_product_vendors($product_id);
               if($cart_vendor && $product_vendor){
                   if($cart_vendor->id != $product_vendor->id){
                       $passed = false;
                       wc_add_notice( __( 'Another vendor product is already in your cart.', 'woocommerce' ), 'error' );
                       return $passed;
                   }
               }
           }
           return $passed;
       }
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Disable a feature’ is closed to new replies.

 * ![](https://ps.w.org/dc-woocommerce-multi-vendor/assets/icon-256x256.gif?rev=
   3314608)
 * [MultiVendorX - WooCommerce Multivendor Marketplace AI Powered Solutions](https://wordpress.org/plugins/dc-woocommerce-multi-vendor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/dc-woocommerce-multi-vendor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/dc-woocommerce-multi-vendor/)
 * [Active Topics](https://wordpress.org/support/plugin/dc-woocommerce-multi-vendor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/dc-woocommerce-multi-vendor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/dc-woocommerce-multi-vendor/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [DualCube](https://wordpress.org/support/users/dualcube/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/disable-a-feature/#post-12654083)
 * Status: resolved