Banner Logo

Be a part of the family: Connect, Receive Support,
Contribute, and Reap Abundant Rewards!

Disable sub orders/split orders for specific vendors

MultivendorX Pro

Resolved
Viewing 2 reply threads
  • Author
    Posts
    • #194892
      Zia Rahim
      Participant

      We have taken over the management of some of our vendor’s logistics so we have multiple vendors with products that are shipping out of our own warehouses. However multivendor x pro is still creating sub orders for these vendors which doesn’t make sense.

      We cannot take the vendors out of the plugin since all the products and shipping classes are all connected to the vendor and it would make things difficult.

      To resolve this we have decided that it would be a good idea to just restrict specific vendor orders from being split into sub orders. Is this possible?

      I wrote this code but its for the wcmp plugin and I am not so familiar with multi vendor x. Maybe you can write something better and more simple?

      function exclude_order_splitting_for_specific_vendors( $order_id ) {
      $order = wc_get_order( $order_id );

      $vendor_id = get_post_meta( $order_id, ‘_wcmp_vendor_id’, true );

      $excluded_vendor_ids = array( 1, 2, 3 );

      if ( in_array( $vendor_id, $excluded_vendor_ids ) ) {
      // If the vendor is excluded, mark the order as non-split
      $order->update_meta_data( ‘_wcmp_non_split_order’, ‘yes’ );
      $order->save();
      }
      }
      add_action( ‘woocommerce_new_order’, ‘exclude_order_splitting_for_specific_vendors’ );

    • #194931

      @Zia Rahim When we have upgraded ourselves from WCMP to MultivendorX we
      Have changed some hooks and filters.
      Now in your code if you replace wcmp with mvx then the code should work perfectly fine.
      Otherwise you can search with the old filter to get the corresponding new filter here :https://github.com/multivendorx/MultiVendorX/tree/main/includes.
      If you need any further assistance please let us know.

    • #196991

      Its been long and we have not heard back from you. Hope you query is resolved now. We are closing this thread as of now. If you need help or face issue in future please open a new thread.

Viewing 2 reply threads

The topic ‘Disable sub orders/split orders for specific vendors’ is closed to new replies.