From 6b13db006e6284b54c3656b5e3c6f6bffc0d9aff Mon Sep 17 00:00:00 2001 From: Aunshon Date: Tue, 12 Dec 2023 16:22:33 +0600 Subject: [PATCH] Migrate Wc vendors to dokan (#5) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * m🛠 Update wc-vendors as updated wcfm * ✍️ Fix location array to string * 🔄 Uninstall wc-vendors plugins * 👍 code standard fix * 👌 re-create dokan pages * Update: code refactoring * 🐛 Fix: Resolve bug of ABSPATH * Fix: wcvendors withdraw plugin select switch case * Fix: wcvendors withdraw plugin select switch case * Fix: wcvendors withdraw plugin select switch case * Fix: wcvendors withdraw plugin select switch case * Fix: version * ⚡️Fix: exclude dokan orders, migrate wcfm orders only. * ⚡️Fix: exclude dokan orders, migrate wcfm orders only. * ⚡️Fix: exclude dokan orders, migrate wcfm orders only. * ⚡️Fix: exclude dokan orders, migrate wcfm orders only. * ⚡️Fix: exclude dokan orders, migrate wcfm orders only. * ⚡️Fix: exclude dokan orders, migrate wcfm orders only. * ⚡️HPOS support * ⚡️HPOS support * ⚡️HPOS support * ⚡️HPOS support * ⚡️HPOS support * Fix order count * Remove alert message of migrate to dokan in dokan migration page * Add paged key support in api * Fix phpcs * Add get seller by order abstract method * Update zip maker * add get seller by order support * Set order id --- dokan-migrator.php | 5 +- includes/Abstracts/OrderMigration.php | 10 +- includes/Abstracts/Processor.php | 5 +- includes/Abstracts/VendorMigration.php | 5 +- includes/Abstracts/WithdrawMigration.php | 5 +- includes/Admin/Manager.php | 8 +- includes/Admin/Menu.php | 5 +- includes/Helpers/MigrationHelper.php | 132 ++++++- .../Integrations/WcVendors/OrderMigrator.php | 192 ++++++++++ .../Integrations/WcVendors/VendorMigrator.php | 360 ++++++++++++++++++ .../WcVendors/WithdrawMigrator.php | 186 +++++++++ includes/Integrations/Wcfm/OrderMigrator.php | 59 +-- includes/Integrations/Wcfm/VendorMigrator.php | 5 +- .../Integrations/Wcfm/WithdrawMigrator.php | 5 +- includes/Migrator/Ajax.php | 7 +- includes/Migrator/Assets.php | 5 +- includes/Migrator/Manager.php | 10 +- includes/Processors/Order.php | 35 +- includes/Processors/Vendor.php | 16 +- includes/Processors/Withdraw.php | 33 +- languages/dokan-migrator.pot | 56 ++- 21 files changed, 1019 insertions(+), 125 deletions(-) create mode 100644 includes/Integrations/WcVendors/OrderMigrator.php create mode 100644 includes/Integrations/WcVendors/VendorMigrator.php create mode 100644 includes/Integrations/WcVendors/WithdrawMigrator.php diff --git a/dokan-migrator.php b/dokan-migrator.php index 75ab4ee..dca7139 100644 --- a/dokan-migrator.php +++ b/dokan-migrator.php @@ -38,10 +38,7 @@ * ********************************************************************** */ -// don't call the file directly -if ( ! defined( 'ABSPATH' ) ) { - exit; -} +defined( 'ABSPATH' ) || exit; /** * Dokan_Migrator class diff --git a/includes/Abstracts/OrderMigration.php b/includes/Abstracts/OrderMigration.php index 8f26658..240ae60 100644 --- a/includes/Abstracts/OrderMigration.php +++ b/includes/Abstracts/OrderMigration.php @@ -193,9 +193,9 @@ public function clear_dokan_refund_table( $order_id ) { * @return void */ public function sync_dokan_order_table( $dokan_order_data, $sub_order_id, $seller_id, $order_obj ) { - $order_total = $order_obj->get_total(); - $net_amount = $dokan_order_data['net_sale']; - $created_date = reset( $dokan_order_data['commission_data'] )['created']; + $order_total = $order_obj->get_total(); + $net_amount = $dokan_order_data['net_sale']; + $created_date = ! empty( $dokan_order_data['commission_data'] ) ? reset( $dokan_order_data['commission_data'] )['created'] : dokan_current_datetime()->format( 'Y-m-d H:i:s' ); global $wpdb; @@ -305,6 +305,10 @@ public function process_migration() { * @return void */ public function update_commission_applied_data_in_order( $order, $commission_data ) { + if ( empty( $commission_data['commission_data'] ) ) { + return; + } + $commission = reset( $commission_data['commission_data'] ); foreach ( $order->get_items() as $item_id => $item ) { diff --git a/includes/Abstracts/Processor.php b/includes/Abstracts/Processor.php index 4c2de27..956f1dc 100644 --- a/includes/Abstracts/Processor.php +++ b/includes/Abstracts/Processor.php @@ -2,10 +2,7 @@ namespace WeDevs\DokanMigrator\Abstracts; -// don't call the file directly -if ( ! defined( 'ABSPATH' ) ) { - exit; -} +defined( 'ABSPATH' ) || exit; /** * This class defines the methods for vendor, order and withdraw handler. diff --git a/includes/Abstracts/VendorMigration.php b/includes/Abstracts/VendorMigration.php index 595b45f..eb7469a 100644 --- a/includes/Abstracts/VendorMigration.php +++ b/includes/Abstracts/VendorMigration.php @@ -2,10 +2,7 @@ namespace WeDevs\DokanMigrator\Abstracts; -// don't call the file directly -if ( ! defined( 'ABSPATH' ) ) { - exit; -} +defined( 'ABSPATH' ) || exit; abstract class VendorMigration { diff --git a/includes/Abstracts/WithdrawMigration.php b/includes/Abstracts/WithdrawMigration.php index 3869000..71c5956 100644 --- a/includes/Abstracts/WithdrawMigration.php +++ b/includes/Abstracts/WithdrawMigration.php @@ -2,10 +2,7 @@ namespace WeDevs\DokanMigrator\Abstracts; -// don't call the file directly -if ( ! defined( 'ABSPATH' ) ) { - exit; -} +defined( 'ABSPATH' ) || exit; /** * Withdraw abstract class. diff --git a/includes/Admin/Manager.php b/includes/Admin/Manager.php index 94305a1..8d1d2f1 100644 --- a/includes/Admin/Manager.php +++ b/includes/Admin/Manager.php @@ -4,10 +4,7 @@ use WeDevs\DokanMigrator\Helpers\MigrationHelper; -// don't call the file directly -if ( ! defined( 'ABSPATH' ) ) { - exit; -} +defined( 'ABSPATH' ) || exit; /** * Dokan Migrator Manager Class @@ -68,7 +65,8 @@ public function show_dokan_dashboard_activate_notice() { $data = MigrationHelper::get_last_migrated(); - if ( 'yes' !== $data['migration_success'] ) { + // phpcs:ignore WordPress.Security.NonceVerification.Recommended + if ( 'yes' !== $data['migration_success'] && ( ! isset( $_GET['page'] ) || $_GET['page'] !== 'dokan-migrator' ) ) { require_once DOKAN_MIGRATOR_TEMPLATE_PATH . 'template-alert-migrate-to-dokan.php'; } } diff --git a/includes/Admin/Menu.php b/includes/Admin/Menu.php index 8c29446..0f164dd 100644 --- a/includes/Admin/Menu.php +++ b/includes/Admin/Menu.php @@ -2,10 +2,7 @@ namespace WeDevs\DokanMigrator\Admin; -// don't call the file directly -if ( ! defined( 'ABSPATH' ) ) { - exit; -} +defined( 'ABSPATH' ) || exit; /** * Dokan Migrator Menu Class diff --git a/includes/Helpers/MigrationHelper.php b/includes/Helpers/MigrationHelper.php index d9bc5c4..0172deb 100644 --- a/includes/Helpers/MigrationHelper.php +++ b/includes/Helpers/MigrationHelper.php @@ -2,10 +2,9 @@ namespace WeDevs\DokanMigrator\Helpers; -// don't call the file directly -if ( ! defined( 'ABSPATH' ) ) { - exit; -} +use WC_Order; + +defined( 'ABSPATH' ) || exit; /** * Dokan migrator helper class @@ -45,14 +44,28 @@ public static function get_last_migrated() { public static function active_vendor_dashboard() { $all_plugins_to_deactivate = []; - // Wcfm plugins + // Wcfm plugins. $all_plugins_to_deactivate[] = WP_PLUGIN_DIR . '/wc-frontend-manager/wc_frontend_manager.php'; $all_plugins_to_deactivate[] = WP_PLUGIN_DIR . '/wc-multivendor-marketplace/wc-multivendor-marketplace.php'; $all_plugins_to_deactivate[] = WP_PLUGIN_DIR . '/wc-multivendor-membership/wc-multivendor-membership.php'; + // Wc vendors plugins. + $all_plugins_to_deactivate[] = WP_PLUGIN_DIR . '/wc-vendors-pro-simple-auctions/class-wcv-simple-auctions.php'; + $all_plugins_to_deactivate[] = WP_PLUGIN_DIR . '/wc-vendors-pro/wcvendors-pro.php'; + $all_plugins_to_deactivate[] = WP_PLUGIN_DIR . '/wc-vendors-woocommerce-bookings/wcv-woocommerce-bookings.php'; + $all_plugins_to_deactivate[] = WP_PLUGIN_DIR . '/wc-vendors-woocommerce-subscriptions/wcv-wc-subscriptions.php'; + $all_plugins_to_deactivate[] = WP_PLUGIN_DIR . '/wc-vendors/class-wc-vendors.php'; + $all_plugins_to_deactivate[] = WP_PLUGIN_DIR . '/wc-vendors-membership/wc-vendors-membership.php'; + deactivate_plugins( $all_plugins_to_deactivate ); delete_option( 'dokan_migration_completed' ); + /** + * Deleting this option, because sometimes after migrating to dokan from other marketplace + * dokan dashboard page conflicts with their pages so deleting this option will enable user + * to re-create dokan pages from dokan tools page. + */ + delete_option( 'dokan_pages_created' ); wp_send_json_success( __( 'Dokan vendor dashboard activated.', 'dokan-migrator' ) ); } @@ -95,6 +108,10 @@ public static function get_migration_title( $plugin ) { $title = __( 'Migrate Wcfm To Dokan', 'dokan-migrator' ); break; + case 'wcvendors': + $title = __( 'Migrate Wc Vendors To Dokan.', 'dokan-migrator' ); + break; + default: break; } @@ -118,6 +135,111 @@ public static function get_migratable_plugin() { // WCfM Multivendor Marketplace Check $is_marketplace = ( in_array( 'wc-multivendor-marketplace/wc-multivendor-marketplace.php', $active_plugins, true ) || array_key_exists( 'wc-multivendor-marketplace/wc-multivendor-marketplace.php', $active_plugins ) || class_exists( 'WCFMmp' ) ) ? 'wcfmmarketplace' : false; + // WC Vendors Check + if ( ! $is_marketplace ) { + $is_marketplace = ( in_array( 'wc-vendors/class-wc-vendors.php', $active_plugins, true ) || array_key_exists( 'wc-vendors/class-wc-vendors.php', $active_plugins ) || class_exists( 'WC_Vendors' ) ) ? 'wcvendors' : false; + } + return $is_marketplace; } + + + /** + * Converts the order item meta key according to + * Dokan meta key as those data will be parsed + * while creating sub orders. + * + * @param WC_Order $order + * @param string $map_by + * + * @since DOKAN_MIG_SINCE + * + * @return void + */ + public static function map_shipping_method_item_meta( WC_Order $order, $map_by = 'vendor_id' ) { + if ( ! $order instanceof WC_Order ) { + return; + } + + $shipping_methods = $order->get_shipping_methods(); + if ( empty( $shipping_methods ) ) { + return; + } + + foreach ( $shipping_methods as $method_item_id => $shipping_object ) { + $seller_id = wc_get_order_item_meta( $method_item_id, $map_by, true ); + + if ( ! $seller_id ) { + continue; + } + + wc_update_order_item_meta( + $method_item_id, + 'seller_id', + wc_get_order_item_meta( $method_item_id, $map_by, true ) + ); + } + } + + /** + * Split shipping amount for all vendors if wcfm processing an order as admin shipping. + * + * @since DOKAN_MIG_SINCE + * + * @param WC_Order_Item_Shipping $applied_shipping_method + * @param int $order_id + * @param WC_Order $parent_order + * + * @return WC_Order_Item_Shipping + */ + public static function split_parent_order_shipping( $applied_shipping_method, $order_id, $parent_order ) { + /** + * Not empty means parent order has sub-order and this order is processed as vendor wise shipping in wcfm. + * Or if parent order has no shipping methods the return it. + */ + if ( ! empty( $applied_shipping_method ) || count( $parent_order->get_shipping_methods() ) < 1 ) { + return $applied_shipping_method; + } + + $applied_shipping_method = reset( $parent_order->get_shipping_methods() ); + $vendors = dokan_get_sellers_by( $parent_order->get_id() ); + + // Here we are dividing the shipping and shipping-tax amount of parent order into the vendors suborders. + $shipping_tax_amount = [ + 'total' => [ $applied_shipping_method->get_total_tax() / count( $vendors ) ], + ]; + $shipping_amount = $applied_shipping_method->get_total() / count( $vendors ); + + // Generating the shipping for vendor. + $item = new WC_Order_Item_Shipping(); + $item->set_props( + array( + 'method_title' => $applied_shipping_method->get_name(), + 'method_id' => $applied_shipping_method->get_method_id(), + 'total' => $shipping_amount, + 'taxes' => $shipping_tax_amount, + ) + ); + + $child_order = new WC_order( $order_id ); + $products = $child_order->get_items(); + + // Generating the shipping Item text. + $text = ''; + foreach ( $products as $key => $product ) { + $current_item = $product->get_data(); + $product_text = $current_item['name'] . ' × ' . $current_item['quantity']; + + if ( $key !== array_key_first( $products ) ) { + $text .= ', ' . $product_text; + } + + $text .= $product_text; + } + + // Adding shipping item meta data. + $item->add_meta_data( 'Items', $text ); + + return $item; + } } diff --git a/includes/Integrations/WcVendors/OrderMigrator.php b/includes/Integrations/WcVendors/OrderMigrator.php new file mode 100644 index 0000000..6e5124b --- /dev/null +++ b/includes/Integrations/WcVendors/OrderMigrator.php @@ -0,0 +1,192 @@ +order_id = $order->get_id(); + $this->order = $order; + } + + /** + * Create sub order if needed. + * + * @since DOKAN_MIG_SINCE + * + * @param int $seller_id + * @param array $seller_products + * + * @return \WC_Order + */ + public function create_sub_order_if_needed( $seller_id, $seller_products, $parent_order_id ) { + /** + * Before creating sub order, we need to convert the meta key according to + * Dokan meta key for order items as those data will be parsed while creating + * sub orders. + */ + MigrationHelper::map_shipping_method_item_meta( $this->order ); + dokan()->order->create_sub_order( $this->order, $seller_id, $seller_products ); + + $res = dokan()->order->all( + [ + 'limit' => 1, + 'parent' => $this->order->get_id(), + 'seller_id' => $seller_id, + ] + ); + + /** + * @var $created_suborder WC_Order|\WC_Order_Refund + */ + $created_suborder = reset( $res ); + + return $created_suborder; + } + + /** + * Delete sub orders if needed. + * + * @since DOKAN_MIG_SINCE + * + * @return void + */ + public function reset_sub_orders_if_needed() { + $this->reset_sub_orders(); + } + + /** + * Gets order data from wc-vendors order table for dokan. + * + * @since DOKAN_MIG_SINCE + * + * @param int $parent_order_id + * @param int $seller_id + * + * @return array + */ + public function get_dokan_order_data( $parent_order_id, $seller_id ) { + global $wpdb; + + $orders = $wpdb->get_results( + $wpdb->prepare( + "SELECT * + FROM {$wpdb->prefix}pv_commission commission + WHERE commission.vendor_id = %d + AND commission.order_id = %d", + $seller_id, + $parent_order_id + ) + ); + + $wc_order = wc_get_order( $parent_order_id ); + $net_amount = 0; + $order_total = $wc_order->get_total(); + $commissions = []; + + if ( $wc_order->get_total_refunded() ) { + $order_total = $order_total - $wc_order->get_total_refunded(); + } + + foreach ( $orders as $key => $order ) { + $net_amount += $order->total_due + $order->total_shipping + $order->tax; + + $res_commission = [ + 'type' => 'percent', + 'fixed' => '', + 'percentage' => '', + 'item_id' => '', + 'admin_commission' => 0, + 'product_id' => $order->product_id, + 'created' => $order->time, + ]; + + $unit_commissin_rate_vendor = ( $order->total_due / $wc_order->get_subtotal() ) * 100; + $unit_commissin_rate_admin = 100 - $unit_commissin_rate_vendor; + $new_admin_commissin = ( $wc_order->get_subtotal() * $unit_commissin_rate_admin ) / 100; + + $res_commission['percentage'] = number_format( (float) $unit_commissin_rate_admin, 2, '.', '' ); + $res_commission['admin_commission'] = $new_admin_commissin; + + array_push( $commissions, $res_commission ); + } + + $admin_commission = 0; + + foreach ( $commissions as $com ) { + $admin_commission += $com['admin_commission']; + } + + $dokan_order_data = [ + 'commission_data' => $commissions, + 'order_total' => $order_total, + 'net_sale' => $net_amount, + 'admin_commission_amount' => $admin_commission, + ]; + + return $dokan_order_data; + } + + /** + * Process refund for a child order. + * + * @since DOKAN_MIG_SINCE + * + * @param \Wc_Order $child_order + * @param integer $seller_id + * @param boolean $from_suborder + * + * @return void + */ + public function process_refund( $child_order, $seller_id, $from_suborder = true ) { + global $wpdb; + + $order = wc_get_order( $child_order->get_id() ); + $new_total_amount = $order->get_total() - $order->get_total_refunded(); + + // insert into dokan sync table + $wpdb->update( + $wpdb->prefix . 'dokan_orders', + [ + 'order_total' => $new_total_amount, + ], + [ + 'order_id' => $child_order->get_id(), + ], + [ + '%f', + ] + ); + } + + /** + * Returns all sellers of an order. + * + * @since DOKAN_MIG_SINCE + * + * @param int $order_id + * + * @return array + */ + public function get_seller_by_order( $order_id ) { + return dokan_get_sellers_by( $order_id ); + } +} diff --git a/includes/Integrations/WcVendors/VendorMigrator.php b/includes/Integrations/WcVendors/VendorMigrator.php new file mode 100644 index 0000000..42639eb --- /dev/null +++ b/includes/Integrations/WcVendors/VendorMigrator.php @@ -0,0 +1,360 @@ +vendor = $vendor; + $this->meta_data = get_user_meta( $vendor->ID ); + $this->vendor_id = $vendor->ID; + } + + /** + * Returns store name + * + * @since DOKAN_MIG_SINCE + * + * @return string + */ + public function get_store_name() { + $store_name = $this->get_val( 'pv_shop_name' ); + + if ( empty( $store_name ) ) { + return $this->vendor->display_name; + } + + return ''; + } + + /** + * Returns store description + * + * @since DOKAN_MIG_SINCE + * + * @return string + */ + public function get_store_biography() { + return $this->get_val( 'pv_seller_info' ); + } + + /** + * Returns vendor selling capability. + * + * @since DOKAN_MIG_SINCE + * + * @return string + */ + public function get_enable_selling() { + if ( count( array_intersect( $this->vendor->roles, [ 'vendor', 'pending_vendor' ] ) ) ) { + return 'yes'; + } + + return 'no'; + } + + /** + * Returns geo location address. + * + * @since DOKAN_MIG_SINCE + * + * @return string + */ + public function get_geo_address() { + return $this->get_val( '_wcv_store_address1' ); + } + + /** + * Returns vendor location latitude. + * + * @since DOKAN_MIG_SINCE + * + * @return string + */ + public function get_geo_lat() { + return $this->get_val( 'wcv_address_latitude' ); + } + + /** + * Returns vendor location longitude. + * + * @since DOKAN_MIG_SINCE + * + * @return string + */ + public function get_geo_long() { + return $this->get_val( 'wcv_address_longitude' ); + } + + /** + * Returns vendor social data. + * + * @since DOKAN_MIG_SINCE + * + * @return array + */ + public function get_social( $default ) { + $social = [ + 'fb' => $this->get_val( '_wcv_facebook_url' ), + 'twitter' => $this->get_val( '_wcv_twitter_username' ), + 'pinterest' => $this->get_val( '_wcv_pinterest_url' ), + 'linkedin' => $this->get_val( '_wcv_linkedin_url' ), + 'youtube' => $this->get_val( '_wcv_youtube_url' ), + 'instagram' => $this->get_val( '_wcv_instagram_username' ), + 'flickr' => '', + ]; + return $social; + } + + /** + * Returns vendor payment data. + * + * @since DOKAN_MIG_SINCE + * + * @return array + */ + public function get_payment( $default ) { + return [ + 'paypal' => [ + 'email' => $this->get_val( 'pv_paypal' ), + ], + 'bank' => [ + 'ac_name' => $this->get_val( 'wcv_bank_account_name' ), + 'ac_number' => $this->get_val( 'wcv_bank_account_number' ), + 'bank_name' => $this->get_val( 'wcv_bank_name' ), + 'bank_addr' => '', + 'routing_number' => $this->get_val( 'wcv_bank_routing_number' ), + 'iban' => $this->get_val( 'wcv_bank_iban' ), + 'swift' => $this->get_val( 'wcv_bank_bic_swift' ), + ], + ]; + } + + /** + * Returns vendor phone number. + * + * @since DOKAN_MIG_SINCE + * + * @param string $default + * + * @return string + */ + public function get_phone( $default ) { + return $this->get_val( '_wcv_store_phone' ); + } + + /** + * Returns if show email in store. + * + * @since DOKAN_MIG_SINCE + * + * @param string $default + * + * @return string + */ + public function get_is_show_email( $default ) { + return 'no'; + } + + /** + * Returns vendor's address. + * + * @since DOKAN_MIG_SINCE + * + * @param string $default + * + * @return array + */ + public function get_address( $default ) { + $address = [ + 'street1' => $this->get_val( '_wcv_store_address1' ), + 'street2' => $this->get_val( '_wcv_store_address2' ), + 'city' => $this->get_val( '_wcv_store_city' ), + 'zip' => '', + 'country' => $this->get_val( '_wcv_store_country' ), + 'state' => $this->get_val( '_wcv_store_state' ), + ]; + + return $address; + } + + /** + * Returns vendor location. + * + * @since DOKAN_MIG_SINCE + * + * @param string $default + * + * @return string + */ + public function get_location( $default ) { + return ''; + } + + /** + * Returns store banner id. + * + * @since DOKAN_MIG_SINCE + * + * @param int $default + * + * @return int + */ + public function get_banner( $default ) { + return $this->get_val( '_wcv_store_banner_id' ); + } + + + /** + * Returns vendor icon. + * + * @since DOKAN_MIG_SINCE + * + * @param string $default + * + * @return int + */ + public function get_icon( $default ) { + return $this->get_val( '_wcv_store_icon_id' ); + } + + /** + * Returns vendor gravatar. + * + * @since DOKAN_MIG_SINCE + * + * @param string $default + * + * @return int + */ + public function get_gravatar( $default ) { + return ''; + } + + /** + * Returns if show more p tab. + * + * @since DOKAN_MIG_SINCE + * + * @param mixed $default + * + * @return string + */ + public function get_show_more_ptab( $default ) { + return 'yes'; + } + + /** + * Returns store product per page. + * + * @since DOKAN_MIG_SINCE + * + * @param int $default + * + * @return int + */ + public function get_sore_ppp( $default ) { + return get_option( 'wcvendors_products_per_page', 10 ); + } + + /** + * Returns if terms and condition is enabled for store. + * + * @since DOKAN_MIG_SINCE + * + * @param string $default + * + * @return string + */ + public function get_is_enabled_tnc( $default ) { + return 'off'; + } + + /** + * Returns terms and conditions. + * + * @since DOKAN_MIG_SINCE + * + * @param string $default + * + * @return string + */ + public function get_store_tnc( $default ) { + return wp_strip_all_tags( $this->get_val( 'wcv_policy_terms' ) ); + } + + /** + * Returns min order discount. + * + * @since DOKAN_MIG_SINCE + * + * @param string $default + * + * @return string + */ + public function get_show_min_order_discount( $default ) { + return 'no'; + } + + /** + * Returns store's seo. + * + * @since DOKAN_MIG_SINCE + * + * @param array $default + * + * @return array + */ + public function get_store_seo( $default ) { + $dokan_store_soe = [ + 'dokan-seo-meta-title' => $this->get_val( 'wcv_seo_title' ), + 'dokan-seo-meta-desc' => $this->get_val( 'wcv_seo_meta_description' ), + 'dokan-seo-meta-keywords' => $this->get_val( 'wcv_seo_meta_keywords' ), + 'dokan-seo-og-title' => '', + 'dokan-seo-og-desc' => '', + 'dokan-seo-og-image' => '', + 'dokan-seo-twitter-title' => $this->get_val( 'wcv_seo_twitter_title' ), + 'dokan-seo-twitter-desc' => $this->get_val( 'wcv_seo_twitter_description' ), + 'dokan-seo-twitter-image' => $this->get_val( 'wcv_seo_twitter_image_id' ), + 'dokan-seo-fb-image' => $this->get_val( 'wcv_seo_fb_image_id' ), + 'dokan-seo-fb-image' => $this->get_val( 'wcv_seo_fb_image_id' ), + 'dokan-seo-fb-image' => $this->get_val( 'wcv_seo_fb_image_id' ), + ]; + + return $dokan_store_soe; + } + + /** + * Returns commission for specific vendor. + * + * @since DOKAN_MIG_SINCE + * + * @return void + */ + public function get_commission() { + $dokan_commission = [ + 'dokan_admin_percentage' => '', + 'dokan_admin_percentage_type' => '', + 'dokan_admin_additional_fee' => '', + ]; + + return $dokan_commission; + } +} diff --git a/includes/Integrations/WcVendors/WithdrawMigrator.php b/includes/Integrations/WcVendors/WithdrawMigrator.php new file mode 100644 index 0000000..2cd6fe7 --- /dev/null +++ b/includes/Integrations/WcVendors/WithdrawMigrator.php @@ -0,0 +1,186 @@ +set_withdraw_data( $withdraw ); + } + + /** + * Sets single withdraw item data. + * + * @since DOKAN_MIG_SINCE + */ + public function set_withdraw_data( $withdraw_data ) { + $this->withdraw = $withdraw_data; + $this->withdraw_id = ! empty( $withdraw_data->ID ) ? $withdraw_data->ID : $withdraw_data->id; + + $this->meta_data = $this->get_withdraw_meta_data(); + } + + /** + * Returns vendor id. + * + * @since DOKAN_MIG_SINCE + * + * @return int + */ + public function get_vendor_id() { + return ! empty( $this->withdraw->vendor_id ) ? $this->withdraw->vendor_id : ''; + } + + /** + * Returns withdraw amount. + * + * @since DOKAN_MIG_SINCE + * + * @return int|float + */ + public function get_withdraw_amount() { + return $this->withdraw->total_due + $this->withdraw->total_shipping + $this->withdraw->tax; + } + + /** + * Returns withdraw created date. + * + * @since DOKAN_MIG_SINCE + * + * @return string + */ + public function get_withdraw_created_date() { + return ! empty( $this->withdraw->time ) ? $this->withdraw->time : ''; + } + + /** + * Returns withdraw status. + * + * @since DOKAN_MIG_SINCE + * + * @return string + */ + public function get_withdraw_status() { + return 1; + } + + /** + * Returns withdraw payment method. + * + * @since DOKAN_MIG_SINCE + * + * @return string + */ + public function get_withdraw_payment_method() { + return ''; + } + + /** + * Returns withdraw note + * + * @since DOKAN_MIG_SINCE + * + * @return string + */ + public function get_withdraw_note() { + return 'Made by dokan migrator.'; + } + + /** + * Returns withdraw details. + * + * @since DOKAN_MIG_SINCE + * + * @return string + */ + public function get_withdraw_details() { + $order_ids = ! empty( $this->withdraw->order_ids ) ? $this->withdraw->order_ids : ''; + $commission_ids = ! empty( $this->withdraw->commission_ids ) ? $this->withdraw->commission_ids : ''; + $withdraw_charges = ! empty( $this->withdraw->withdraw_charges ) ? $this->withdraw->withdraw_charges : ''; + $withdraw_mode = ! empty( $this->withdraw->withdraw_mode ) ? $this->withdraw->withdraw_mode : ''; + $is_auto_withdrawal = ! empty( $this->withdraw->is_auto_withdrawal ) ? $this->withdraw->is_auto_withdrawal : ''; + $withdraw_paid_date = ! empty( $this->withdraw->time ) ? $this->withdraw->time : ''; + $vendor_id = ! empty( $this->withdraw->vendor_id ) ? $this->withdraw->vendor_id : ''; + $product_id = ! empty( $this->withdraw->product_id ) ? $this->withdraw->product_id : ''; + $qty = ! empty( $this->withdraw->qty ) ? $this->withdraw->qty : ''; + + $dokan_details = $this->meta_data; + $dokan_details['email'] = get_userdata( $this->get_vendor_id() )->user_email; + $dokan_details['order_ids'] = $order_ids; + $dokan_details['commission_ids'] = $commission_ids; + $dokan_details['withdraw_charges'] = $withdraw_charges; + $dokan_details['withdraw_mode'] = $withdraw_mode; + $dokan_details['is_auto_withdrawal'] = $is_auto_withdrawal; + $dokan_details['withdraw_paid_date'] = $withdraw_paid_date; + $dokan_details['vendor_id'] = $vendor_id; + $dokan_details['product_id'] = $product_id; + $dokan_details['qty'] = $qty; + + return maybe_serialize( $dokan_details ); + } + + /** + * Returns withdraw user ip. + * + * @since DOKAN_MIG_SINCE + * + * @return string + */ + public function get_withdraw_ip() { + return ''; + } + + /** + * Gets the withdraw meta data. + * + * @since DOKAN_MIG_SINCE + * + * @return array + */ + public function get_withdraw_meta_data() { + return []; + } +} diff --git a/includes/Integrations/Wcfm/OrderMigrator.php b/includes/Integrations/Wcfm/OrderMigrator.php index 538ece9..d189234 100644 --- a/includes/Integrations/Wcfm/OrderMigrator.php +++ b/includes/Integrations/Wcfm/OrderMigrator.php @@ -11,18 +11,19 @@ use WC_Order_Item_Shipping; use WeDevs\DokanMigrator\Abstracts\OrderMigration; use Automattic\WooCommerce\Utilities\NumberUtil; +use WeDevs\DokanMigrator\Helpers\MigrationHelper; /** * Order migration class. * - * @since 1.0.0 + * @since DOKAN_MIG_SINCE */ class OrderMigrator extends OrderMigration { /** * Class constructor. * - * @since DOKAN_PRO_SINCE + * @since DOKAN_MIG_SINCE * * @param \WC_Order $order */ @@ -36,7 +37,7 @@ public function __construct( \WC_Order $order ) { /** * Create sub order if needed * - * @since 1.0.0 + * @since DOKAN_MIG_SINCE * * @param int $seller_id * @param array $seller_products @@ -49,7 +50,7 @@ public function create_sub_order_if_needed( $seller_id, $seller_products, $paren * Dokan meta key for order items as those data will be parsed while creating * sub orders. */ - $this->map_shipping_method_item_meta(); + MigrationHelper::map_shipping_method_item_meta( $this->order ); dokan()->order->create_sub_order( $this->order, $seller_id, $seller_products ); $res = dokan()->order->all( @@ -68,44 +69,10 @@ public function create_sub_order_if_needed( $seller_id, $seller_products, $paren return $created_suborder; } - /** - * Converts the order item meta key according to - * Dokan meta key as those data will be parsed - * while creating sub orders. - * - * @since 1.0.0 - * - * @return void - */ - public function map_shipping_method_item_meta() { - if ( ! $this->order instanceof WC_Order ) { - return; - } - - $shipping_methods = $this->order->get_shipping_methods(); - if ( empty( $shipping_methods ) ) { - return; - } - - foreach ( $shipping_methods as $method_item_id => $shipping_object ) { - $seller_id = wc_get_order_item_meta( $method_item_id, 'vendor_id', true ); - - if ( ! $seller_id ) { - continue; - } - - wc_update_order_item_meta( - $method_item_id, - 'seller_id', - wc_get_order_item_meta( $method_item_id, 'vendor_id', true ) - ); - } - } - /** * Delete sub orders of needed. * - * @since 1.0.0 + * @since DOKAN_MIG_SINCE * * @return void */ @@ -116,7 +83,7 @@ public function reset_sub_orders_if_needed() { /** * Gets order data from wcfm order table for dokan. * - * @since 1.0.0 + * @since DOKAN_MIG_SINCE * * @param int $parent_order_id * @param int $seller_id @@ -179,7 +146,7 @@ public function get_dokan_order_data( $parent_order_id, $seller_id ) { /** * Process refund for a child order. * - * @since 1.0.0 + * @since DOKAN_MIG_SINCE * * @param WC_Order $child_order * @param integer $seller_id @@ -336,7 +303,7 @@ public function process_refund( $child_order, $seller_id, $from_suborder = true /** * Rename vendor shipping for an order * - * @since 1.0.0 + * @since DOKAN_MIG_SINCE * * @param object $order * @@ -377,7 +344,7 @@ public function get_order_vendor_shipping() { /** * Retrieves WCFM refund requests. * - * @since 1.0.0 + * @since DOKAN_MIG_SINCE * * @param int $vendor_id * @param int $order_id @@ -400,7 +367,7 @@ public function get_refund_requests( $vendor_id, $order_id ) { /** * Retrieves WCFM refund meta data for a specific meta key. * - * @since 1.0.0 + * @since DOKAN_MIG_SINCE * * @param integer $refund_id * @param sting $meta_key @@ -424,7 +391,7 @@ public function get_refund_meta( $refund_id, $meta_key ) { /** * Split shipping amount for all vendors if wcfm processing an order as admin shipping. * - * @since 1.0.0 + * @since DOKAN_MIG_SINCE * * @param WC_Order_Item_Shipping $applied_shipping_method * @param int $order_id @@ -486,6 +453,8 @@ public function split_parent_order_shipping( $applied_shipping_method, $order_id /** * Returns all sellers of an order. * + * @since DOKAN_MIG_SINCE + * * @param int $order_id * * @return array diff --git a/includes/Integrations/Wcfm/VendorMigrator.php b/includes/Integrations/Wcfm/VendorMigrator.php index efcffdc..315805e 100644 --- a/includes/Integrations/Wcfm/VendorMigrator.php +++ b/includes/Integrations/Wcfm/VendorMigrator.php @@ -2,10 +2,7 @@ namespace WeDevs\DokanMigrator\Integrations\Wcfm; -// don't call the file directly -if ( ! defined( 'ABSPATH' ) ) { - exit; -} +defined( 'ABSPATH' ) || exit; use WeDevs\DokanMigrator\Abstracts\VendorMigration; diff --git a/includes/Integrations/Wcfm/WithdrawMigrator.php b/includes/Integrations/Wcfm/WithdrawMigrator.php index 4ad915b..c784657 100644 --- a/includes/Integrations/Wcfm/WithdrawMigrator.php +++ b/includes/Integrations/Wcfm/WithdrawMigrator.php @@ -2,10 +2,7 @@ namespace WeDevs\DokanMigrator\Integrations\Wcfm; -// don't call the file directly -if ( ! defined( 'ABSPATH' ) ) { - exit; -} +defined( 'ABSPATH' ) || exit; use WeDevs\DokanMigrator\Abstracts\WithdrawMigration; diff --git a/includes/Migrator/Ajax.php b/includes/Migrator/Ajax.php index 386f09e..f995064 100644 --- a/includes/Migrator/Ajax.php +++ b/includes/Migrator/Ajax.php @@ -2,10 +2,7 @@ namespace WeDevs\DokanMigrator\Migrator; -// don't call the file directly -if ( ! defined( 'ABSPATH' ) ) { - exit; -} +defined( 'ABSPATH' ) || exit; use Exception; use WeDevs\DokanMigrator\Helpers\MigrationHelper; @@ -49,7 +46,7 @@ public function count() { $this->verify_nonce(); $import = ! empty( $_POST['import'] ) ? sanitize_text_field( wp_unslash( $_POST['import'] ) ) : 'vendor'; // phpcs:ignore WordPress.Security.NonceVerification - $migratable = ! empty( $_POST['migratable'] ) ? boolval( wp_unslash( $_POST['migratable'] ) ) : false; // phpcs:ignore WordPress.Security.NonceVerification + $migratable = ! empty( $_POST['migratable'] ) ? sanitize_text_field( wp_unslash( $_POST['migratable'] ) ) : false; // phpcs:ignore WordPress.Security.NonceVerification try { $data = dokan_migrator()->migrator->get_total( $import, $migratable ); diff --git a/includes/Migrator/Assets.php b/includes/Migrator/Assets.php index 048f576..4f9c4b7 100644 --- a/includes/Migrator/Assets.php +++ b/includes/Migrator/Assets.php @@ -2,10 +2,7 @@ namespace WeDevs\DokanMigrator\Migrator; -// don't call the file directly -if ( ! defined( 'ABSPATH' ) ) { - exit; -} +defined( 'ABSPATH' ) || exit; /** * Assets class for dokan migrator. diff --git a/includes/Migrator/Manager.php b/includes/Migrator/Manager.php index fdddb8b..92413ef 100644 --- a/includes/Migrator/Manager.php +++ b/includes/Migrator/Manager.php @@ -2,14 +2,14 @@ namespace WeDevs\DokanMigrator\Migrator; -// don't call the file directly -if ( ! defined( 'ABSPATH' ) ) { - exit; -} +defined( 'ABSPATH' ) || exit; use WeDevs\DokanMigrator\Integrations\Wcfm\OrderMigrator as WcfmOrderMigrator; use WeDevs\DokanMigrator\Integrations\Wcfm\VendorMigrator as WcfmVendorMigrator; use WeDevs\DokanMigrator\Integrations\Wcfm\WithdrawMigrator as WcfmWithdrawMigrator; +use WeDevs\DokanMigrator\Integrations\WcVendors\OrderMigrator as WcVendorsOrderMigrator; +use WeDevs\DokanMigrator\Integrations\WcVendors\VendorMigrator as WcVendorsVendorMigrator; +use WeDevs\DokanMigrator\Integrations\WcVendors\WithdrawMigrator as WcVendorsWithdrawMigrator; use WeDevs\DokanMigrator\Migrator\Ajax; use WeDevs\DokanMigrator\Migrator\Assets; @@ -191,7 +191,7 @@ public function migrate( $import_type, $plugin, $data ) { foreach ( $data_to_migrate as $value ) { /** - * @var $migrator WcfmOrderMigrator|WcfmVendorMigrator|WcfmWithdrawMigrator + * @var $migrator WcfmOrderMigrator|WcfmVendorMigrator|WcfmWithdrawMigrator|WcVendorsVendorMigrator|WcVendorsOrderMigrator|WcVendorsWithdrawMigrator */ $migrator = call_user_func( [ $processor, 'get_migration_class' ], $plugin, $value ); $migrator->process_migration(); diff --git a/includes/Processors/Order.php b/includes/Processors/Order.php index 91a3aaf..c3b7518 100644 --- a/includes/Processors/Order.php +++ b/includes/Processors/Order.php @@ -2,13 +2,11 @@ namespace WeDevs\DokanMigrator\Processors; -// don't call the file directly -if ( ! defined( 'ABSPATH' ) ) { - exit; -} +defined( 'ABSPATH' ) || exit; use WeDevs\DokanMigrator\Abstracts\Processor; use WeDevs\DokanMigrator\Integrations\Wcfm\OrderMigrator as WcfmOrderMigrator; +use WeDevs\DokanMigrator\Integrations\WcVendors\OrderMigrator as WcVendorsOrderMigrator; /** * Vendor migration handler class. @@ -30,13 +28,22 @@ public static function get_total( $plugin ) { global $wpdb; switch ( $plugin ) { - case 'wcfmmarketplace': + case 'wcfmmarketplace': $total = (int) $wpdb->get_var( "SELECT COUNT( DISTINCT order_id ) FROM {$wpdb->prefix}wcfm_marketplace_orders" ); break; - default: + case 'wcvendors': + $total = (int) dokan()->order->all( + [ + 'return' => 'count', + 'parent' => 0, + ] + ); + break; + + default: $total = 0; - } + } return $total; } @@ -53,6 +60,13 @@ public static function get_total( $plugin ) { public static function get_items( $plugin, $number, $offset, $paged ) { global $wpdb; + $args = array( + 'order' => 'ASC', + 'paged' => $paged, + 'limit' => $number, + 'parent' => 0, + ); + switch ( $plugin ) { case 'wcfmmarketplace': $orders = []; @@ -73,6 +87,10 @@ function ( $item ) { } break; + case 'wcvendors': + $orders = dokan()->order->all( $args ); + break; + default: $orders = []; } @@ -99,6 +117,9 @@ public static function get_migration_class( $plugin, $payload ) { switch ( $plugin ) { case 'wcfmmarketplace': return new WcfmOrderMigrator( $payload ); + + case 'wcvendors': + return new WcVendorsOrderMigrator( $payload ); } throw new \Exception( __( 'Migrator class not found', 'dokan-migrator' ) ); diff --git a/includes/Processors/Vendor.php b/includes/Processors/Vendor.php index 1161d28..1d1d037 100644 --- a/includes/Processors/Vendor.php +++ b/includes/Processors/Vendor.php @@ -2,14 +2,12 @@ namespace WeDevs\DokanMigrator\Processors; -// don't call the file directly -if ( ! defined( 'ABSPATH' ) ) { - exit; -} +defined( 'ABSPATH' ) || exit; use \WP_User_Query; use WeDevs\DokanMigrator\Abstracts\Processor; use WeDevs\DokanMigrator\Integrations\Wcfm\VendorMigrator as WcfmVendorMigrator; +use WeDevs\DokanMigrator\Integrations\WcVendors\VendorMigrator as WcVendorsVendorMigrator; /** * Vendor migration handler class. @@ -32,6 +30,9 @@ public static function get_total( $plugin ) { case 'wcfmmarketplace': return count( get_users( array( 'role' => 'wcfm_vendor' ) ) ); + case 'wcvendors': + return count( get_users( array( 'role__in' => [ 'vendor', 'pending_vendor' ] ) ) ); + default: return 0; } @@ -57,6 +58,10 @@ public static function get_items( $plugin, $number, $offset, $paged ) { $args['role'] = 'wcfm_vendor'; break; + case 'wcvendors': + $args['role__in'] = [ 'vendor', 'pending_vendor' ]; + break; + default: self::throw_error(); } @@ -86,6 +91,9 @@ public static function get_migration_class( $plugin, $payload ) { switch ( $plugin ) { case 'wcfmmarketplace': return new WcfmVendorMigrator( $payload ); + + case 'wcvendors': + return new WcVendorsVendorMigrator( $payload ); } throw new \Exception( __( 'Migrator class not found', 'dokan-migrator' ) ); diff --git a/includes/Processors/Withdraw.php b/includes/Processors/Withdraw.php index 2530da6..4d3439b 100644 --- a/includes/Processors/Withdraw.php +++ b/includes/Processors/Withdraw.php @@ -2,13 +2,11 @@ namespace WeDevs\DokanMigrator\Processors; -// don't call the file directly -if ( ! defined( 'ABSPATH' ) ) { - exit; -} +defined( 'ABSPATH' ) || exit; use WeDevs\DokanMigrator\Abstracts\Processor; use WeDevs\DokanMigrator\Integrations\Wcfm\WithdrawMigrator as WcfmWithdrawMigrator; +use WeDevs\DokanMigrator\Integrations\WcVendors\WithdrawMigrator as WcVendorsWithdrawMigrator; /** * Withdraw migration handler class. @@ -33,6 +31,9 @@ public static function get_total( $plugin ) { case 'wcfmmarketplace': return (int) $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->prefix}wcfm_marketplace_withdraw_request WHERE withdraw_status!='requested'" ); + case 'wcvendors': + return (int) $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->prefix}pv_commission WHERE status='paid'" ); + default: return 0; } @@ -68,6 +69,27 @@ public static function get_items( $plugin, $number, $offset, $paged ) { $offset ) ); + break; + // Items for wcfm. + + case 'wcvendors': + $withdraws = $wpdb->get_results( + $wpdb->prepare( + "SELECT * + FROM {$wpdb->prefix}pv_commission + WHERE status='paid' + ORDER BY id + LIMIT %d + OFFSET %d", + $number, + $offset + ) + ); + break; + // Items for wc-vendors. + + default: + $withdraws = []; } if ( empty( $withdraws ) ) { @@ -92,6 +114,9 @@ public static function get_migration_class( $plugin, $payload ) { switch ( $plugin ) { case 'wcfmmarketplace': return new WcfmWithdrawMigrator( $payload ); + + case 'wcvendors': + return new WcVendorsWithdrawMigrator( $payload ); } throw new \Exception( __( 'Migrator class not found', 'dokan-migrator' ) ); diff --git a/languages/dokan-migrator.pot b/languages/dokan-migrator.pot index cbffa57..57792ad 100644 --- a/languages/dokan-migrator.pot +++ b/languages/dokan-migrator.pot @@ -8,12 +8,14 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2022-10-18T06:15:22+00:00\n" +"POT-Creation-Date: 2022-11-10T11:42:50+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.6.0\n" "X-Domain: dokan-migrator\n" #. Plugin Name of the plugin +#: build/dokan-migrator/includes/Admin/Menu.php:36 +#: build/dokan-migrator/includes/Admin/Menu.php:37 #: includes/Admin/Menu.php:36 #: includes/Admin/Menu.php:37 msgid "Dokan Migrator" @@ -35,115 +37,149 @@ msgstr "" msgid "https://WeDevs.com/" msgstr "" -#: includes/Helpers/MigrationHelper.php:57 +#: build/dokan-migrator/includes/Helpers/MigrationHelper.php:59 +#: includes/Helpers/MigrationHelper.php:59 msgid "Dokan vendor dashboard activated." msgstr "" -#: includes/Helpers/MigrationHelper.php:91 +#: build/dokan-migrator/includes/Helpers/MigrationHelper.php:93 +#: includes/Helpers/MigrationHelper.php:93 msgid "Migrate to dokan" msgstr "" -#: includes/Helpers/MigrationHelper.php:95 +#: build/dokan-migrator/includes/Helpers/MigrationHelper.php:97 +#: includes/Helpers/MigrationHelper.php:97 msgid "Migrate Wcfm To Dokan" msgstr "" +#: build/dokan-migrator/includes/Helpers/MigrationHelper.php:101 +#: includes/Helpers/MigrationHelper.php:101 +msgid "Migrate Wc Vendors To Dokan." +msgstr "" + +#: build/dokan-migrator/includes/Migrator/Ajax.php:59 #: includes/Migrator/Ajax.php:59 msgid "Item count successfull." msgstr "" +#: build/dokan-migrator/includes/Migrator/Ajax.php:93 #: includes/Migrator/Ajax.php:93 msgid "Import successfull." msgstr "" +#: build/dokan-migrator/includes/Migrator/Ajax.php:117 #: includes/Migrator/Ajax.php:117 msgid "Nonce verification failed!" msgstr "" +#: build/dokan-migrator/includes/Migrator/Manager.php:215 #: includes/Migrator/Manager.php:215 msgid "Invalid import type" msgstr "" -#: includes/Processors/Order.php:79 -#: includes/Processors/Vendor.php:91 -#: includes/Processors/Withdraw.php:96 +#: build/dokan-migrator/includes/Processors/Order.php:83 +#: build/dokan-migrator/includes/Processors/Vendor.php:103 +#: build/dokan-migrator/includes/Processors/Withdraw.php:119 +#: includes/Processors/Order.php:83 +#: includes/Processors/Vendor.php:103 +#: includes/Processors/Withdraw.php:119 msgid "Migrator class not found" msgstr "" -#: includes/Processors/Order.php:94 +#: build/dokan-migrator/includes/Processors/Order.php:98 +#: includes/Processors/Order.php:98 msgid "No orders found to migrate to dokan." msgstr "" -#: includes/Processors/Vendor.php:104 +#: build/dokan-migrator/includes/Processors/Vendor.php:116 +#: includes/Processors/Vendor.php:116 msgid "No vendors found to migrate to dokan." msgstr "" -#: includes/Processors/Withdraw.php:124 +#: build/dokan-migrator/includes/Processors/Withdraw.php:147 +#: includes/Processors/Withdraw.php:147 msgid "No withdraws found to migrate to dokan." msgstr "" +#: build/dokan-migrator/templates/app.php:2 #: templates/app.php:2 msgid "Loading.." msgstr "" +#: build/dokan-migrator/templates/template-active-vendor-dashboard.php:17 #: templates/template-active-vendor-dashboard.php:17 msgid "Activate dokan vendor dashboard." msgstr "" #. translators: 1$s: opening anchor tag, 2$s: closing anchor tag +#: build/dokan-migrator/templates/template-active-vendor-dashboard.php:21 #: templates/template-active-vendor-dashboard.php:21 msgid "%1$sActive now%2$s" msgstr "" #. translators: 1$s: the plugin to migrate to dokan +#: build/dokan-migrator/templates/template-alert-migrate-to-dokan.php:21 #: templates/template-alert-migrate-to-dokan.php:21 msgid "Do You Want To %1$s ?" msgstr "" #. translators: 1$s: opening anchor tag, 2$s: closing anchor tag +#: build/dokan-migrator/templates/template-alert-migrate-to-dokan.php:27 #: templates/template-alert-migrate-to-dokan.php:27 msgid "Click %1$1sHere%2$2s to move to the migration process." msgstr "" #: assets/dist/index.js:1 +#: build/dokan-migrator/assets/dist/index.js:1 msgid "Loading..." msgstr "" #: assets/dist/index.js:1 +#: build/dokan-migrator/assets/dist/index.js:1 msgid "Congratulations." msgstr "" #: assets/dist/index.js:1 +#: build/dokan-migrator/assets/dist/index.js:1 msgid "You have successful migrated to Dokan. Enjoy 🎉" msgstr "" #: assets/dist/index.js:1 +#: build/dokan-migrator/assets/dist/index.js:1 msgid "You have successfully migrated to dokan." msgstr "" #: assets/dist/index.js:1 +#: build/dokan-migrator/assets/dist/index.js:1 msgid "Vendor" msgstr "" #: assets/dist/index.js:1 +#: build/dokan-migrator/assets/dist/index.js:1 msgid "Order" msgstr "" #: assets/dist/index.js:1 +#: build/dokan-migrator/assets/dist/index.js:1 msgid "Withdraw" msgstr "" #: assets/dist/index.js:1 +#: build/dokan-migrator/assets/dist/index.js:1 msgid "Active dokan vendor dashboard." msgstr "" #: assets/dist/index.js:1 +#: build/dokan-migrator/assets/dist/index.js:1 msgid "Active" msgstr "" #: assets/dist/index.js:1 +#: build/dokan-migrator/assets/dist/index.js:1 msgid "Start migration" msgstr "" #: assets/dist/index.js:1 +#: build/dokan-migrator/assets/dist/index.js:1 msgid "No plugin found to migrate to dokan" msgstr ""