Claim your freedom to choose the perfect partner for your multi-vendor journey.

FREEDOM25

Celebrate the festive season by giving your marketplace a powerful lift!

FESTIVE20

5.0.0
Something big is coming for marketplace admins… MultiVendorX 5.0 is almost here. Are you ready?
Be the first to explore all the game-changing features!
Power your marketplace dreams with unbeatable Black Friday deals!

MVXBLACK30

Supercharge your marketplace vision with unstoppable Cyber Monday deals!

MVXCYBER30

Holiday cheer, bigger savings
Take 25% off-because your marketplace deserves a gift too.

happyholiday

Limiting checkout to 1 vendor

Resolved
Viewing 1 reply thread
  • Author
    Posts
    • #133618
      kevin.batchelor
      Participant

      Good Day

      We are having trouble with our courier partner and dispatching items for Multi basket checkout.

      Is there a way to not allow users to add items to their cart if it Is coming from multiple vendors? We would like to allow single carts from single vendors

    • #133649

      Hi Kevin, thanks for getting in touch with us.

      In order to allow users to add from one vendor only please add this code in the function.php of the theme :

      ‘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 reply thread
  • The topic ‘Limiting checkout to 1 vendor’ is closed to new replies.
Shopping Cart
Scroll to Top