diff --git a/includes/Abstracts/OrderMigration.php b/includes/Abstracts/OrderMigration.php index 4c27de8..8f26658 100644 --- a/includes/Abstracts/OrderMigration.php +++ b/includes/Abstracts/OrderMigration.php @@ -76,6 +76,15 @@ abstract public function create_sub_order_if_needed( $seller_id, $seller_product */ abstract public function reset_sub_orders_if_needed(); + /** + * Get seller by order/order id + * + * @since DOKAN_MIG_SINCE + * + * @return void + */ + abstract public function get_seller_by_order( $order_id ); + /** * Returns true if the order has sub orders. * @@ -243,7 +252,7 @@ public function sync_dokan_order_table( $dokan_order_data, $sub_order_id, $selle * @return void */ public function process_migration() { - $vendors = dokan_get_sellers_by( $this->order_id ); + $vendors = $this->get_seller_by_order( $this->order_id ); $this->reset_sub_orders_if_needed(); diff --git a/includes/Integrations/Wcfm/OrderMigrator.php b/includes/Integrations/Wcfm/OrderMigrator.php index 02b5b44..538ece9 100644 --- a/includes/Integrations/Wcfm/OrderMigrator.php +++ b/includes/Integrations/Wcfm/OrderMigrator.php @@ -442,7 +442,7 @@ public function split_parent_order_shipping( $applied_shipping_method, $order_id } $applied_shipping_method = reset( $parent_order->get_shipping_methods() ); - $vendors = dokan_get_sellers_by( $parent_order->get_id() ); + $vendors = $this->get_seller_by_order( $parent_order->get_id() ); // Here we are dividing the shipping and shipping-tax amount of parent order into the vendors suborders. $shipping_tax_amount = [ @@ -482,4 +482,15 @@ public function split_parent_order_shipping( $applied_shipping_method, $order_id return $item; } + + /** + * Returns all sellers of an order. + * + * @param int $order_id + * + * @return array + */ + public function get_seller_by_order( $order_id ) { + return dokan_get_sellers_by( $order_id ); + } }