diff --git a/includes/Assets.php b/includes/Assets.php
index 596f0a429a..2279fd01ca 100644
--- a/includes/Assets.php
+++ b/includes/Assets.php
@@ -35,6 +35,7 @@ public function __construct() {
*/
public function load_dokan_admin_notices_scripts() {
wp_enqueue_script( 'dokan-promo-notice-js' );
+ wp_enqueue_script( 'dokan-admin-notice-js' );
$vue_localize_script = apply_filters(
'dokan_promo_notice_localize_script', [
'ajaxurl' => admin_url( 'admin-ajax.php' ),
@@ -59,7 +60,8 @@ public function enqueue_admin_scripts( $hook ) {
// load vue app inside the parent menu only
if ( 'toplevel_page_dokan' === $hook ) {
- $localize_script = $this->get_admin_localized_scripts();
+ $localize_script = $this->get_admin_localized_scripts();
+ $vue_admin_localize_script = $this->get_vue_admin_localized_scripts();
// Load common styles and scripts
wp_enqueue_script( 'dokan-tinymce' );
@@ -89,6 +91,7 @@ public function enqueue_admin_scripts( $hook ) {
// fire the admin app
wp_enqueue_script( 'dokan-vue-admin' );
+ wp_localize_script( 'dokan-vue-vendor', 'dokanAdmin', $vue_admin_localize_script );
if ( version_compare( $wp_version, '5.3', '<' ) ) {
wp_enqueue_style( 'dokan-wp-version-before-5-3' );
@@ -211,6 +214,11 @@ public function get_vue_admin_routes() {
'name' => 'Vendors',
'component' => 'Vendors',
],
+ [
+ 'path' => '/vendors/:id',
+ 'name' => 'VendorSingle',
+ 'component' => 'VendorSingle',
+ ],
[
'path' => '/dummy-data',
'name' => 'DummyData',
@@ -528,6 +536,11 @@ public function get_scripts() {
'deps' => [ 'jquery', 'dokan-vue-vendor' ],
'version' => filemtime( $asset_path . 'js/dokan-promo-notice.js' ),
],
+ 'dokan-admin-notice-js' => [
+ 'src' => $asset_url . '/js/dokan-admin-notice.js',
+ 'deps' => [ 'jquery', 'dokan-vue-vendor' ],
+ 'version' => filemtime( $asset_path . 'js/dokan-admin-notice.js' ),
+ ],
'dokan-reverse-withdrawal' => [
'src' => $asset_url . '/js/reverse-withdrawal.js',
'deps' => [ 'jquery', 'dokan-util-helper', 'dokan-vue-vendor', 'dokan-date-range-picker' ],
@@ -580,6 +593,9 @@ public function enqueue_front_scripts() {
}
}
+ $vendor = dokan()->vendor->get( dokan_get_current_user_id() );
+ $commision_settings = $vendor->get_commission_settings();
+
$default_script = [
'ajaxurl' => admin_url( 'admin-ajax.php' ),
'nonce' => wp_create_nonce( 'dokan_reviews' ),
@@ -590,8 +606,8 @@ public function enqueue_front_scripts() {
],
'delete_confirm' => __( 'Are you sure?', 'dokan-lite' ),
'wrong_message' => __( 'Something went wrong. Please try again.', 'dokan-lite' ),
- 'vendor_percentage' => dokan_get_seller_percentage( dokan_get_current_user_id() ),
- 'commission_type' => dokan_get_commission_type( dokan_get_current_user_id() ),
+ 'vendor_percentage' => $commision_settings->get_percentage(),
+ 'commission_type' => $commision_settings->get_type(),
'rounding_precision' => wc_get_rounding_precision(),
'mon_decimal_point' => wc_get_price_decimal_separator(),
'currency_format_num_decimals' => wc_get_price_decimals(),
@@ -1203,4 +1219,19 @@ public function get_admin_localized_scripts() {
]
);
}
+
+ /**
+ * Admin vue localized scripts
+ *
+ * @since 3.14.0
+ *
+ * @return array
+ */
+ private function get_vue_admin_localized_scripts() {
+ return apply_filters(
+ 'dokan_vue_admin_localize_script', [
+ 'commission_types' => dokan_commission_types(),
+ ]
+ );
+ }
}
diff --git a/includes/Commission.php b/includes/Commission.php
index f0040530b4..9490e787f5 100644
--- a/includes/Commission.php
+++ b/includes/Commission.php
@@ -4,9 +4,15 @@
use WC_Order;
use WC_Product;
+use WeDevs\Dokan\Commission\Calculator;
+use WeDevs\Dokan\Commission\Settings\DefaultSetting;
+use WeDevs\Dokan\Commission\Strategies\DefaultStrategy;
+use WeDevs\Dokan\Commission\Strategies\GlobalStrategy;
+use WeDevs\Dokan\Commission\Strategies\OrderItem;
+use WeDevs\Dokan\Commission\Strategies\Product;
+use WeDevs\Dokan\Commission\Strategies\Vendor;
use WeDevs\Dokan\ProductCategory\Helper;
use WP_Error;
-use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway;
/**
* Dokan Commission Class
@@ -42,23 +48,11 @@ class Commission {
*/
public $quantity = 0;
- /**
- * Class constructor
- *
- * @since 2.9.21
- *
- * @return void
- */
- public function __construct() {
- add_filter( 'woocommerce_order_item_get_formatted_meta_data', [ $this, 'hide_extra_data' ] );
- add_action( 'woocommerce_order_status_changed', [ $this, 'calculate_gateway_fee' ], 100 );
- add_action( 'woocommerce_thankyou_ppec_paypal', [ $this, 'calculate_gateway_fee' ] );
- add_action( 'woocommerce_paypal_payments_order_captured', [ $this, 'calculate_gateway_fee' ], 99 );
- }
-
/**
* Calculate gateway fee
*
+ * @deprecated 3.14.0 Use dokan()->fees->calculate_gateway_fee insted.
+ *
* @since 2.9.21
*
* @param int $order_id
@@ -66,89 +60,15 @@ public function __construct() {
* @return void
*/
public function calculate_gateway_fee( $order_id ) {
- global $wpdb;
- $order = wc_get_order( $order_id );
- $processing_fee = $this->get_processing_fee( $order );
-
- if ( ! $processing_fee ) {
- return;
- }
-
- foreach ( $this->get_all_order_to_be_processed( $order ) as $tmp_order ) {
- $gateway_fee_added = $tmp_order->get_meta( 'dokan_gateway_fee' );
- $vendor_earning = $this->get_earning_from_order_table( $tmp_order->get_id() );
-
- if ( is_null( $vendor_earning ) || $gateway_fee_added ) {
- continue;
- }
-
- $gateway_fee = wc_format_decimal( ( $processing_fee / $order->get_total() ) * $tmp_order->get_total() );
-
- // Ensure sub-orders also get the correct payment gateway fee (if any)
- $gateway_fee = apply_filters( 'dokan_get_processing_gateway_fee', $gateway_fee, $tmp_order, $order );
- $net_amount = $vendor_earning - $gateway_fee;
- $net_amount = apply_filters( 'dokan_orders_vendor_net_amount', $net_amount, $vendor_earning, $gateway_fee, $tmp_order, $order );
-
- $wpdb->update(
- $wpdb->dokan_orders,
- [ 'net_amount' => (float) $net_amount ],
- [ 'order_id' => $tmp_order->get_id() ],
- [ '%f' ],
- [ '%d' ]
- );
-
- $wpdb->update(
- $wpdb->dokan_vendor_balance,
- [ 'debit' => (float) $net_amount ],
- [
- 'trn_id' => $tmp_order->get_id(),
- 'trn_type' => 'dokan_orders',
- ],
- [ '%f' ],
- [ '%d', '%s' ]
- );
-
- $tmp_order->update_meta_data( 'dokan_gateway_fee', $gateway_fee );
- $tmp_order->save();
-
- if ( apply_filters( 'dokan_commission_log_gateway_fee_to_order_note', true, $tmp_order ) ) {
- // translators: %s: Geteway fee
- $tmp_order->add_order_note( sprintf( __( 'Payment gateway processing fee %s', 'dokan-lite' ), wc_format_decimal( $gateway_fee, 2 ) ) );
- }
- //remove cache for seller earning
- $cache_key = "get_earning_from_order_table_{$tmp_order->get_id()}_seller";
- Cache::delete( $cache_key );
-
- // remove cache for seller earning
- $cache_key = "get_earning_from_order_table_{$tmp_order->get_id()}_admin";
- Cache::delete( $cache_key );
- }
- }
-
- /**
- * Hide extra meta data
- *
- * @since 2.9.21
- *
- * @param array
- *
- * @return array
- */
- public function hide_extra_data( $formatted_meta ) {
- $meta_to_hide = [ '_dokan_commission_rate', '_dokan_commission_type', '_dokan_additional_fee' ];
-
- foreach ( $formatted_meta as $key => $meta ) {
- if ( in_array( $meta->key, $meta_to_hide, true ) ) {
- unset( $formatted_meta[ $key ] );
- }
- }
-
- return $formatted_meta;
+ _deprecated_function( __METHOD__, '3.14.0', 'dokan()->fees->calculate_gateway_fee()' );
+ dokan()->fees->calculate_gateway_fee( $order_id );
}
/**
* Set order id
*
+ * @deprecated 3.14.0
+ *
* @since 2.9.21
*
* @param int $id
@@ -156,12 +76,15 @@ public function hide_extra_data( $formatted_meta ) {
* @return void
*/
public function set_order_id( $id ) {
+ _deprecated_function( __METHOD__, '3.14.0' );
$this->order_id = $id;
}
/**
* Set order line item id
*
+ * @deprecated 3.14.0
+ *
* @since 3.8.0
*
* @param int $item_id
@@ -169,34 +92,43 @@ public function set_order_id( $id ) {
* @return void
*/
public function set_order_item_id( $item_id ) {
+ _deprecated_function( __METHOD__, '3.14.0' );
$this->order_item_id = absint( $item_id );
}
/**
* Get order id
*
+ * @deprecated 3.14.0
+ *
* @since 2.9.21
*
* @return int
*/
public function get_order_id() {
+ _deprecated_function( __METHOD__, '3.14.0' );
return $this->order_id;
}
/**
* Get order line item id
*
+ * @deprecated 3.14.0
+ *
* @since 3.8.0
*
* @return int
*/
public function get_order_item_id() {
+ _deprecated_function( __METHOD__, '3.14.0' );
return $this->order_item_id;
}
/**
* Set order quantity
*
+ * @deprecated 3.14.0
+ *
* @since 2.9.21
*
* @param int $number
@@ -204,17 +136,21 @@ public function get_order_item_id() {
* @return void
*/
public function set_order_qunatity( $number ) {
+ _deprecated_function( __METHOD__, '3.14.0' );
$this->quantity = $number;
}
/**
* Get order quantity
*
+ * @deprecated 3.14.0
+ *
* @since 2.9.21
*
* @return int
*/
public function get_order_qunatity() {
+ _deprecated_function( __METHOD__, '3.14.0' );
return $this->quantity;
}
@@ -242,10 +178,17 @@ public function get_earning_by_product( $product, $context = 'seller', $price =
$vendor_id = (int) dokan_get_vendor_by_product( $product, true );
$product_id = $product->get_id();
- $earning = $this->calculate_commission( $product_id, $product_price, $vendor_id );
- $earning = 'admin' === $context ? $product_price - $earning : $earning;
+ $commission = $this->get_commission(
+ [
+ 'product_id' => $product_id,
+ 'total_amount' => $product_price,
+ 'total_quantity' => 1,
+ 'vendor_id' => $vendor_id,
+ ]
+ );
- return apply_filters( 'dokan_get_earning_by_product', $earning, $product, $context );
+ $commission_or_earning = 'admin' === $context ? $commission->get_admin_commission() : $commission->get_vendor_earning();
+ return apply_filters( 'dokan_get_earning_by_product', $commission_or_earning, $product, $context );
}
/**
@@ -255,7 +198,7 @@ public function get_earning_by_product( $product, $context = 'seller', $price =
* @since 3.7.19 Shipping tax recipient support added.
*
* @param int|WC_Order $order Order.
- * @param string $context
+ * @param string $context Accepted values are `admin`, `seller`
*
* @return float|void|WP_Error|null on failure
*/
@@ -282,197 +225,55 @@ public function get_earning_by_order( $order, $context = 'seller' ) {
return apply_filters( 'dokan_order_admin_commission', $saved_fee, $order );
}
- // Set user passed `order_id`
- $this->set_order_id( $order->get_id() );
-
// get earning from order table
- $earning = $this->get_earning_from_order_table( $order->get_id(), $context );
- if ( ! is_null( $earning ) ) {
- return $earning;
+ $earning_or_commission = $this->get_earning_from_order_table( $order->get_id(), $context );
+ if ( ! is_null( $earning_or_commission ) ) {
+ return $earning_or_commission;
}
- $earning = 0;
+ $earning_or_commission = 0;
$vendor_id = (int) $order->get_meta( '_dokan_vendor_id' );
foreach ( $order->get_items() as $item_id => $item ) {
- // Set user passed `order_id` so that we can track if any commission_rate has been saved previously.
- // Specially on order table `re-generation`.
- $this->set_order_item_id( $item->get_id() );
-
- // Set line item quantity so that we can use it later in the `\WeDevs\Dokan\Commission::prepare_for_calculation()` method
- $this->set_order_qunatity( $item->get_quantity() );
-
$product_id = $item->get_variation_id() ? $item->get_variation_id() : $item->get_product_id();
$refund = $order->get_total_refunded_for_item( $item_id );
if ( dokan_is_admin_coupon_applied( $order, $vendor_id, $product_id ) ) {
- $earning += dokan_pro()->coupon->get_earning_by_admin_coupon( $order, $item, $context, $item->get_product(), $vendor_id, $refund );
+ $earning_or_commission += dokan_pro()->coupon->get_earning_by_admin_coupon( $order, $item, $context, $item->get_product(), $vendor_id, $refund );
} else {
$item_price = apply_filters( 'dokan_earning_by_order_item_price', $item->get_total(), $item, $order );
$item_price = $refund ? $item_price - $refund : $item_price;
- $item_earning = $this->calculate_commission( $product_id, $item_price, $vendor_id );
- $item_earning = 'admin' === $context ? $item_price - $item_earning : $item_earning;
- $earning += $item_earning;
+ $item_earning_or_commission = $this->get_commission(
+ [
+ 'order_item_id' => $item->get_id(),
+ 'product_id' => $product_id,
+ 'total_amount' => $item_price,
+ 'total_quantity' => $item->get_quantity(),
+ 'vendor_id' => $vendor_id,
+ ],
+ true
+ );
+ $item_earning_or_commission = 'admin' === $context ? $item_earning_or_commission->get_admin_commission() : $item_earning_or_commission->get_vendor_earning();
+ $earning_or_commission += $item_earning_or_commission;
}
-
- // reset order item id to zero
- $this->set_order_item_id( 0 );
- // set order quantity to zero
- $this->set_order_qunatity( 0 );
}
- // reset order id to zero, we don't need this value anymore
- $this->set_order_id( 0 );
-
- if ( $context === $this->get_shipping_fee_recipient( $order ) ) {
- $earning += wc_format_decimal( floatval( $order->get_shipping_total() ) ) - $order->get_total_shipping_refunded();
+ if ( $context === dokan()->fees->get_shipping_fee_recipient( $order ) ) {
+ $earning_or_commission += $order->get_shipping_total() - $order->get_total_shipping_refunded();
}
- if ( $context === $this->get_tax_fee_recipient( $order->get_id() ) ) {
- $earning += ( ( $order->get_total_tax() - $order->get_total_tax_refunded() ) - ( $order->get_shipping_tax() - $this->get_total_shipping_tax_refunded( $order ) ) );
+ if ( $context === dokan()->fees->get_tax_fee_recipient( $order->get_id() ) ) {
+ $earning_or_commission += ( ( $order->get_total_tax() - $order->get_total_tax_refunded() ) - ( $order->get_shipping_tax() - dokan()->fees->get_total_shipping_tax_refunded( $order ) ) );
}
- if ( $context === $this->get_shipping_tax_fee_recipient( $order ) ) {
- $earning += ( $order->get_shipping_tax() - $this->get_total_shipping_tax_refunded( $order ) );
+ if ( $context === dokan()->fees->get_shipping_tax_fee_recipient( $order ) ) {
+ $earning_or_commission += ( $order->get_shipping_tax() - dokan()->fees->get_total_shipping_tax_refunded( $order ) );
}
- $earning = apply_filters_deprecated( 'dokan_order_admin_commission', [ $earning, $order, $context ], '2.9.21', 'dokan_get_earning_by_order' );
-
- return apply_filters( 'dokan_get_earning_by_order', $earning, $order, $context );
- }
-
- /**
- * Get global rate
- *
- * @since 2.9.21
- *
- * @return float
- */
- public function get_global_rate() {
- return $this->validate_rate( dokan_get_option( 'admin_percentage', 'dokan_selling', 0 ) );
- }
+ $earning_or_commission = apply_filters_deprecated( 'dokan_order_admin_commission', [ $earning_or_commission, $order, $context ], '2.9.21', 'dokan_get_earning_by_order' );
- /**
- * Get vendor wise commission rate
- *
- * @since 2.9.21
- *
- * @param int $vendor_id
- *
- * @return float
- */
- public function get_vendor_wise_rate( $vendor_id ) {
- return $this->validate_rate( get_user_meta( $vendor_id, 'dokan_admin_percentage', true ) );
- }
-
- /**
- * Get product wise commission rate
- *
- * @since 2.9.21
- *
- * @param int $product_id
- *
- * @return float
- */
- public function get_product_wise_rate( $product_id ) {
- return $this->validate_rate( get_post_meta( $this->validate_product_id( $product_id ), '_per_product_admin_commission', true ) );
- }
-
- /**
- * Validate product id (if it's a variable product, return it's parent id)
- *
- * @since 2.9.21
- *
- * @param int $product_id
- *
- * @return int
- */
- public function validate_product_id( $product_id ) {
- $product = wc_get_product( $product_id );
- if ( ! $product ) {
- return 0;
- }
-
- $parent_id = $product->get_parent_id();
-
- return $parent_id ? $parent_id : $product_id;
- }
-
- /**
- * Get category wise commission rate
- *
- * @since 2.9.21
- *
- * @param int $product_id
- *
- * @return float
- */
- public function get_category_wise_rate( $product_id ) {
- $terms = Helper::get_product_chosen_category( $this->validate_product_id( $product_id ) );
-
- // Category commission will not applicable if 'Product Category Selection' is set as 'Multiple' in Dokan settings.
- if ( ! is_array( $terms ) || empty( $terms ) || count( $terms ) > 1 || ! Helper::product_category_selection_is_single() ) {
- return null;
- }
-
- $term_id = $terms[0];
- $rate = ! $terms ? null : get_term_meta( $term_id, 'per_category_admin_commission', true );
-
- return $this->validate_rate( $rate );
- }
-
- /**
- * Get global commission type
- *
- * @since 2.9.21
- *
- * @return string
- */
- public function get_global_type() {
- return dokan_get_option( 'commission_type', 'dokan_selling', 'percentage' );
- }
-
- /**
- * Get vendor wise commission type
- *
- * @since 2.9.21
- *
- * @param int $vendor_id
- *
- * @return string
- */
- public function get_vendor_wise_type( $vendor_id ) {
- return get_user_meta( $vendor_id, 'dokan_admin_percentage_type', true );
- }
-
- /**
- * Get category wise commission type
- *
- * @since 2.9.21
- *
- * @param int $product_id
- *
- * @return string
- */
- public function get_category_wise_type( $product_id ) {
- $terms = get_the_terms( $this->validate_product_id( $product_id ), 'product_cat' );
- $term_id = $terms[0]->term_id;
-
- return ! $terms ? null : get_term_meta( $term_id, 'per_category_admin_commission_type', true );
- }
-
- /**
- * Get product wise commission type
- *
- * @since 2.9.21
- *
- * @param int $product_id
- *
- * @return string
- */
- public function get_product_wise_type( $product_id ) {
- return get_post_meta( $this->validate_product_id( $product_id ), '_per_product_admin_commission_type', true );
+ return apply_filters( 'dokan_get_earning_by_order', $earning_or_commission, $order, $context );
}
/**
@@ -493,196 +294,26 @@ public function validate_rate( $rate ) {
}
/**
- * Get global earning
- *
- * @since 2.9.21
- *
- * @param float $product_price
- *
- * @return float|null on failure
- */
- public function get_global_earning( $product_price ) {
- return $this->prepare_for_calculation( __FUNCTION__, null, $product_price );
- }
-
- /**
- * Get vendor wise earning
- *
- * @since 2.9.21
+ * Get vendor wise additional rate
*
- * @param int $vendor_id
- * @param float $product_price
- *
- * @return float|null on failure
- */
- public function get_vendor_wise_earning( $vendor_id, $product_price ) {
- return $this->prepare_for_calculation( __FUNCTION__, $vendor_id, $product_price );
- }
-
- /**
- * Get category wise earning
+ * @deprecated 3.14.0 Use dokan()->vendor->get( $vendor_id )->get_commission_settings()->get_percentage() insted
*
* @since 2.9.21
*
- * @param int $product_id
- * @param float $product_price
- *
- * @return float|null on failure
- */
- public function get_category_wise_earning( $product_id, $product_price ) {
- if ( ! dokan()->is_pro_exists() ) {
- return null;
- }
-
- return $this->prepare_for_calculation( __FUNCTION__, $product_id, $product_price );
- }
-
- /**
- * Get product wise earning
- *
- * @since 2.9.21
- *
- * @param int $product_id
- * @param int $product_price
- *
- * @return float|null on failure
- */
- public function get_product_wise_earning( $product_id, $product_price ) {
- if ( ! dokan()->is_pro_exists() ) {
- return null;
- }
-
- return $this->prepare_for_calculation( __FUNCTION__, $product_id, $product_price );
- }
-
- /**
- * Prepare for calculation
- *
- * @since 2.9.21
- *
- * @param callable $callable
- * @param int $product_id
- * @param float $product_price
- *
- * @return float | null on failure
- */
- public function prepare_for_calculation( $callable, $product_id = 0, $product_price = 0 ) {
- do_action( 'dokan_before_prepare_for_calculation', $callable, $product_id, $product_price, $this );
-
- // If an order has been purchased previously, calculate the earning with the previously stated commission rate.
- // It's important cause commission rate may get changed by admin during the order table `re-generation`.
- $commission_rate = $this->get_order_item_id() ? wc_get_order_item_meta( $this->get_order_item_id(), '_dokan_commission_rate', true ) : null;
- $commission_type = $this->get_order_item_id() ? wc_get_order_item_meta( $this->get_order_item_id(), '_dokan_commission_type', true ) : null;
- $additional_fee = $this->get_order_item_id() ? wc_get_order_item_meta( $this->get_order_item_id(), '_dokan_additional_fee', true ) : null;
-
- if ( empty( $commission_rate ) ) { // this is the first time we are calculating commission for this order
- // Set default value as null
- $commission_rate = null;
- $commission_type = null;
- $additional_fee = null;
-
- $func_rate = str_replace( 'earning', 'rate', $callable );
- $func_type = str_replace( 'earning', 'type', $callable );
- $func_fee = str_replace( 'earning', 'additional_fee', $callable );
-
- // get[product,category,vendor,global]_wise_rate
- if ( is_callable( [ $this, $func_rate ] ) ) {
- $commission_rate = $this->$func_rate( $product_id );
- }
-
- if ( is_null( $commission_rate ) ) {
- return $commission_rate;
- }
-
- // get[product,category,vendor,global]_wise_type
- if ( is_callable( [ $this, $func_type ] ) ) {
- $commission_type = $this->$func_type( $product_id );
- }
-
- // get[product,category,vendor,global]_wise_additional_fee
- if ( is_callable( [ $this, $func_fee ] ) ) {
- $additional_fee = $this->$func_fee( $product_id );
- }
-
- // Saving applied commission rates and types for current order item in order item meta.
- wc_add_order_item_meta( $this->get_order_item_id(), '_dokan_commission_rate', $commission_rate );
- wc_add_order_item_meta( $this->get_order_item_id(), '_dokan_commission_type', $commission_type );
- wc_add_order_item_meta( $this->get_order_item_id(), '_dokan_additional_fee', $additional_fee );
- }
-
- /**
- * If dokan pro doesn't exist but combine commission is found in database due to it was active before
- * Then make the commission type 'flat'. We are making it flat cause when commission type is there in database
- * But in option field, looks like flat commission is selected.
- *
- * @since 3.0.0
- */
- if ( ! dokan()->is_pro_exists() && 'combine' === $commission_type ) {
- $commission_type = 'flat';
- }
-
- $earning = null;
-
- if ( 'flat' === $commission_type ) {
- if ( (int) $this->get_order_qunatity() > 1 ) {
- $commission_rate *= apply_filters( 'dokan_commission_multiply_by_order_quantity', $this->get_order_qunatity() );
- }
-
- // If `_dokan_item_total` returns value non-falsy value, it means the request is comming from the `order refund requst`.
- // As it's `flat` fee, So modify `commission rate` to the correct amount to get refunded. (commission_rate/item_total)*product_price.
- $item_total = 0;
- if ( $this->get_order_id() ) {
- $order = wc_get_order( $this->get_order_id() );
- $item_total = $order->get_meta( '_dokan_item_total', true );
- }
-
- if ( $item_total ) {
- $commission_rate = ( $commission_rate / $item_total ) * $product_price;
- }
-
- $earning = $product_price - $commission_rate;
- } elseif ( 'percentage' === $commission_type ) {
- $earning = ( $product_price * $commission_rate ) / 100;
- $earning = $product_price - $earning;
-
- // vendor will get 100 percent if commission rate > 100
- if ( $commission_rate > 100 ) {
- $earning = $product_price;
- }
- }
-
- return apply_filters( 'dokan_prepare_for_calculation', $earning, $commission_rate, $commission_type, $additional_fee, $product_price, $this->get_order_id() );
- }
-
- /**
- * Get product wise additional fee
- *
- * @since 2.9.21
- *
- * @param int $product_id
- *
- * @return float|null on failure
- */
- public function get_product_wise_additional_fee( $product_id ) {
- return $this->validate_rate( get_post_meta( $this->validate_product_id( $product_id ), '_per_product_admin_additional_fee', true ) );
- }
-
- /**
- * Get global wise additional fee
- *
- * @since 2.9.21
- *
- * @param int $product_id
+ * @param int $vendor_id
*
* @return float|null on failure
*/
- public function get_global_additional_fee() {
- return $this->validate_rate( dokan_get_option( 'additional_fee', 'dokan_selling', 0 ) );
+ public function get_vendor_wise_rate( $vendor_id ) {
+ _deprecated_function( __METHOD__, '3.14.0', 'dokan()->vendor->get( $vendor_id )->get_commission_settings()->get_percentage()' );
+ return dokan()->vendor->get( $vendor_id )->get_commission_settings()->get_percentage();
}
/**
* Get vendor wise additional fee
*
+ * @deprecated 3.14.0 Use dokan()->vendor->get( $vendor_id )->get_commission_settings()->get_flat() instead
+ *
* @since 2.9.21
*
* @param int $vendor_id
@@ -690,29 +321,24 @@ public function get_global_additional_fee() {
* @return float|null on failure
*/
public function get_vendor_wise_additional_fee( $vendor_id ) {
- return $this->validate_rate( get_user_meta( $vendor_id, 'dokan_admin_additional_fee', true ) );
+ _deprecated_function( __METHOD__, '3.14.0', 'dokan()->vendor->get( $vendor_id )->get_commission_settings()->get_flat()' );
+ return dokan()->vendor->get( $vendor_id )->get_commission_settings()->get_flat();
}
/**
- * Get category wise additional fee
+ * Get vendor wise additional type
+ *
+ * @deprecated 3.14.0 Use dokan()->vendor->get( $vendor_id )->get_commission_settings()->get_type() instead
*
* @since 2.9.21
*
- * @param int $product_id
+ * @param int $vendor_id
*
* @return float|null on failure
*/
- public function get_category_wise_additional_fee( $product_id ) {
- $terms = get_the_terms( $this->validate_product_id( $product_id ), 'product_cat' );
-
- if ( empty( $terms ) ) {
- return null;
- }
-
- $term_id = $terms[0]->term_id;
- $rate = ! $terms ? null : get_term_meta( $term_id, 'per_category_admin_additional_fee', true );
-
- return $this->validate_rate( $rate );
+ public function get_vendor_wise_type( $vendor_id ) {
+ _deprecated_function( __METHOD__, '3.14.0', 'dokan()->vendor->get( $vendor_id )->get_commission_settings()->get_type()' );
+ return dokan()->vendor->get( $vendor_id )->get_commission_settings()->get_type();
}
/**
@@ -755,6 +381,8 @@ public function get_earning_from_order_table( $order_id, $context = 'seller' ) {
/**
* Get shipping fee recipient
*
+ * @deprecated 3.14.0 Use dokan()->fees->get_shipping_fee_recipient() instead
+ *
* @since 2.9.21
* @since 3.4.1 introduced the shipping fee recipient hook
*
@@ -763,30 +391,16 @@ public function get_earning_from_order_table( $order_id, $context = 'seller' ) {
* @return string
*/
public function get_shipping_fee_recipient( $order ) {
- if ( is_numeric( $order ) ) {
- $order = wc_get_order( $order );
- }
-
- if ( ! $order ) {
- return new WP_Error( 'invalid-order-object', __( 'Please provide a valid order object.', 'dokan-lite' ) );
- }
+ _deprecated_function( __METHOD__, '3.14.0', 'dokan()->fees->get_shipping_fee_recipient()' );
- $saved_shipping_recipient = $order->get_meta( 'shipping_fee_recipient', true );
-
- if ( $saved_shipping_recipient ) {
- $shipping_recipient = $saved_shipping_recipient;
- } else {
- $shipping_recipient = apply_filters( 'dokan_shipping_fee_recipient', dokan_get_option( 'shipping_fee_recipient', 'dokan_selling', 'seller' ), $order->get_id() );
- $order->update_meta_data( 'shipping_fee_recipient', $shipping_recipient );
- $order->save();
- }
-
- return $shipping_recipient;
+ return dokan()->fees->get_shipping_fee_recipient( $order );
}
/**
* Get tax fee recipient
*
+ * @deprecated 3.14.0 Use dokan()->fees->get_tax_fee_recipient() instead
+ *
* @since 2.9.21
* @since 3.4.1 introduced the tax fee recipient hook
*
@@ -795,30 +409,16 @@ public function get_shipping_fee_recipient( $order ) {
* @return string|WP_Error
*/
public function get_tax_fee_recipient( $order ) {
- if ( is_numeric( $order ) ) {
- $order = wc_get_order( $order );
- }
-
- if ( ! $order ) {
- return new WP_Error( 'invalid-order-object', __( 'Please provide a valid order object.', 'dokan-lite' ) );
- }
-
- $saved_tax_recipient = $order->get_meta( 'tax_fee_recipient', true );
-
- if ( $saved_tax_recipient ) {
- $tax_recipient = $saved_tax_recipient;
- } else {
- $tax_recipient = apply_filters( 'dokan_tax_fee_recipient', dokan_get_option( 'tax_fee_recipient', 'dokan_selling', 'seller' ), $order->get_id() );
- $order->update_meta_data( 'tax_fee_recipient', $tax_recipient );
- $order->save();
- }
+ _deprecated_function( __METHOD__, '3.14.0', 'dokan()->fees->get_tax_fee_recipient()' );
- return $tax_recipient;
+ return dokan()->fees->get_tax_fee_recipient( $order );
}
/**
* Get shipping tax fee recipient.
*
+ * @deprecated 3.14.0 Use dokan()->fees->get_shipping_tax_fee_recipient() instead
+ *
* @since 3.7.19
*
* @param WC_Order $order Order.
@@ -826,25 +426,15 @@ public function get_tax_fee_recipient( $order ) {
* @return string
*/
public function get_shipping_tax_fee_recipient( $order ): string {
- // get saved tax recipient
- $saved_shipping_tax_recipient = $order->get_meta( 'shipping_tax_fee_recipient', true );
- if ( ! empty( $saved_shipping_tax_recipient ) ) {
- return $saved_shipping_tax_recipient;
- }
-
- $default_tax_fee_recipient = $this->get_tax_fee_recipient( $order->get_id() ); // this is needed for backward compatibility
- $shipping_tax_recipient = dokan_get_option( 'shipping_tax_fee_recipient', 'dokan_selling', $default_tax_fee_recipient );
- $shipping_tax_recipient = apply_filters( 'dokan_shipping_tax_fee_recipient', $shipping_tax_recipient, $order->get_id() );
-
- $order->update_meta_data( 'shipping_tax_fee_recipient', $shipping_tax_recipient, true );
- $order->save();
-
- return $shipping_tax_recipient;
+ _deprecated_function( __METHOD__, '3.14.0', 'dokan()->fees->get_shipping_tax_fee_recipient()' );
+ return dokan()->fees->get_shipping_tax_fee_recipient( $order );
}
/**
* Get total shipping tax refunded for the order.
*
+ * @deprecated 3.14.0 Use dokan()->fees->get_total_shipping_tax_refunded() instead
+ *
* @since 3.7.19
*
* @param WC_Order $order Order.
@@ -852,23 +442,16 @@ public function get_shipping_tax_fee_recipient( $order ): string {
* @return float
*/
public function get_total_shipping_tax_refunded( WC_Order $order ): float {
- $tax_refunded = 0.0;
-
- foreach ( $order->get_items( 'shipping' ) as $item_id => $item ) {
- /**
- * @var \WC_Order_Item_Shipping $item Shipping item.
- */
- foreach ( $item->get_taxes()['total'] as $tax_id => $tax_amount ) {
- $tax_refunded += $order->get_tax_refunded_for_item( $item->get_id(), $tax_id, 'shipping' );
- }
- }
+ _deprecated_function( __METHOD__, '3.14.0', 'dokan()->fees->get_total_shipping_tax_refunded()' );
- return $tax_refunded;
+ return dokan()->fees->get_total_shipping_tax_refunded( $order );
}
/**
* Get processing fee
*
+ * @deprecated 3.14.0 Use dokan()->fees->get_processing_fee instead.
+ *
* @since DOKAN_LITE_SINCE
*
* @param WC_Order $order
@@ -876,21 +459,9 @@ public function get_total_shipping_tax_refunded( WC_Order $order ): float {
* @return float
*/
public function get_processing_fee( $order ) {
- $processing_fee = 0;
- $payment_method = $order->get_payment_method();
-
- if ( 'paypal' === $payment_method ) {
- $processing_fee = $order->get_meta( 'PayPal Transaction Fee' );
- } elseif ( 'ppec_paypal' === $payment_method && defined( 'PPEC_FEE_META_NAME_NEW' ) ) {
- $processing_fee = $order->get_meta( PPEC_FEE_META_NAME_NEW );
- } elseif ( 'ppcp-gateway' === $payment_method && class_exists( PayPalGateway::class ) ) {
- $breakdown = $order->get_meta( PayPalGateway::FEES_META_KEY );
- if ( is_array( $breakdown ) && isset( $breakdown['paypal_fee'] ) && is_array( $breakdown['paypal_fee'] ) ) {
- $processing_fee = $breakdown['paypal_fee']['value'];
- }
- }
+ _deprecated_function( __METHOD__, '3.14.0', 'dokan()->fees->get_processing_fee' );
- return apply_filters( 'dokan_get_processing_fee', $processing_fee, $order );
+ return dokan()->fees->get_processing_fee( $order );
}
/**
@@ -916,6 +487,9 @@ public function get_all_order_to_be_processed( $order ) {
/**
* Calculate commission (commission priority [1.product, 2.category, 3.vendor, 4.global] wise)
+ * I this function the calculation was written for vendor perspective it is deprecated now it is recomanded to use `get_commission` method it works fo admin perspective.
+ *
+ * @deprecated 3.14.0 Use get_commission() instead.
*
* @since 2.9.21
*
@@ -926,30 +500,129 @@ public function get_all_order_to_be_processed( $order ) {
* @return float
*/
public function calculate_commission( $product_id, $product_price, $vendor_id = null ) {
- $product_wise_earning = $this->get_product_wise_earning( $product_id, $product_price );
+ _deprecated_function( __METHOD__, '3.14.0', 'get_commission' );
+
+ $commission_data = $this->get_commission(
+ [
+ 'order_item_id' => $this->get_order_item_id(),
+ 'total_amount' => $product_price,
+ 'total_quantity' => $this->get_order_qunatity(),
+ 'product_id' => $product_id,
+ 'vendor_id' => $vendor_id,
+ ],
+ true
+ );
- if ( ! is_null( $product_wise_earning ) ) {
- return $product_wise_earning;
- }
+ $parameters = $commission_data->get_parameters() ?? [];
+ $percentage = $parameters['percentage'] ?? 0;
+ $flat = $parameters['flat'] ?? 0;
+
+ return apply_filters(
+ 'dokan_after_commission_calculation',
+ $commission_data->get_vendor_earning() ?? 0,
+ $percentage, $commission_data->get_type() ?? 'none',
+ $flat,
+ $product_price,
+ $this->get_order_id()
+ );
+ }
+
+ /**
+ * Returns all the commission types that ware in dokan. These types were existed before dokan lite version 3.14.0
+ *
+ * @since 3.14.0
+ *
+ * @return array
+ */
+ public function get_legacy_commission_types() {
+ return [
+ 'combine' => __( 'Combine', 'dokan-lite' ),
+ 'percentage' => __( 'Percentage', 'dokan-lite' ),
+ 'flat' => __( 'Flat', 'dokan-lite' ),
+ ];
+ }
- $category_wise_earning = $this->get_category_wise_earning( $product_id, $product_price );
+ /**
+ * Returns commission (commission priority [1.Order item if exists. 2.product, 3.vendor, 4.global] wise)
+ *
+ * @since 3.14.0
+ *
+ * @param array $args {
+ * Accepted arguments are below.
+ *
+ * @type int $order_item_id Order item id. Default ''. Accepted values numbers.
+ * @type float|int $total_amount The amount on which the commission will be calculated. Default 0. Accepted values numbers.
+ * Ff you want to calculate for order line item the $total_amount should be total line item amount and
+ * $total_quantity should be total line item quantity. EX: for product item apple with cost $100 then $total_amount = 500, $total_quantity = 5
+ * or if you want to calculate for product price the $total_amount should be the product price and $total_quantity should be 1
+ * EX: for product apple with cost $100 then $total_amount = 100, $total_quantity = 1
+ * @type int $total_quantity This is the total quantity that represents the $total_amounts item units. Default 1. Accepted values numbers.
+ * Please read $total_amount doc above to understand clearly.
+ * @type int $product_id Product id. Default 0. Accepted values numbers.
+ * @type int $vendor_id Vendor id. Default ''. Accepted values numbers.
+ * @type int $category_id Product category id. Default 0'. Accepted values numbers.
+ * }
+ * @param boolean $auto_save If true, it will save the calculated commission automatically to the given `$order_item_id`. Default 'false`. Accepted values boolean.
+ *
+ * @return \WeDevs\Dokan\Commission\Model\Commission
+ */
+ public function get_commission( $args = [], $auto_save = false ) {
+ $order_item_id = ! empty( $args['order_item_id'] ) ? $args['order_item_id'] : '';
+ $total_amount = ! empty( $args['total_amount'] ) ? $args['total_amount'] : 0;
+ $total_quantity = ! empty( $args['total_quantity'] ) ? $args['total_quantity'] : 1;
+ $product_id = ! empty( $args['product_id'] ) ? $args['product_id'] : 0;
+ $vendor_id = ! empty( $args['vendor_id'] ) ? $args['vendor_id'] : '';
+ $category_id = ! empty( $args['category_id'] ) ? $args['category_id'] : 0;
- if ( ! is_null( $category_wise_earning ) ) {
- return $category_wise_earning;
+ // Category commission will not applicable if 'Product Category Selection' is set as 'Multiple' in Dokan settings.
+ if ( ! empty( $product_id ) && empty( $category_id ) ) {
+ $product_categories = Helper::get_saved_products_category( $product_id );
+ $chosen_categories = $product_categories['chosen_cat'];
+ $category_id = reset( $chosen_categories );
+ $category_id = $category_id ? $category_id : 0;
}
- $vendor_wise_earning = $this->get_vendor_wise_earning( $vendor_id, $product_price );
+ /**
+ * If the $total_amount is empty and $order_item_id is empty then we will calculate the commission based on the product price.
+ * There is a case where the $total_amount is empty and $order_item_id is empty but the $product_id is not empty
+ * In this case, we will calculate the commission based on the product price.
+ * Also there is an issue when 100% coupon is applied see the below link for more details
+ *
+ * @see https://github.com/getdokan/dokan/pull/2440#issuecomment-2488159960
+ */
+ if ( ! empty( $product_id ) && empty( $total_amount ) && empty( $order_item_id ) ) {
+ $product = dokan()->product->get( $product_id );
- if ( ! is_null( $vendor_wise_earning ) ) {
- return $vendor_wise_earning;
+ // If product price is empty the setting the price as 0
+ $total_amount = $product && $product->get_price() && ! empty( $product->get_price() ) ? $product->get_price() : 0;
}
- $global_earning = $this->get_global_earning( $product_price );
+ $order_item_strategy = new OrderItem( $order_item_id, $total_amount, $total_quantity );
- if ( ! is_null( $global_earning ) ) {
- return $global_earning;
+ $strategies = [
+ $order_item_strategy,
+ new Product( $product_id ),
+ new Vendor( $vendor_id, $category_id ),
+ new GlobalStrategy( $category_id ),
+ new DefaultStrategy(),
+ ];
+
+ $context = new Calculator( $strategies );
+ $commission_data = $context->calculate_commission( $total_amount, $total_quantity );
+
+ if ( ! empty( $order_item_id ) && $auto_save && $commission_data->get_source() !== $order_item_strategy::SOURCE ) {
+ $parameters = $commission_data->get_parameters() ?? [];
+ $percentage = $parameters['percentage'] ?? 0;
+ $flat = $parameters['flat'] ?? 0;
+
+ $order_item_strategy->save_line_item_commission_to_meta(
+ $commission_data->get_type() ?? DefaultSetting::TYPE,
+ $percentage,
+ $flat,
+ $commission_data->get_data()
+ );
}
- return $product_price;
+ return $commission_data;
}
}
diff --git a/includes/Commission/Calculator.php b/includes/Commission/Calculator.php
new file mode 100644
index 0000000000..d5dc34fdd8
--- /dev/null
+++ b/includes/Commission/Calculator.php
@@ -0,0 +1,80 @@
+strategies = $strategies;
+ }
+
+ /**
+ * Returns applied commission data
+ *
+ * @since 3.14.0
+ *
+ * @param int|float $total_amount
+ * @param int $total_quantity
+ *
+ * @return \WeDevs\Dokan\Commission\Model\Commission
+ */
+ public function calculate_commission( $total_amount, $total_quantity = 1 ): Commission {
+ if ( ! is_numeric( $total_quantity ) || $total_quantity < 1 ) {
+ $total_quantity = 1;
+ }
+
+ if ( ! is_numeric( $total_amount ) ) {
+ $total_quantity = 0;
+ }
+
+ $commission_data = new Commission();
+ $commission_data->set_vendor_earning( $total_amount )
+ ->set_total_quantity( $total_quantity )
+ ->set_total_amount( $total_amount );
+
+ foreach ( $this->strategies as $strategy ) {
+ $formula = $strategy->create_formula();
+ if ( $formula->is_applicable() ) {
+ $formula->set_amount( $total_amount )
+ ->set_quantity( $total_quantity )
+ ->calculate();
+
+ $commission_data->set_source( $strategy->get_source() )
+ ->set_per_item_admin_commission( $formula->get_per_item_admin_commission() )
+ ->set_admin_commission( $formula->get_admin_commission() )
+ ->set_vendor_earning( $formula->get_vendor_earning() )
+ ->set_total_quantity( $formula->get_items_total_quantity() )
+ ->set_total_amount( $total_amount )
+ ->set_type( $formula->get_source() )
+ ->set_parameters( $formula->get_parameters() );
+
+ return $commission_data;
+ }
+ }
+
+ // If no commission is defined at any level.
+ return $commission_data;
+ }
+}
diff --git a/includes/Commission/Formula/AbstractFormula.php b/includes/Commission/Formula/AbstractFormula.php
new file mode 100644
index 0000000000..931f56cf92
--- /dev/null
+++ b/includes/Commission/Formula/AbstractFormula.php
@@ -0,0 +1,189 @@
+settings = $setting;
+
+ return $this;
+ }
+
+ /**
+ * Returns the commission settings.
+ *
+ * @since 3.14.0
+ *
+ * @return \WeDevs\Dokan\Commission\Model\Setting
+ */
+ public function get_settings(): Setting {
+ return $this->settings;
+ }
+
+ /**
+ * Sets the total amount on which the commission will be calculated.
+ *
+ * @param float|int $amount
+ *
+ * @since 3.14.0
+ *
+ * @return AbstractFormula
+ */
+ public function set_amount( $amount ): AbstractFormula {
+ $this->total_amount = $amount;
+
+ return $this;
+ }
+
+ /**
+ * Sets the total quantity on which the commission will be calculated.
+ *
+ * @param int $quantity
+ *
+ * @since 3.14.0
+ *
+ * @return AbstractFormula
+ */
+ public function set_quantity( $quantity ): AbstractFormula {
+ $this->total_quantity = $quantity;
+
+ return $this;
+ }
+
+ /**
+ * Returns the total amount on which the commission will be calculated.
+ *
+ * @since 3.14.0
+ *
+ * @return float|int
+ */
+ public function get_amount() {
+ return $this->total_amount;
+ }
+
+ /**
+ * Returns the total quantity on which the commission will be calculated.
+ *
+ * @since 3.14.0
+ *
+ * @return int
+ */
+ public function get_quantity(): int {
+ return $this->total_quantity;
+ }
+
+ /**
+ * Calculate the commission here and set the commission values.
+ *
+ * @since 3.14.0
+ *
+ * @param $total_amount
+ *
+ * @param $total_quantity
+ *
+ * @return void
+ */
+ abstract public function calculate();
+
+ /**
+ * Returns admin commission.
+ *
+ * @since 3.14.0
+ *
+ * @return float
+ */
+ abstract public function get_admin_commission(): float;
+
+ /**
+ * Returns vendor earning.
+ *
+ * @since 3.14.0
+ *
+ * @return float
+ */
+ abstract public function get_vendor_earning(): float;
+
+ /**
+ * Returns applied commission parameters.
+ *
+ * @since 3.14.0
+ *
+ * @return array
+ */
+ abstract public function get_parameters(): array;
+
+ /**
+ * Returns applied commission source.
+ *
+ * @since 3.14.0
+ *
+ * @return string
+ */
+ abstract public function get_source(): string;
+
+ /**
+ * Returns per item admin commission amount.
+ *
+ * @since 3.14.0
+ *
+ * @return float
+ */
+ abstract public function get_per_item_admin_commission(): float;
+
+ /**
+ * Returns the quantity for which the commission will be calculated.
+ *
+ * @since 3.14.0
+ *
+ * @return int
+ */
+ abstract public function get_items_total_quantity(): int;
+
+ /**
+ * Returns if the commission is applicable or not.
+ *
+ * @since 3.14.0
+ *
+ * @return bool
+ */
+ abstract public function is_applicable(): bool;
+}
diff --git a/includes/Commission/Formula/CategoryBased.php b/includes/Commission/Formula/CategoryBased.php
new file mode 100644
index 0000000000..4cdff74f7a
--- /dev/null
+++ b/includes/Commission/Formula/CategoryBased.php
@@ -0,0 +1,354 @@
+set_settings( $this->get_valid_commission_settings( $settings ) );
+ $this->fixed_formula = new Fixed( $this->fixed_commission_setting );
+ }
+
+ /**
+ * Calculating the category commission.
+ *
+ * @since 3.14.0
+ *
+ * @return void
+ */
+ public function calculate() {
+ $this->set_quantity( max( $this->get_quantity(), 1 ) );
+
+ if ( $this->is_applicable() && $this->fixed_formula->is_applicable() ) {
+ $this->fixed_formula->set_amount( $this->get_amount() );
+ $this->fixed_formula->set_quantity( $this->get_quantity() );
+ $this->fixed_formula->calculate();
+
+ $this->per_item_admin_commission = $this->fixed_formula->get_per_item_admin_commission();
+ $this->admin_commission = $this->fixed_formula->get_admin_commission();
+ $this->vendor_earning = $this->fixed_formula->get_vendor_earning();
+ } else {
+ $this->per_item_admin_commission = 0;
+ $this->admin_commission = 0;
+ $this->vendor_earning = $this->get_amount();
+ }
+
+ $this->items_total_quantity = $this->get_quantity();
+ }
+
+ /**
+ * Returns calculated commissions meta data.
+ *
+ * @since 3.14.0
+ *
+ * @return array
+ */
+ public function get_meta_data(): array {
+ return $this->meta_data;
+ }
+
+ /**
+ * Sets category commission meta data.
+ *
+ * @since 3.14.0
+ *
+ * @param array $meta_data
+ *
+ * @return \WeDevs\Dokan\Commission\Formula\CategoryBased
+ */
+ public function set_meta_data( array $meta_data ): CategoryBased {
+ $this->meta_data = $meta_data;
+
+ return $this;
+ }
+
+ /**
+ * Returns type.
+ *
+ * @since 3.14.0
+ *
+ * @return mixed
+ */
+ public function get_type() {
+ return $this->type;
+ }
+
+ /**
+ * Get commission date parameters.
+ *
+ * @since 3.14.0
+ *
+ * @return array
+ */
+ public function get_parameters(): array {
+ $parameters = $this->fixed_formula->get_parameters();
+
+ $parameters['category_id'] = $this->get_settings()->get_category_id();
+ $parameters['meta_data'] = $this->get_settings()->get_meta_data();
+
+ return $parameters;
+ }
+
+ /**
+ * Returns commission source.
+ *
+ * @since 3.14.0
+ *
+ * @return string
+ */
+ public function get_source(): string {
+ return self::SOURCE;
+ }
+
+ /**
+ * Returns if a category commission is applicable or not.
+ *
+ * @since 3.14.0
+ *
+ * @return bool
+ */
+ public function is_applicable(): bool {
+ if ( $this->is_valid_commission_type() && $this->is_valid_commission_data() ) {
+ // Changing the type here another wise fixed commission is applicable will always be false, we will set back the type to category later.
+ $this->set_settings( $this->get_settings()->set_type( Fixed::SOURCE ) );
+ $applicable = $this->fixed_formula->is_applicable();
+
+ // Setting the commission type back to category based.
+ $this->set_settings( $this->get_settings()->set_type( self::SOURCE ) );
+ return $applicable;
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns true if commission type is valid.
+ *
+ * @since 3.14.0
+ *
+ * @return bool
+ */
+ protected function is_valid_commission_type(): bool {
+ return $this->get_settings()->get_type() === $this->get_source();
+ }
+
+ /**
+ * Returns if saved commission data is valid to be applied.
+ *
+ * @since 3.14.0
+ *
+ * @return bool
+ */
+ protected function is_valid_commission_data(): bool {
+ $valid_category_id = is_numeric( $this->get_settings()->get_category_id() );
+ $has_category_setting = isset( $this->get_settings()->get_category_commissions()['items'][ $this->get_settings()->get_category_id() ] );
+ $category_flat_value = $has_category_setting && isset( $this->get_settings()->get_category_commissions()['items'][ $this->get_settings()->get_category_id() ]['flat'] )
+ ? $this->get_settings()->get_category_commissions()['items'][ $this->get_settings()->get_category_id() ]['flat']
+ : '';
+ $category_percentage_value = $has_category_setting && isset( $this->get_settings()->get_category_commissions()['items'][ $this->get_settings()->get_category_id() ]['percentage'] )
+ ? $this->get_settings()->get_category_commissions()['items'][ $this->get_settings()->get_category_id() ]['percentage']
+ : '';
+
+ $has_all_setting = isset( $this->get_settings()->get_category_commissions()['all'] );
+ $has_all_flat_setting = $has_all_setting && isset( $this->get_settings()->get_category_commissions()['all']['flat'] ) ? $this->get_settings()->get_category_commissions()['all']['flat'] : '';
+ $has_all_percentage_setting = $has_all_setting && isset( $this->get_settings()->get_category_commissions()['all']['percentage'] ) ? $this->get_settings()->get_category_commissions()['all']['percentage'] : '';
+
+ if (
+ $valid_category_id &&
+ $has_category_setting &&
+ ( is_numeric( $category_flat_value ) || is_numeric( $category_percentage_value ) )
+ ) {
+ return true;
+ } elseif (
+ $valid_category_id &&
+ $has_category_setting &&
+ ( ! is_numeric( $category_flat_value ) && ! is_numeric( $category_percentage_value ) )
+ ) {
+ return false;
+ } elseif ( $has_all_setting && ( is_numeric( $has_all_flat_setting ) || is_numeric( $has_all_percentage_setting ) ) ) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Validates and returns commission.
+ *
+ * @since 3.14.0
+ *
+ * @param Setting $setting
+ *
+ * @return Setting
+ */
+ protected function get_valid_commission_settings( Setting $setting ): Setting {
+ $this->set_settings( $setting );
+
+ $this->fixed_commission_setting = new Setting();
+ $this->fixed_commission_setting->set_type( Fixed::SOURCE )
+ ->set_flat( $this->get_settings()->get_flat() )
+ ->set_percentage( $this->get_settings()->get_percentage() )
+ ->set_category_id( $this->get_settings()->get_category_id() )
+ ->set_category_commissions( $this->get_settings()->get_category_commissions() )
+ ->set_meta_data( $this->get_settings()->get_meta_data() );
+
+ if ( ! $this->is_valid_commission_data() ) {
+ return $setting;
+ }
+
+ // $validated_setting = new Setting();
+ $commissions = $setting->get_category_commissions();
+ if ( is_numeric( $setting->get_category_id() ) && isset( $setting->get_category_commissions()['items'][ $setting->get_category_id() ] ) ) {
+ $items = $commissions['items'];
+ $item = $items[ $setting->get_category_id() ];
+
+ $this->fixed_commission_setting->set_flat( isset( $item['flat'] ) ? $item['flat'] : '' );
+ $this->fixed_commission_setting->set_percentage( isset( $item['percentage'] ) ? $item['percentage'] : '' );
+ $this->fixed_commission_setting->set_category_commissions( $commissions );
+ } elseif ( isset( $setting->get_category_commissions()['all'] ) && ( is_numeric( $setting->get_category_commissions()['all']['flat'] ) || is_numeric( $setting->get_category_commissions()['all']['percentage'] ) ) ) {
+ $all = $commissions['all'];
+
+ $this->fixed_commission_setting->set_flat( isset( $all['flat'] ) ? $all['flat'] : '' );
+ $this->fixed_commission_setting->set_percentage( isset( $all['percentage'] ) ? $all['percentage'] : '' );
+ $this->fixed_commission_setting->set_category_commissions( $commissions );
+ }
+
+ return $setting;
+ }
+
+ /**
+ * Returns admin commission amount.
+ *
+ * @since 3.14.0
+ *
+ * @return float
+ */
+ public function get_admin_commission(): float {
+ return $this->admin_commission;
+ }
+
+ /**
+ * Returns vendor earning amount.
+ *
+ * @since 3.14.0
+ *
+ * @return float
+ */
+ public function get_vendor_earning(): float {
+ return $this->vendor_earning;
+ }
+
+
+ /**
+ * Returns per item admin commission amount.
+ *
+ * @since 3.14.0
+ *
+ * @return float
+ */
+ public function get_per_item_admin_commission(): float {
+ return dokan()->commission->validate_rate( $this->per_item_admin_commission );
+ }
+
+ /**
+ * Returns the quantity on which the commission has been calculated.
+ *
+ * @since 3.14.0
+ *
+ * @return int
+ */
+ public function get_items_total_quantity(): int {
+ return $this->items_total_quantity;
+ }
+}
diff --git a/includes/Commission/Formula/Combine.php b/includes/Commission/Formula/Combine.php
new file mode 100644
index 0000000000..d93d0836dd
--- /dev/null
+++ b/includes/Commission/Formula/Combine.php
@@ -0,0 +1,198 @@
+set_settings( $settings );
+ }
+
+ /**
+ * Calculation is doing here.
+ *
+ * @since 3.14.0
+ *
+ * @return void
+ */
+ public function calculate() {
+ $percent_commission = $this->get_amount() * ( dokan()->commission->validate_rate( $this->get_settings()->get_percentage() ) / 100 );
+ $commission = (float) dokan()->commission->validate_rate( $this->get_settings()->get_flat() ) + $percent_commission;
+
+ $per_item_flat = dokan()->commission->validate_rate( $this->get_settings()->get_flat() ) / $this->get_quantity();
+ $per_item_percentage = $percent_commission / $this->get_quantity();
+
+ $this->admin_commission = $commission;
+ $this->per_item_admin_commission = $per_item_flat + $per_item_percentage;
+
+ if ( $this->get_per_item_admin_commission() > $this->get_amount() ) {
+ $this->per_item_admin_commission = $this->get_amount();
+ }
+
+ if ( $this->get_admin_commission() > $this->get_amount() ) {
+ $this->admin_commission = $this->get_amount();
+ }
+
+ $this->vendor_earning = $this->get_amount() - $this->admin_commission;
+ $this->items_total_quantity = $this->get_quantity();
+ }
+
+ /**
+ * Commission calculation parameters.
+ *
+ * @since 3.14.0
+ *
+ * @return array
+ */
+ public function get_parameters(): array {
+ return [
+ 'flat' => $this->get_settings()->get_flat(),
+ 'percentage' => $this->get_settings()->get_percentage(),
+ 'meta_data' => $this->get_settings()->get_meta_data(),
+ ];
+ }
+
+ /**
+ * Returns the combine commission surce text.
+ *
+ * @since 3.14.0
+ *
+ * @return string
+ */
+ public function get_source(): string {
+ return self::SOURCE;
+ }
+
+ /**
+ * Returns if the combine commission is applicable or not based on data.
+ *
+ * @since 3.14.0
+ *
+ * @return bool
+ */
+ public function is_applicable(): bool {
+ return $this->is_valid_commission_type() && $this->is_valid_commission_data();
+ }
+
+ /**
+ * Returns if the commission type data is valid.
+ *
+ * @since 3.14.0
+ *
+ * @return bool
+ */
+ protected function is_valid_commission_type(): bool {
+ $legacy_types = dokan()->commission->get_legacy_commission_types();
+
+ $all_types = array_keys( $legacy_types );
+
+ return in_array( $this->get_settings()->get_type(), $all_types, true ) || $this->get_settings()->get_type() === self::SOURCE;
+ }
+
+ /**
+ * Returns if commission is valid.
+ *
+ * @since 3.14.0
+ *
+ * @return bool
+ */
+ protected function is_valid_commission_data(): bool {
+ return is_numeric( $this->get_settings()->get_flat() ) || is_numeric( $this->get_settings()->get_percentage() );
+ }
+
+ /**
+ * Returns the admin commission
+ *
+ * @since 3.14.0
+ *
+ * @return float
+ */
+ public function get_admin_commission(): float {
+ return dokan()->commission->validate_rate( $this->admin_commission );
+ }
+
+ /**
+ * Returns the vendors earning.
+ *
+ * @since 3.14.0
+ *
+ * @return float
+ */
+ public function get_vendor_earning(): float {
+ return dokan()->commission->validate_rate( $this->vendor_earning );
+ }
+
+ /**
+ * Returns per item admin commission.
+ *
+ * @since 3.14.0
+ *
+ * @return float
+ */
+ public function get_per_item_admin_commission(): float {
+ return dokan()->commission->validate_rate( $this->per_item_admin_commission );
+ }
+
+ /**
+ * Returns the quantity on which the commission is calculated.
+ *
+ * @since 3.14.0
+ *
+ * @return int
+ */
+ public function get_items_total_quantity(): int {
+ return $this->items_total_quantity;
+ }
+}
diff --git a/includes/Commission/Formula/Fixed.php b/includes/Commission/Formula/Fixed.php
new file mode 100644
index 0000000000..5c97d1f1b6
--- /dev/null
+++ b/includes/Commission/Formula/Fixed.php
@@ -0,0 +1,226 @@
+set_settings( $settings );
+
+ $this->flat_calculator = new Flat( $this->get_settings() );
+ $this->percentage_calculator = new Percentage( $this->get_settings() );
+ }
+
+ /**
+ * Calculating the fixed commission.
+ *
+ * @since 3.14.0
+ *
+ * @return void
+ */
+ public function calculate() {
+ $this->set_quantity( max( $this->get_quantity(), 1 ) );
+
+ if ( $this->flat_calculator->is_applicable() ) {
+ $this->flat_calculator->set_amount( $this->get_amount() );
+ $this->flat_calculator->set_quantity( $this->get_quantity() );
+ $this->flat_calculator->calculate();
+
+ $this->per_item_admin_commission += $this->flat_calculator->get_per_item_admin_commission();
+ $this->admin_commission += $this->flat_calculator->get_admin_commission();
+ }
+
+ if ( $this->percentage_calculator->is_applicable() ) {
+ $this->percentage_calculator->set_amount( $this->get_amount() );
+ $this->percentage_calculator->set_quantity( $this->get_quantity() );
+ $this->percentage_calculator->calculate();
+
+ $this->per_item_admin_commission += $this->percentage_calculator->get_per_item_admin_commission();
+ $this->admin_commission += $this->percentage_calculator->get_admin_commission();
+ }
+
+ if ( $this->get_per_item_admin_commission() > $this->get_amount() ) {
+ $this->per_item_admin_commission = $this->get_amount();
+ }
+
+ if ( $this->get_admin_commission() > $this->get_amount() ) {
+ $this->admin_commission = $this->get_amount();
+ }
+
+ $this->vendor_earning = $this->get_amount() - $this->get_admin_commission();
+ $this->items_total_quantity = $this->get_quantity();
+ }
+
+ /**
+ * Get commission date parameters.
+ *
+ * @since 3.14.0
+ *
+ * @return array
+ */
+ public function get_parameters(): array {
+ return [
+ 'flat' => $this->get_settings()->get_flat(),
+ 'percentage' => $this->get_settings()->get_percentage(),
+ 'meta_data' => $this->get_settings()->get_meta_data(),
+ ];
+ }
+
+ /**
+ * Returns commission source.
+ *
+ * @since 3.14.0
+ *
+ * @return string
+ */
+ public function get_source(): string {
+ return self::SOURCE;
+ }
+
+ /**
+ * Returns if a fixed commission is applicable or not.
+ *
+ * @since 3.14.0
+ *
+ * @return bool
+ */
+ public function is_applicable(): bool {
+ return $this->is_valid_commission_type() && $this->is_valid_commission_data();
+ }
+
+ /**
+ * Returns true if commission type is valid.
+ *
+ * @since 3.14.0
+ *
+ * @return bool
+ */
+ protected function is_valid_commission_type(): bool {
+ $legacy_types = dokan()->commission->get_legacy_commission_types();
+
+ $all_types = array_keys( $legacy_types );
+
+ return in_array( $this->get_settings()->get_type(), $all_types, true ) || $this->get_settings()->get_type() === self::SOURCE;
+ }
+
+ /**
+ * Returns if saved commission data is valid to be applied.
+ *
+ * @since 3.14.0
+ *
+ * @return bool
+ */
+ protected function is_valid_commission_data(): bool {
+ return is_numeric( $this->get_settings()->get_flat() ) || is_numeric( $this->get_settings()->get_percentage() );
+ }
+
+ /**
+ * Returns admin commission amount.
+ *
+ * @since 3.14.0
+ *
+ * @return float
+ */
+ public function get_admin_commission(): float {
+ return dokan()->commission->validate_rate( $this->admin_commission );
+ }
+
+ /**
+ * Returns vendor earning amount.
+ *
+ * @since 3.14.0
+ *
+ * @return float
+ */
+ public function get_vendor_earning(): float {
+ return dokan()->commission->validate_rate( $this->vendor_earning );
+ }
+
+ /**
+ * Returns per item admin commission amount.
+ *
+ * @since 3.14.0
+ *
+ * @return float
+ */
+ public function get_per_item_admin_commission(): float {
+ return dokan()->commission->validate_rate( $this->per_item_admin_commission );
+ }
+
+ /**
+ * Returns the quantity on which the commission has been calculated.
+ *
+ * @since 3.14.0
+ *
+ * @return int
+ */
+ public function get_items_total_quantity(): int {
+ return $this->items_total_quantity;
+ }
+}
diff --git a/includes/Commission/Formula/Flat.php b/includes/Commission/Formula/Flat.php
new file mode 100644
index 0000000000..0e8f4cb47f
--- /dev/null
+++ b/includes/Commission/Formula/Flat.php
@@ -0,0 +1,184 @@
+set_settings( $settings );
+ }
+
+ /**
+ * Calculating the flat commission.
+ *
+ * @since 3.14.0
+ *
+ * @return void
+ */
+ public function calculate() {
+ $this->set_quantity( max( $this->get_quantity(), 1 ) );
+
+ if ( $this->is_applicable() ) {
+ $this->per_item_admin_commission = dokan()->commission->validate_rate( $this->get_settings()->get_flat() );
+ }
+
+ if ( $this->per_item_admin_commission > $this->get_amount() ) {
+ $this->per_item_admin_commission = $this->get_amount();
+ }
+
+ $this->flat_commission = $this->per_item_admin_commission;
+ if ( (int) $this->get_quantity() > 1 ) {
+ $this->flat_commission = $this->per_item_admin_commission * apply_filters( 'dokan_commission_multiply_by_order_quantity', $this->get_quantity() );
+ }
+
+ $this->admin_commission = $this->flat_commission;
+
+ if ( $this->admin_commission > $this->get_amount() ) {
+ $this->admin_commission = $this->get_amount();
+ }
+
+ $this->vendor_earning = $this->get_amount() - $this->admin_commission;
+ $this->items_total_quantity = $this->get_quantity();
+ }
+
+ /**
+ * Get commission date parameters.
+ *
+ * @since 3.14.0
+ *
+ * @return array
+ */
+ public function get_parameters(): array {
+ return [
+ 'flat' => $this->get_settings()->get_flat(),
+ 'meta_data' => $this->get_settings()->get_meta_data(),
+ ];
+ }
+
+ /**
+ * Returns commission source.
+ *
+ * @since 3.14.0
+ *
+ * @return string
+ */
+ public function get_source(): string {
+ return self::SOURCE;
+ }
+
+ /**
+ * Returns if a flat commission is applicable or not.
+ *
+ * @since 3.14.0
+ *
+ * @return bool
+ */
+ public function is_applicable(): bool {
+ return is_numeric( $this->get_settings()->get_flat() );
+ }
+
+ /**
+ * Returns admin commission amount.
+ *
+ * @since 3.14.0
+ *
+ * @return float
+ */
+ public function get_admin_commission(): float {
+ return $this->admin_commission;
+ }
+
+ /**
+ * Returns vendor earning amount.
+ *
+ * @since 3.14.0
+ *
+ * @return float
+ */
+ public function get_vendor_earning(): float {
+ return $this->vendor_earning;
+ }
+
+ /**
+ * Returns per item admin commission amount.
+ *
+ * @since 3.14.0
+ *
+ * @return float
+ */
+ public function get_per_item_admin_commission(): float {
+ return dokan()->commission->validate_rate( $this->per_item_admin_commission );
+ }
+
+ /**
+ * Returns the quantity on which the commission has been calculated.
+ *
+ * @since 3.14.0
+ *
+ * @return int
+ */
+ public function get_items_total_quantity(): int {
+ return $this->items_total_quantity;
+ }
+}
diff --git a/includes/Commission/Formula/Percentage.php b/includes/Commission/Formula/Percentage.php
new file mode 100644
index 0000000000..1c99d57528
--- /dev/null
+++ b/includes/Commission/Formula/Percentage.php
@@ -0,0 +1,159 @@
+set_settings( $settings );
+ }
+
+ /**
+ * Class constructor.
+ *
+ * @since 3.14.0
+ *
+ * @return void
+ */
+ public function calculate() {
+ if ( $this->is_applicable() ) {
+ $this->admin_commission = ( $this->get_amount() * dokan()->commission->validate_rate( $this->get_settings()->get_percentage() ) ) / 100;
+ }
+
+ $this->per_item_admin_commission = $this->admin_commission / $this->get_quantity();
+ $this->vendor_earning = $this->get_amount() - $this->admin_commission;
+
+ // Admin will get 100 percent if commission rate > 100
+ if ( $this->get_settings()->get_percentage() > 100 ) {
+ $this->admin_commission = $this->get_amount();
+ $this->vendor_earning = 0;
+ }
+
+ $this->items_total_quantity = $this->get_quantity();
+ }
+
+ /**
+ * Get commission date parameters.
+ *
+ * @since 3.14.0
+ *
+ * @return array
+ */
+ public function get_parameters(): array {
+ return [
+ 'percentage' => $this->get_settings()->get_percentage(),
+ 'meta_data' => $this->get_settings()->get_meta_data(),
+ ];
+ }
+
+ /**
+ * Returns commission source.
+ *
+ * @since 3.14.0
+ *
+ * @return string
+ */
+ public function get_source(): string {
+ return self::SOURCE;
+ }
+
+ /**
+ * Returns if a percentage commission is applicable or not.
+ *
+ * @since 3.14.0
+ *
+ * @return bool
+ */
+ public function is_applicable(): bool {
+ return is_numeric( $this->get_settings()->get_percentage() );
+ }
+
+ /**
+ * Returns admin commission amount.
+ *
+ * @since 3.14.0
+ *
+ * @return float
+ */
+ public function get_admin_commission(): float {
+ return dokan()->commission->validate_rate( $this->admin_commission );
+ }
+
+ /**
+ * Returns vendor earning amount.
+ *
+ * @since 3.14.0
+ *
+ * @return float
+ */
+ public function get_vendor_earning(): float {
+ return dokan()->commission->validate_rate( $this->vendor_earning );
+ }
+
+ /**
+ * Returns per item admin commission amount.
+ *
+ * @since 3.14.0
+ *
+ * @return float
+ */
+ public function get_per_item_admin_commission(): float {
+ return dokan()->commission->validate_rate( $this->per_item_admin_commission ) ?? 0;
+ }
+
+ /**
+ * Returns the quantity on which the commission has been calculated.
+ *
+ * @since 3.14.0
+ *
+ * @return int
+ */
+ public function get_items_total_quantity(): int {
+ return $this->items_total_quantity;
+ }
+}
diff --git a/includes/Commission/FormulaFactory.php b/includes/Commission/FormulaFactory.php
new file mode 100644
index 0000000000..a8d30deb06
--- /dev/null
+++ b/includes/Commission/FormulaFactory.php
@@ -0,0 +1,48 @@
+get_type() ) {
+ case Flat::SOURCE:
+ // In Dokan before 3.14.0 version if the commission type was flat the flat value used to be saved in the percentage key, that is why we are passing the percentage value.
+ return new Flat( $settings );
+ case Percentage::SOURCE:
+ return new Percentage( $settings );
+ case Combine::SOURCE: // Assuming 'combine' implies a combination of flat + percentage
+ return new Combine( $settings );
+ case Fixed::SOURCE:
+ return new Fixed( $settings );
+ case CategoryBased::SOURCE:
+ return new CategoryBased( $settings );
+ default:
+ $default_setting = new DefaultSetting();
+ return new Percentage( $default_setting->get() );
+ }
+ }
+}
diff --git a/includes/Commission/Model/Commission.php b/includes/Commission/Model/Commission.php
new file mode 100644
index 0000000000..4a0eccf3e6
--- /dev/null
+++ b/includes/Commission/Model/Commission.php
@@ -0,0 +1,308 @@
+source;
+ }
+
+ /**
+ * Sets commission source.
+ *
+ * @since 3.14.0
+ *
+ * @param string $source
+ *
+ * @return Commission
+ */
+ public function set_source( string $source ): Commission {
+ $this->source = $source;
+
+ return $this;
+ }
+
+ /**
+ * Returns per item admin commission.
+ *
+ * @since 3.14.0
+ *
+ * @return int|float
+ */
+ public function get_per_item_admin_commission() {
+ return $this->per_item_admin_commission;
+ }
+
+ /**
+ * Sets per item admin commission.
+ *
+ * @since 3.14.0
+ *
+ * @param int|float $per_item_admin_commission
+ *
+ * @return Commission
+ */
+ public function set_per_item_admin_commission( $per_item_admin_commission ): Commission {
+ $this->per_item_admin_commission = $per_item_admin_commission;
+
+ return $this;
+ }
+
+ /**
+ * Returns the admin commission amount.
+ *
+ * @since 3.14.0
+ *
+ * @return int|float
+ */
+ public function get_admin_commission() {
+ return $this->admin_commission;
+ }
+
+ /**
+ * Sets admin commission amount.
+ *
+ * @since 3.14.0
+ *
+ * @param $admin_commission
+ *
+ * @return Commission
+ */
+ public function set_admin_commission( $admin_commission ): Commission {
+ $this->admin_commission = $admin_commission;
+
+ return $this;
+ }
+
+ /**
+ * Returns vendor earning.
+ *
+ * @since 3.14.0
+ *
+ * @return int|float
+ */
+ public function get_vendor_earning() {
+ return $this->vendor_earning;
+ }
+
+ /**
+ * Sets vendor earning..
+ *
+ * @since 3.14.0
+ *
+ * @param int|float $vendor_earning
+ *
+ * @return Commission
+ */
+ public function set_vendor_earning( $vendor_earning ): Commission {
+ $this->vendor_earning = $vendor_earning;
+
+ return $this;
+ }
+
+ /**
+ * Returns the quantity on which the commission will be calculated.
+ *
+ * @since 3.14.0
+ *
+ * @return int
+ */
+ public function get_total_quantity(): int {
+ return $this->total_quantity;
+ }
+
+ /**
+ * Sets the total quantity on which the commission will be calculated.
+ *
+ * @since 3.14.0
+ *
+ * @param int $total_quantity
+ *
+ * @return Commission
+ */
+ public function set_total_quantity( int $total_quantity ): Commission {
+ $this->total_quantity = $total_quantity;
+
+ return $this;
+ }
+
+ /**
+ * Returns the total amount on which the commission will be calculated.
+ *
+ * @since 3.14.0
+ *
+ * @return int
+ */
+ public function get_total_amount() {
+ return $this->total_amount;
+ }
+
+ /**
+ * Sets the total amount on which the commission will be calculated.
+ *
+ * @since 3.14.0
+ *
+ * @param int|float $total_amount
+ *
+ * @return Commission
+ */
+ public function set_total_amount( $total_amount ): Commission {
+ $this->total_amount = $total_amount;
+
+ return $this;
+ }
+
+ /**
+ * Returns the commission type.
+ *
+ * @since 3.14.0
+ *
+ * @return string
+ */
+ public function get_type(): string {
+ return $this->type;
+ }
+
+ /**
+ * Sets the commission type
+ *
+ * @param string $type
+ *
+ * @return Commission
+ */
+ public function set_type( string $type ): Commission {
+ $this->type = $type;
+
+ return $this;
+ }
+
+ /**
+ * Returns applied commission parameters.
+ *
+ * @since 3.14.0
+ *
+ * @return array
+ */
+ public function get_parameters(): array {
+ return $this->parameters;
+ }
+
+ /**
+ * Sets commission parameters.
+ *
+ * @since 3.14.0
+ *
+ * @param array $parameters
+ *
+ * @return Commission
+ */
+ public function set_parameters( array $parameters ): Commission {
+ $this->parameters = $parameters;
+
+ return $this;
+ }
+
+ /**
+ * Returns commission data as array.
+ *
+ * @since 3.14.0
+ *
+ * @return array
+ */
+ public function get_data(): array {
+ return [
+ 'source' => $this->get_source(),
+ 'per_item_admin_commission' => $this->get_per_item_admin_commission(),
+ 'admin_commission' => $this->get_admin_commission(),
+ 'vendor_earning' => $this->get_vendor_earning(),
+ 'total_quantity' => $this->get_total_quantity(),
+ 'total_amount' => $this->get_total_amount(),
+ 'type' => $this->get_type(),
+ 'parameters' => $this->get_parameters(),
+ ];
+ }
+}
diff --git a/includes/Commission/Model/Setting.php b/includes/Commission/Model/Setting.php
new file mode 100644
index 0000000000..85ac7217c8
--- /dev/null
+++ b/includes/Commission/Model/Setting.php
@@ -0,0 +1,217 @@
+meta_data;
+ }
+
+ /**
+ * Sets the commission meta data.
+ *
+ * @since 3.14.0
+ *
+ * @param array $meta_data
+ *
+ * @return $this
+ */
+ public function set_meta_data( array $meta_data ): Setting {
+ $this->meta_data = $meta_data;
+
+ return $this;
+ }
+
+ /**
+ * Sets the commission type.
+ *
+ * @since 3.14.0
+ *
+ * @param mixed|string $type
+ *
+ * @return $this
+ */
+ public function set_type( $type ): Setting {
+ $this->type = $type;
+
+ return $this;
+ }
+
+ /**
+ * Sets the flat commissin amount.
+ *
+ * @since 3.14.0
+ *
+ * @param mixed|string $flat
+ *
+ * @return $this
+ */
+ public function set_flat( $flat ): Setting {
+ $this->flat = $flat;
+
+ return $this;
+ }
+
+ /**
+ * Sets the percentage amount.
+ *
+ * @since 3.14.0
+ *
+ * @param mixed|string $percentage
+ *
+ * @return $this
+ */
+ public function set_percentage( $percentage ): Setting {
+ $this->percentage = $percentage;
+
+ return $this;
+ }
+
+ /**
+ * Sets the category id.
+ *
+ * @since 3.14.0
+ *
+ * @param mixed|string $category_id
+ *
+ * @return $this
+ */
+ public function set_category_id( $category_id ): Setting {
+ $this->category_id = $category_id;
+
+ return $this;
+ }
+
+ /**
+ * Sets the category commission data.
+ *
+ * @since 3.14.0.
+ *
+ * @param array|mixed $category_commissions
+ *
+ * @return $this
+ */
+ public function set_category_commissions( $category_commissions ): Setting {
+ $this->category_commissions = $category_commissions;
+
+ return $this;
+ }
+
+ /**
+ * Sets the commission type.
+ *
+ * @since 3.14.0
+ *
+ * @return mixed|string|null
+ */
+ public function get_type() {
+ return $this->type;
+ }
+
+ /**
+ * Returns the flat amount.
+ *
+ * @since 3.14.0
+ *
+ * @return mixed|string
+ */
+ public function get_flat() {
+ return $this->flat;
+ }
+
+ /**
+ * Returns the percentage amount.
+ *
+ * @since 3.14.0
+ *
+ * @return mixed|string
+ */
+ public function get_percentage() {
+ return $this->percentage;
+ }
+
+ /**
+ * Returns the category commission data.
+ *
+ * @since 3.14.0
+ *
+ * @return array|mixed|null
+ */
+ public function get_category_commissions() {
+ return $this->category_commissions;
+ }
+
+ /**
+ * Returns the category id
+ *
+ * @since 3.14.0
+ *
+ * @return array|mixed|null
+ */
+ public function get_category_id() {
+ return $this->category_id;
+ }
+}
diff --git a/includes/Commission/Settings/Builder.php b/includes/Commission/Settings/Builder.php
new file mode 100644
index 0000000000..4e18270106
--- /dev/null
+++ b/includes/Commission/Settings/Builder.php
@@ -0,0 +1,41 @@
+set_type( self::TYPE );
+
+ return $setting;
+ }
+
+ /**
+ * Saves and returns default setting
+ *
+ * @since 3.14.0
+ *
+ * @param array $setting
+ *
+ * @return \WeDevs\Dokan\Commission\Model\Setting
+ */
+ public function save( array $setting ): Setting {
+ return $this->get();
+ }
+}
diff --git a/includes/Commission/Settings/GlobalSetting.php b/includes/Commission/Settings/GlobalSetting.php
new file mode 100644
index 0000000000..25dee085bf
--- /dev/null
+++ b/includes/Commission/Settings/GlobalSetting.php
@@ -0,0 +1,78 @@
+category_id = $category_id;
+ }
+
+ /**
+ * Returns product commission settings data.
+ *
+ * @since 3.14.0
+ *
+ * @return \WeDevs\Dokan\Commission\Model\Setting
+ */
+ public function get(): Setting {
+ $percentage = dokan_get_option( 'admin_percentage', 'dokan_selling', '' );
+ $type = dokan_get_option( 'commission_type', 'dokan_selling', '' );
+ $flat = dokan_get_option( 'additional_fee', 'dokan_selling', '' );
+ $category_commissions = dokan_get_option( 'commission_category_based_values', 'dokan_selling', [] );
+
+ $settings = new Setting();
+ $settings->set_type( $type )
+ ->set_flat( $flat )
+ ->set_percentage( $percentage )
+ ->set_category_commissions( $category_commissions )
+ ->set_category_id( $this->category_id );
+
+ return $settings;
+ }
+
+ /**
+ * Saves and returns product commission settings data.
+ *
+ * @since 3.14.0
+ *
+ * @param array $setting {
+ *
+ * @type string $percentage
+ * @type string $type
+ * @type string $flat
+ * @type array $category_commissions
+ * }
+ *
+ * @return \WeDevs\Dokan\Commission\Model\Setting
+ */
+ public function save( array $setting ): Setting {
+ $options = get_option( 'dokan_selling', [] );
+ $options['commission_type'] = isset( $setting['type'] ) ? $setting['type'] : '';
+ $options['admin_percentage'] = isset( $setting['percentage'] ) ? $setting['percentage'] : '';
+ $options['additional_fee'] = isset( $setting['flat'] ) ? $setting['flat'] : '';
+ $options['commission_category_based_values'] = isset( $setting['category_commissions'] ) ? $setting['category_commissions'] : [];
+
+ update_option( 'dokan_selling', $options );
+
+ return $this->get();
+ }
+}
diff --git a/includes/Commission/Settings/InterfaceSetting.php b/includes/Commission/Settings/InterfaceSetting.php
new file mode 100644
index 0000000000..2099066b22
--- /dev/null
+++ b/includes/Commission/Settings/InterfaceSetting.php
@@ -0,0 +1,33 @@
+order_item_id = $data['id'];
+ $this->product_price_to_calculate_commission = $data['price'];
+ }
+
+ /**
+ * Rrturns order item commission settings.
+ *
+ * @since 3.14.0
+ *
+ * @throws \Exception
+ *
+ * @return \WeDevs\Dokan\Commission\Model\Setting
+ */
+ public function get(): Setting {
+ $commission_percentage = '';
+ $commission_type = '';
+ $additional_flat = '';
+ $commission_meta = [];
+
+ if ( ! empty( $this->order_item_id ) ) {
+ $commission_percentage = wc_get_order_item_meta( $this->order_item_id, '_dokan_commission_rate', true ) ?? '';
+ $commission_type = wc_get_order_item_meta( $this->order_item_id, '_dokan_commission_type', true ) ?? '';
+ $additional_flat = wc_get_order_item_meta( $this->order_item_id, '_dokan_additional_fee', true ) ?? '';
+ $commission_meta = wc_get_order_item_meta( $this->order_item_id, 'dokan_commission_meta', true );
+
+ $commission_meta = empty( $commission_meta ) ? [] : $commission_meta;
+ }
+
+ /**
+ * If `_dokan_item_total` returns `non-falsy` value that means, the request comes from the `order refund request`.
+ * So modify `additional_fee` to the correct amount to get refunded. (additional_fee/item_total)*product_price.
+ * Where `product_price` means item_total - refunded_total_for_item.
+ *
+ * To understand clearly, how and when these codes work and how dokan commission works, you can also go through dokan-lite previous codes as provided below.
+ *
+ * @see https://github.com/getdokan/dokan/blob/28888e6824d96747ed65004fbd6de80d0eee5161/includes/Commission.php#L629
+ * @see https://github.com/getdokan/dokan/blob/28888e6824d96747ed65004fbd6de80d0eee5161/includes/Commission.php#L567-L653
+ * @see https://github.com/getdokan/dokan/blob/28888e6824d96747ed65004fbd6de80d0eee5161/includes/Commission.php
+ */
+ $order_id = wc_get_order_id_by_order_item_id( $this->order_item_id );
+
+ if ( $order_id && OrderUtil::is_hpos_enabled() ) {
+ $order = dokan()->order->get( $order_id );
+ $item_total = $order->get_meta( '_dokan_item_total' );
+ } else {
+ $item_total = get_post_meta( $order_id, '_dokan_item_total', true );
+ }
+
+ $product_price = (float) wc_format_decimal( $this->product_price_to_calculate_commission );
+ if ( $order_id && $item_total ) {
+ $additional_flat = ( $additional_flat / $item_total ) * $product_price;
+ }
+
+ $settings = new Setting();
+ $settings->set_type( $commission_type )
+ ->set_flat( $additional_flat )
+ ->set_percentage( $commission_percentage )
+ ->set_meta_data( $commission_meta );
+
+ if ( $commission_type === CategoryBased::SOURCE && isset( $commission_meta['parameters']['category_id'] ) ) {
+ $settings->set_category_id( $commission_meta['parameters']['category_id'] );
+ $settings->set_category_commissions(
+ [
+ 'all' => [],
+ 'items' => [
+ $settings->get_category_id() => [
+ 'flat' => $settings->get_flat(),
+ 'percentage' => $settings->get_percentage(),
+ ],
+ ],
+ ]
+ );
+ } else {
+ $settings->set_category_commissions(
+ [
+ 'all' => [
+ 'flat' => $settings->get_flat(),
+ 'percentage' => $settings->get_percentage(),
+ ],
+ 'items' => [],
+ ]
+ );
+ }
+
+ return $settings;
+ }
+
+ /**
+ * Saves order item commission settings.
+ *
+ * @since 3.14.0
+ *
+ * @param array $setting
+ *
+ * @throws \Exception
+ *
+ * @return \WeDevs\Dokan\Commission\Model\Setting
+ */
+ public function save( array $setting ): Setting {
+ $percentage = isset( $setting['percentage'] ) ? $setting['percentage'] : '';
+ $type = isset( $setting['type'] ) ? $setting['type'] : '';
+ $flat = isset( $setting['flat'] ) ? $setting['flat'] : '';
+ $meta_data = isset( $setting['meta_data'] ) ? $setting['meta_data'] : [];
+
+ wc_add_order_item_meta( $this->order_item_id, '_dokan_commission_type', $type );
+ wc_add_order_item_meta( $this->order_item_id, '_dokan_commission_rate', $percentage );
+ wc_add_order_item_meta( $this->order_item_id, '_dokan_additional_fee', $flat );
+ wc_add_order_item_meta( $this->order_item_id, 'dokan_commission_meta', $meta_data );
+
+ return $this->get();
+ }
+}
diff --git a/includes/Commission/Settings/Product.php b/includes/Commission/Settings/Product.php
new file mode 100644
index 0000000000..b389991e97
--- /dev/null
+++ b/includes/Commission/Settings/Product.php
@@ -0,0 +1,89 @@
+product = dokan()->product->get( $product_id );
+
+ if ( $this->product && $this->product->is_type( 'variation' ) ) {
+ $this->product = dokan()->product->get( $this->product->get_parent_id() );
+ }
+ }
+
+
+ /**
+ * Returns product commission settings data.
+ *
+ * @since 3.14.0
+ *
+ * @return \WeDevs\Dokan\Commission\Model\Setting
+ */
+ public function get(): Setting {
+ $percentage = '';
+ $type = '';
+ $flat = '';
+
+ if ( is_a( $this->product, WC_Product::class ) && $this->product->get_id() ) {
+ $percentage = $this->product->get_meta( '_per_product_admin_commission', true );
+ $type = $this->product->get_meta( '_per_product_admin_commission_type', true );
+ $flat = $this->product->get_meta( '_per_product_admin_additional_fee', true );
+ }
+
+ $settings = new Setting();
+ $settings->set_type( $type )
+ ->set_flat( $flat )
+ ->set_percentage( $percentage );
+
+ return $settings;
+ }
+
+ /**
+ * Saves and returns product commission settings data.
+ *
+ * @since 3.14.0
+ *
+ * @param array $setting {
+ *
+ * @type string $percentage
+ * @type string $type
+ * @type string $flat
+ * }
+ *
+ * @return \WeDevs\Dokan\Commission\Model\Setting
+ */
+ public function save( array $setting ): Setting {
+ $commission_percentage = isset( $setting['percentage'] ) ? $setting['percentage'] : '';
+ $commission_type = isset( $setting['type'] ) ? $setting['type'] : '';
+ $additional_flat = isset( $setting['flat'] ) ? $setting['flat'] : '';
+
+ if ( is_a( $this->product, WC_Product::class ) && $this->product->get_id() ) {
+ $this->product->update_meta_data( '_per_product_admin_commission', $commission_percentage );
+ $this->product->update_meta_data( '_per_product_admin_commission_type', $commission_type );
+ $this->product->update_meta_data( '_per_product_admin_additional_fee', $additional_flat );
+
+ $this->product->save_meta_data();
+ $this->product->save();
+ }
+
+ $commission = new Setting();
+ $commission->set_type( $commission_type )
+ ->set_flat( $additional_flat )
+ ->set_percentage( $commission_percentage );
+
+ return $commission;
+ }
+}
diff --git a/includes/Commission/Settings/Vendor.php b/includes/Commission/Settings/Vendor.php
new file mode 100644
index 0000000000..de0b2b0561
--- /dev/null
+++ b/includes/Commission/Settings/Vendor.php
@@ -0,0 +1,97 @@
+vendor = dokan()->vendor->get( $vendor_id );
+ }
+
+
+ /**
+ * Returns product commission settings data.
+ *
+ * @since 3.14.0
+ *
+ * @return \WeDevs\Dokan\Commission\Model\Setting
+ */
+ public function get(): Setting {
+ $percentage = '';
+ $type = '';
+ $flat = '';
+ $category_commissions = [];
+
+ if ( 0 !== $this->vendor->get_id() ) {
+ $percentage = $this->vendor->get_meta( 'dokan_admin_percentage', true );
+ $type = $this->vendor->get_meta( 'dokan_admin_percentage_type', true );
+ $flat = $this->vendor->get_meta( 'dokan_admin_additional_fee', true );
+ $category_commissions = $this->vendor->get_meta( 'admin_category_commission', true );
+
+ $category_commissions = ! is_array( $category_commissions ) ? [] : $category_commissions;
+ }
+
+ $settings = new Setting();
+ $settings->set_type( $type )
+ ->set_flat( $flat )
+ ->set_percentage( $percentage )
+ ->set_category_commissions( $category_commissions );
+
+ return $settings;
+ }
+
+ /**
+ * Saves and returns product commission settings data.
+ *
+ * @since 3.14.0
+ *
+ * @param array $setting {
+ *
+ * @type string $percentage
+ * @type string $type
+ * @type string $flat
+ * @type array $category_commissions
+ * }
+ *
+ * @return \WeDevs\Dokan\Commission\Model\Setting
+ */
+ public function save( array $setting ): Setting {
+ if ( ! $this->vendor->get_id() ) {
+ return $this->get();
+ }
+
+ $percentage = isset( $setting['percentage'] ) ? $setting['percentage'] : '';
+ $type = isset( $setting['type'] ) ? $setting['type'] : '';
+ $flat = isset( $setting['flat'] ) ? $setting['flat'] : '';
+ $category_commissions = isset( $setting['category_commissions'] ) ? $setting['category_commissions'] : [];
+
+ $this->vendor->update_meta( 'dokan_admin_percentage', $percentage );
+ $this->vendor->update_meta( 'dokan_admin_percentage_type', $type );
+ $this->vendor->update_meta( 'dokan_admin_additional_fee', $flat );
+ $this->vendor->update_meta( 'admin_category_commission', $category_commissions );
+
+ return $this->get();
+ }
+
+ public function delete() {
+ if ( ! $this->vendor->get_id() ) {
+ return $this->get();
+ }
+
+ delete_user_meta( $this->vendor->get_id(), 'dokan_admin_percentage' );
+ delete_user_meta( $this->vendor->get_id(), 'dokan_admin_percentage_type' );
+ delete_user_meta( $this->vendor->get_id(), 'dokan_admin_additional_fee' );
+ delete_user_meta( $this->vendor->get_id(), 'admin_category_commission' );
+ }
+}
diff --git a/includes/Commission/Strategies/AbstractStrategy.php b/includes/Commission/Strategies/AbstractStrategy.php
new file mode 100644
index 0000000000..60c9c63c56
--- /dev/null
+++ b/includes/Commission/Strategies/AbstractStrategy.php
@@ -0,0 +1,41 @@
+get_settings();
+
+ return FormulaFactory::get_formula( $settings );
+ }
+}
diff --git a/includes/Commission/Strategies/DefaultStrategy.php b/includes/Commission/Strategies/DefaultStrategy.php
new file mode 100644
index 0000000000..3e3cc4125b
--- /dev/null
+++ b/includes/Commission/Strategies/DefaultStrategy.php
@@ -0,0 +1,50 @@
+get();
+
+ $setting->set_type( DefaultSetting::TYPE )
+ ->set_flat( 0 )
+ ->set_percentage( 0 )
+ ->set_category_commissions( [] );
+
+ return $setting;
+ }
+}
diff --git a/includes/Commission/Strategies/GlobalStrategy.php b/includes/Commission/Strategies/GlobalStrategy.php
new file mode 100644
index 0000000000..c0f4807332
--- /dev/null
+++ b/includes/Commission/Strategies/GlobalStrategy.php
@@ -0,0 +1,71 @@
+category_id = $category_id;
+ }
+
+ /**
+ * Returns category id.
+ *
+ * @since 3.14.0
+ *
+ * @return mixed
+ */
+ public function get_category_id() {
+ return $this->category_id;
+ }
+
+ /**
+ * Returns global strategy source.
+ *
+ * @since 3.14.0
+ *
+ * @return string
+ */
+ public function get_source(): string {
+ return self::SOURCE;
+ }
+
+ /**
+ * Returns global commission settings.
+ *
+ * @since 3.14.0
+ *
+ * @return \WeDevs\Dokan\Commission\Model\Setting
+ */
+ public function get_settings(): Setting {
+ $setting = Builder::build( Builder::TYPE_GLOBAL, $this->get_category_id() );
+
+ return $setting->get();
+ }
+}
diff --git a/includes/Commission/Strategies/OrderItem.php b/includes/Commission/Strategies/OrderItem.php
new file mode 100644
index 0000000000..5cc0e59562
--- /dev/null
+++ b/includes/Commission/Strategies/OrderItem.php
@@ -0,0 +1,125 @@
+order_item_id = $order_item_id;
+ $this->total_amount = $total_amount;
+ $this->total_quantity = $total_quantity;
+ }
+
+ /**
+ * Returns order item strategy source.
+ *
+ * @since 3.14.0
+ *
+ * @return string
+ */
+ public function get_source(): string {
+ return self::SOURCE;
+ }
+
+ /**
+ * Returns order item commission settings.
+ *
+ * @since 3.14.0
+ *
+ * @return \WeDevs\Dokan\Commission\Model\Setting
+ */
+ public function get_settings(): Setting {
+ $settings = Builder::build(
+ Builder::TYPE_ORDER_ITEM,
+ [
+ 'id' => $this->order_item_id,
+ 'price' => $this->total_amount,
+ ]
+ );
+
+ return $settings->get();
+ }
+
+ /**
+ * Save order item commission meta data.
+ *
+ * @since 3.14.0
+ *
+ * @param string $type
+ * @param int|float $percentage
+ * @param int|float $flat
+ * @param array $meta_data
+ *
+ * @return \WeDevs\Dokan\Commission\Model\Setting
+ */
+ public function save_line_item_commission_to_meta( $type, $percentage, $flat, $meta_data ) {
+ $settings = Builder::build(
+ Builder::TYPE_ORDER_ITEM,
+ [
+ 'id' => $this->order_item_id,
+ 'price' => $this->total_amount,
+ ]
+ );
+
+ return $settings->save(
+ [
+ 'type' => $type,
+ 'percentage' => $percentage,
+ 'flat' => $flat,
+ 'meta_data' => $meta_data ,
+ ]
+ );
+ }
+}
diff --git a/includes/Commission/Strategies/Product.php b/includes/Commission/Strategies/Product.php
new file mode 100644
index 0000000000..0a143623d0
--- /dev/null
+++ b/includes/Commission/Strategies/Product.php
@@ -0,0 +1,60 @@
+product_id = $product_id;
+ }
+
+ /**
+ * Returns product strategy source.
+ *
+ * @since 3.14.0
+ *
+ * @return string
+ */
+ public function get_source(): string {
+ return self::SOURCE;
+ }
+
+ /**
+ * Returns product commission settings.
+ *
+ * @since 3.14.0
+ *
+ * @return \WeDevs\Dokan\Commission\Model\Setting
+ */
+ public function get_settings(): Setting {
+ $settings = Builder::build( Builder::TYPE_PRODUCT, $this->product_id );
+
+ return $settings->get();
+ }
+}
diff --git a/includes/Commission/Strategies/Vendor.php b/includes/Commission/Strategies/Vendor.php
new file mode 100644
index 0000000000..59b7b91122
--- /dev/null
+++ b/includes/Commission/Strategies/Vendor.php
@@ -0,0 +1,86 @@
+vendor_id = $vendor_id;
+ $this->category_id = $category_id;
+ }
+
+ /**
+ * Returns category id.
+ *
+ * @since 3.14.0
+ *
+ * @return int
+ */
+ public function get_category_id() {
+ return $this->category_id;
+ }
+
+ /**
+ * Returns vendor commission source.
+ *
+ * @since 3.14.0
+ *
+ * @return string
+ */
+ public function get_source(): string {
+ return self::SOURCE;
+ }
+
+ /**
+ * Returns vendor commission settings.
+ *
+ * @since 3.14.0
+ *
+ * @return \WeDevs\Dokan\Commission\Model\Setting
+ */
+ public function get_settings(): Setting {
+ $settings = Builder::build( Builder::TYPE_VENDOR, $this->vendor_id );
+ $settings = $settings->get();
+ $settings->set_category_id( $this->get_category_id() );
+
+ return $settings;
+ }
+}
diff --git a/includes/Commission/Upugrader/Update_Category_Commission.php b/includes/Commission/Upugrader/Update_Category_Commission.php
new file mode 100644
index 0000000000..4a5affbcae
--- /dev/null
+++ b/includes/Commission/Upugrader/Update_Category_Commission.php
@@ -0,0 +1,222 @@
+queue()->add(
+ self::PROCESS_BATCH_HOOK_CREATOR,
+ [],
+ 'dokan_updater_category_processing_creator'
+ );
+ }
+
+ /**
+ * Batch queue creator.
+ *
+ * @since 3.14.0
+ *
+ * @return void
+ */
+ public function process_batch_creator() {
+ // Get total number of products
+ $total = $this->category_count();
+
+ if ( is_wp_error( $total ) || $total === 0 ) {
+ return;
+ }
+
+ $total = $total + 50;
+ $offset = 0;
+
+ do {
+ $this->schedule_next_batch( $offset );
+
+ // Calculate next offset
+ $offset = $offset + self::BATCH_SIZE;
+ } while ( $offset < $total );
+ }
+
+ /**
+ * Process a batch of categories
+ *
+ * @since DOKAN_PRO_SINCE
+ *
+ * @param int $page_number Current page number
+ *
+ * @return void
+ */
+ public function process_batch( $offset ) {
+ // Get categories for this batch
+ $categories = $this->get_categories_batch( $offset );
+
+ if ( ! empty( $categories ) && ! is_wp_error( $categories ) ) {
+ foreach ( $categories as $category ) {
+ $this->schedule_cat_item( $category->term_id );
+ }
+ }
+ }
+
+ /**
+ * Schedule the next batch of categories
+ *
+ * @since DOKAN_PRO_SINCE
+ *
+ * @param int $page_number Next page number to process
+ *
+ * @return void
+ */
+ protected function schedule_next_batch( $offset ) {
+ WC()->queue()->add(
+ self::PROCESS_BATCH_HOOK,
+ [ $offset ],
+ 'dokan_updater_category_processing'
+ );
+ }
+
+ /**
+ * Schedule a category item for processing.
+ *
+ * @since 3.14.0
+ *
+ * @param $term
+ *
+ * @return void
+ */
+ private function schedule_cat_item( $term ) {
+ WC()->queue()->add(
+ self::PROCESS_ITEM_HOOK,
+ [ $term ],
+ 'dokan_updater_category_item_processing'
+ );
+ }
+
+ /**
+ * Get a batch of categories.
+ *
+ * @since DOKAN_PRO_SINCE
+ *
+ * @param int $page_number Page number to fetch
+ *
+ * @return array Array of term objects
+ */
+ protected function get_categories_batch( $offset ) {
+ $args = [
+ 'taxonomy' => 'product_cat',
+ 'number' => self::BATCH_SIZE,
+ 'orderby' => 'name',
+ 'order' => 'ASC',
+ 'hide_empty' => false,
+ 'offset' => $offset,
+ ];
+
+ return get_terms( $args );
+ }
+
+ /**
+ * Get the total number of categories
+ *
+ * @since 3.14.0
+ *
+ * @return int[]|string|string[]|\WP_Error|\WP_Term[]
+ */
+ protected function category_count() {
+ return get_terms(
+ array(
+ 'taxonomy' => 'product_cat',
+ 'hide_empty' => false,
+ 'fields' => 'count',
+ )
+ );
+ }
+
+ /**
+ * Process a single category.
+ *
+ * @since DOKAN_PRO_SINCE
+ *
+ * @param int $term Category term object
+ *
+ * @return void
+ */
+ public function process_single_category( $term_id ) {
+ $dokan_selling = get_option( 'dokan_selling', [] );
+ $category_commission = dokan_get_option( 'commission_category_based_values', 'dokan_selling', [] );
+
+ $commission_type = get_term_meta( $term_id, 'per_category_admin_commission_type', true );
+ $admin_additional_fee = get_term_meta( $term_id, 'per_category_admin_additional_fee', true );
+ $commission = get_term_meta( $term_id, 'per_category_admin_commission', true );
+
+ if ( ! empty( $commission_type ) ) {
+ $category_commission_item = [
+ 'flat' => $admin_additional_fee,
+ 'percentage' => $commission,
+ ];
+
+ if ( Flat::SOURCE === $commission_type ) {
+ $category_commission_item['percentage'] = 0;
+ $category_commission_item['flat'] = $commission;
+ } elseif ( Percentage::SOURCE === $commission_type ) {
+ $category_commission_item['percentage'] = $commission;
+ $category_commission_item['flat'] = 0;
+ }
+
+ $category_commission['items'][ $term_id ] = $category_commission_item;
+ }
+
+ $dokan_selling['commission_category_based_values'] = $category_commission;
+ update_option( 'dokan_selling', $dokan_selling );
+ }
+
+ /**
+ * Check if processing is currently running.
+ *
+ * @since DOKAN_PRO_SINCE
+ *
+ * @return bool
+ */
+ public function is_processing() {
+ return WC()->queue()->get_next( self::PROCESS_BATCH_HOOK ) !== null;
+ }
+}
diff --git a/includes/Commission/Upugrader/Update_Product_Commission.php b/includes/Commission/Upugrader/Update_Product_Commission.php
new file mode 100644
index 0000000000..1a5c536398
--- /dev/null
+++ b/includes/Commission/Upugrader/Update_Product_Commission.php
@@ -0,0 +1,219 @@
+queue()->add(
+ self::PROCESS_BATCH_HOOK_CREATOR,
+ [],
+ 'dokan_updater_product_processing_creator'
+ );
+ }
+
+ /**
+ * Batch queue creator.
+ *
+ * @since 3.14.0
+ *
+ * @return void
+ */
+ public function process_batch_creator() {
+ // Get total number of products
+ $total_products = $this->get_total_products();
+ $total_products = $total_products + 50;
+
+ if ( $total_products === 0 ) {
+ return;
+ }
+
+ $offset = 0;
+
+ do {
+ $this->schedule_next_batch( $offset, $total_products );
+
+ // Calculate next offset
+ $offset = $offset + self::BATCH_SIZE;
+ } while ( $offset < $total_products );
+ }
+
+ /**
+ * Process a batch of products
+ *
+ * @since DOKAN_PRO_SINCE
+ *
+ * @param int $offset Current offset
+ * @param int $total_products Total number of products
+ *
+ * @return void
+ */
+ public function process_batch( $offset, $total_products ) {
+ // Get products for this batch
+ $products = $this->get_products_batch( $offset );
+
+ foreach ( $products as $product ) {
+ $this->schedule_item( $product->get_id() );
+ }
+ }
+
+ /**
+ * Schedule the next batch of products
+ *
+ * @since DOKAN_PRO_SINCE
+ *
+ * @param int $offset Current offset
+ * @param int $total_products Total number of products
+ *
+ * @return void
+ */
+ protected function schedule_next_batch( $offset, $total_products ) {
+ WC()->queue()->add(
+ self::PROCESS_BATCH_HOOK, [
+ $offset,
+ $total_products,
+ ],
+ 'dokan_updater_product_processing'
+ );
+ }
+
+ /**
+ * Schedule a single product for processing.
+ *
+ * @since 3.14.0
+ *
+ * @param $item
+ *
+ * @return void
+ */
+ private function schedule_item( $item ) {
+ WC()->queue()->add(
+ self::PROCESS_ITEM_HOOK,
+ [ $item ],
+ 'dokan_updater_product_item_processing'
+ );
+ }
+
+ /**
+ * Get a batch of products
+ *
+ * @since DOKAN_PRO_SINCE
+ *
+ * @param int $offset Current offset
+ *
+ * @return WC_Product[] Array of product objects
+ */
+ protected function get_products_batch( $offset ) {
+ $args = [
+ 'status' => 'publish',
+ 'limit' => self::BATCH_SIZE,
+ 'offset' => $offset,
+ 'orderby' => 'ID',
+ 'order' => 'ASC',
+ ];
+
+ return wc_get_products( $args );
+ }
+
+ /**
+ * Get total number of products
+ *
+ * @since DOKAN_PRO_SINCE
+ *
+ * @return int
+ */
+ protected function get_total_products() {
+ $args = [
+ 'status' => 'any',
+ 'limit' => -1,
+ 'return' => 'ids',
+ ];
+
+ $products = wc_get_products( $args );
+
+ return count( $products );
+ }
+
+ /**
+ * Process a single product
+ * Customize this method based on what you need to do with each product
+ *
+ * @since DOKAN_PRO_SINCE
+ *
+ * @param int $product
+ *
+ * @return void
+ */
+ public function process_single_product( $product_id ) {
+ $commission = dokan()->product->get_commission_settings( $product_id );
+
+ $commission_type_old = $commission->get_type();
+ $commission->set_type( Fixed::SOURCE );
+
+ if ( Flat::SOURCE === $commission_type_old ) {
+ $commission->set_flat( $commission->get_percentage() );
+ $commission->set_percentage( 0 );
+ } elseif ( Percentage::SOURCE === $commission_type_old ) {
+ $commission->set_flat( 0 );
+ }
+
+ dokan()->product->save_commission_settings(
+ $product_id,
+ [
+ 'type' => $commission->get_type(),
+ 'percentage' => $commission->get_percentage(),
+ 'flat' => $commission->get_flat(),
+ ]
+ );
+ }
+
+ /**
+ * Check if processing is currently running
+ *
+ * @since DOKAN_PRO_SINCE
+ *
+ * @return bool
+ */
+ public function is_processing() {
+ return WC()->queue()->get_next( self::PROCESS_BATCH_HOOK ) !== null;
+ }
+}
diff --git a/includes/Commission/Upugrader/Update_Vendor_Commission.php b/includes/Commission/Upugrader/Update_Vendor_Commission.php
new file mode 100644
index 0000000000..7e4bde2cc6
--- /dev/null
+++ b/includes/Commission/Upugrader/Update_Vendor_Commission.php
@@ -0,0 +1,203 @@
+queue()->add(
+ self::PROCESS_BATCH_HOOK_CREATOR,
+ [],
+ 'dokan_updater_vendor_processing_creator'
+ );
+ }
+
+ /**
+ * Batch queue creator.
+ *
+ * @since 3.14.0
+ *
+ * @return void
+ */
+ public function process_batch_creator() {
+ $counts = dokan_get_seller_status_count();
+ $total_items = $counts['total'];
+ $max_pages = ceil( $total_items / self::BATCH_SIZE );
+ $max_pages = $max_pages + 5;
+
+ for ( $page = 1; $page <= $max_pages; $page++ ) {
+ // Schedule the current page for batch processing
+ WC()->queue()->add(
+ self::PROCESS_BATCH_HOOK,
+ [ $page, $max_pages ],
+ 'dokan_updater_vendor_processing'
+ );
+ }
+ }
+
+ /**
+ * Process a batch of vendors
+ *
+ * @since DOKAN_PRO_SINCE
+ *
+ * @param int $page_number Current page number
+ * @param int $max_pages Total number of pages
+ *
+ * @return void
+ */
+ public function process_batch( $page_number, $max_pages ) { // phpcs:ignore
+ $vendors = $this->get_vendors_batch( $page_number );
+
+ if ( ! empty( $vendors ) ) {
+ foreach ( $vendors as $vendor ) {
+ $this->schedule_item( $vendor->get_id() );
+ }
+ }
+ }
+
+ /**
+ * Get a batch of vendors
+ *
+ * @since DOKAN_PRO_SINCE
+ *
+ * @param int $page_number Page number to fetch
+ *
+ * @return \WeDevs\Dokan\Vendor\Vendor[] Array of vendor objects
+ */
+ protected function get_vendors_batch( $page_number ) {
+ return dokan()->vendor->all(
+ [
+ 'paged' => $page_number,
+ 'number' => self::BATCH_SIZE,
+ ]
+ );
+ }
+
+ /**
+ * Schedule an individual vendor for processing
+ *
+ * @since DOKAN_PRO_SINCE
+ *
+ * @param int $vendor_id
+ *
+ * @return void
+ */
+ private function schedule_item( $vendor_id ) {
+ WC()->queue()->add(
+ self::PROCESS_ITEM_HOOK,
+ [ $vendor_id ],
+ 'dokan_updater_vendor_item_processing'
+ );
+ }
+
+ /**
+ * Process a single vendor
+ *
+ * @since DOKAN_PRO_SINCE
+ *
+ * @param int $vendor_id Vendor ID
+ *
+ * @return void
+ */
+ public function process_single_vendor( $vendor_id ) {
+ try {
+ $vendor = dokan()->vendor->get( $vendor_id );
+ $commission = $vendor->get_commission_settings();
+
+ $commission_type_old = $commission->get_type();
+ $commission->set_type( Fixed::SOURCE );
+
+ $percentage = $commission->get_percentage();
+
+ if ( Flat::SOURCE === $commission_type_old ) {
+ $commission->set_percentage( 0 );
+ $commission->set_flat( $percentage );
+ } elseif ( Percentage::SOURCE === $commission_type_old ) {
+ $commission->set_percentage( $percentage );
+ $commission->set_flat( 0 );
+ }
+
+ $vendor->save_commission_settings(
+ [
+ 'type' => $commission->get_type(),
+ 'flat' => $commission->get_flat(),
+ 'percentage' => $commission->get_percentage(),
+ 'category_commissions' => $commission->get_category_commissions(),
+ ]
+ );
+
+ // Log success
+ $this->log_vendor_update( $vendor_id, true );
+ } catch ( \Exception $e ) {
+ // Log error
+ $this->log_vendor_update( $vendor_id, false, $e->getMessage() );
+ }
+ }
+
+ /**
+ * Log vendor update status
+ *
+ * @since DOKAN_PRO_SINCE
+ *
+ * @param int $vendor_id
+ * @param bool $success
+ * @param string $error_message
+ *
+ * @return void
+ */
+ private function log_vendor_update( $vendor_id, $success, $error_message = '' ) {
+ $log_key = 'dokan_commission_upgrade_vendor_' . $vendor_id;
+ update_option(
+ $log_key, [
+ 'status' => $success ? 'success' : 'error',
+ 'error_message' => $error_message,
+ 'timestamp' => current_time( 'mysql' ),
+ ]
+ );
+ }
+
+ /**
+ * Check if processing is currently running
+ *
+ * @since DOKAN_PRO_SINCE
+ *
+ * @return bool
+ */
+ public function is_processing() {
+ return WC()->queue()->get_next( self::PROCESS_BATCH_HOOK ) !== null
+ || WC()->queue()->get_next( self::PROCESS_ITEM_HOOK ) !== null;
+ }
+}
diff --git a/includes/DependencyManagement/Providers/ServiceProvider.php b/includes/DependencyManagement/Providers/ServiceProvider.php
index 19c5e1696d..9ae5b8e70c 100644
--- a/includes/DependencyManagement/Providers/ServiceProvider.php
+++ b/includes/DependencyManagement/Providers/ServiceProvider.php
@@ -36,6 +36,7 @@ class ServiceProvider extends BootableServiceProvider {
'withdraw' => \WeDevs\Dokan\Withdraw\Manager::class,
'dashboard' => \WeDevs\Dokan\Dashboard\Manager::class,
'commission' => \WeDevs\Dokan\Commission::class,
+ 'fees' => \WeDevs\Dokan\Fees::class,
'customizer' => \WeDevs\Dokan\Customizer::class,
'upgrades' => \WeDevs\Dokan\Upgrade\Manager::class,
'product_sections' => \WeDevs\Dokan\ProductSections\Manager::class,
diff --git a/includes/Fees.php b/includes/Fees.php
new file mode 100644
index 0000000000..0132612bdd
--- /dev/null
+++ b/includes/Fees.php
@@ -0,0 +1,268 @@
+commission in version in 3.14.0
+ *
+ * @since 3.14.0
+ *
+ * @return void
+ */
+ public function __construct() {
+ add_filter( 'woocommerce_order_item_get_formatted_meta_data', [ $this, 'hide_extra_data' ] );
+ add_action( 'woocommerce_order_status_changed', [ $this, 'calculate_gateway_fee' ], 100 );
+ add_action( 'woocommerce_thankyou_ppec_paypal', [ $this, 'calculate_gateway_fee' ] );
+ add_action( 'woocommerce_paypal_payments_order_captured', [ $this, 'calculate_gateway_fee' ], 99 );
+ }
+
+ /**
+ * Hide extra meta data
+ *
+ * @since 2.9.21
+ *
+ * @param array
+ *
+ * @return array
+ */
+ public function hide_extra_data( $formatted_meta ) {
+ $meta_to_hide = [ '_dokan_commission_rate', '_dokan_commission_type', '_dokan_additional_fee' ];
+
+ foreach ( $formatted_meta as $key => $meta ) {
+ if ( in_array( $meta->key, $meta_to_hide, true ) ) {
+ unset( $formatted_meta[ $key ] );
+ }
+ }
+
+ return $formatted_meta;
+ }
+
+ /**
+ * Calculate gateway fee
+ * Moved from dokan()->commission in version in 3.14.0
+ *
+ * @since 2.9.21
+ *
+ * @param int $order_id
+ *
+ * @return void
+ */
+ public function calculate_gateway_fee( $order_id ) {
+ global $wpdb;
+ $order = wc_get_order( $order_id );
+ $processing_fee = $this->get_processing_fee( $order );
+
+ if ( ! $processing_fee ) {
+ return;
+ }
+
+ foreach ( dokan()->commission->get_all_order_to_be_processed( $order ) as $tmp_order ) {
+ $gateway_fee_added = $tmp_order->get_meta( 'dokan_gateway_fee' );
+ $vendor_earning = dokan()->commission->get_earning_from_order_table( $tmp_order->get_id() );
+
+ if ( is_null( $vendor_earning ) || $gateway_fee_added ) {
+ continue;
+ }
+
+ $gateway_fee = wc_format_decimal( ( $processing_fee / $order->get_total() ) * $tmp_order->get_total() );
+
+ // Ensure sub-orders also get the correct payment gateway fee (if any)
+ $gateway_fee = apply_filters( 'dokan_get_processing_gateway_fee', $gateway_fee, $tmp_order, $order );
+ $net_amount = $vendor_earning - $gateway_fee;
+ $net_amount = apply_filters( 'dokan_orders_vendor_net_amount', $net_amount, $vendor_earning, $gateway_fee, $tmp_order, $order );
+
+ $wpdb->update(
+ $wpdb->dokan_orders,
+ [ 'net_amount' => (float) $net_amount ],
+ [ 'order_id' => $tmp_order->get_id() ],
+ [ '%f' ],
+ [ '%d' ]
+ );
+
+ $wpdb->update(
+ $wpdb->dokan_vendor_balance,
+ [ 'debit' => (float) $net_amount ],
+ [
+ 'trn_id' => $tmp_order->get_id(),
+ 'trn_type' => 'dokan_orders',
+ ],
+ [ '%f' ],
+ [ '%d', '%s' ]
+ );
+
+ $tmp_order->update_meta_data( 'dokan_gateway_fee', $gateway_fee );
+ $tmp_order->save();
+
+ if ( apply_filters( 'dokan_commission_log_gateway_fee_to_order_note', true, $tmp_order ) ) {
+ // translators: %s: Geteway fee
+ $tmp_order->add_order_note( sprintf( __( 'Payment gateway processing fee %s', 'dokan-lite' ), wc_format_decimal( $gateway_fee, 2 ) ) );
+ }
+ //remove cache for seller earning
+ $cache_key = "get_earning_from_order_table_{$tmp_order->get_id()}_seller";
+ Cache::delete( $cache_key );
+
+ // remove cache for seller earning
+ $cache_key = "get_earning_from_order_table_{$tmp_order->get_id()}_admin";
+ Cache::delete( $cache_key );
+ }
+ }
+
+ /**
+ * Get processing fee
+ *
+ * @since DOKAN_LITE_SINCE
+ *
+ * @param WC_Order $order
+ *
+ * @return float
+ */
+ public function get_processing_fee( $order ) {
+ $processing_fee = 0;
+ $payment_method = $order->get_payment_method();
+
+ if ( 'paypal' === $payment_method ) {
+ $processing_fee = $order->get_meta( 'PayPal Transaction Fee' );
+ } elseif ( 'ppec_paypal' === $payment_method && defined( 'PPEC_FEE_META_NAME_NEW' ) ) {
+ $processing_fee = $order->get_meta( PPEC_FEE_META_NAME_NEW );
+ } elseif ( 'ppcp-gateway' === $payment_method && class_exists( PayPalGateway::class ) ) {
+ $breakdown = $order->get_meta( PayPalGateway::FEES_META_KEY );
+ if ( is_array( $breakdown ) && isset( $breakdown['paypal_fee'] ) && is_array( $breakdown['paypal_fee'] ) ) {
+ $processing_fee = $breakdown['paypal_fee']['value'];
+ }
+ }
+
+ return apply_filters( 'dokan_get_processing_fee', $processing_fee, $order );
+ }
+
+ /**
+ * Get shipping fee recipient
+ * Move from commission.php in version 3.14.0
+ *
+ * @since 2.9.21
+ * @since 3.4.1 introduced the shipping fee recipient hook
+ *
+ * @param WC_Order|int $order
+ *
+ * @return string
+ */
+ public function get_shipping_fee_recipient( $order ) {
+ if ( is_numeric( $order ) ) {
+ $order = wc_get_order( $order );
+ }
+
+ if ( ! $order ) {
+ return new WP_Error( 'invalid-order-object', __( 'Please provide a valid order object.', 'dokan-lite' ) );
+ }
+
+ $saved_shipping_recipient = $order->get_meta( 'shipping_fee_recipient', true );
+
+ if ( $saved_shipping_recipient ) {
+ $shipping_recipient = $saved_shipping_recipient;
+ } else {
+ $shipping_recipient = apply_filters( 'dokan_shipping_fee_recipient', dokan_get_option( 'shipping_fee_recipient', 'dokan_selling', 'seller' ), $order->get_id() );
+ $order->update_meta_data( 'shipping_fee_recipient', $shipping_recipient );
+ $order->save();
+ }
+
+ return $shipping_recipient;
+ }
+
+ /**
+ * Get tax fee recipient
+ * Move from commission.php in version 3.14.0
+ *
+ * @since 2.9.21
+ * @since 3.4.1 introduced the tax fee recipient hook
+ *
+ * @param WC_Order|int $order
+ *
+ * @return string|WP_Error
+ */
+ public function get_tax_fee_recipient( $order ) {
+ if ( is_numeric( $order ) ) {
+ $order = wc_get_order( $order );
+ }
+
+ if ( ! $order ) {
+ return new WP_Error( 'invalid-order-object', __( 'Please provide a valid order object.', 'dokan-lite' ) );
+ }
+
+ $saved_tax_recipient = $order->get_meta( 'tax_fee_recipient', true );
+
+ if ( $saved_tax_recipient ) {
+ $tax_recipient = $saved_tax_recipient;
+ } else {
+ $tax_recipient = apply_filters( 'dokan_tax_fee_recipient', dokan_get_option( 'tax_fee_recipient', 'dokan_selling', 'seller' ), $order->get_id() );
+ $order->update_meta_data( 'tax_fee_recipient', $tax_recipient );
+ $order->save();
+ }
+
+ return $tax_recipient;
+ }
+
+ /**
+ * Get shipping tax fee recipient.
+ * Move from commission.php in version 3.14.0
+ *
+ * @since 3.7.19
+ *
+ * @param WC_Order $order Order.
+ *
+ * @return string
+ */
+ public function get_shipping_tax_fee_recipient( $order ): string {
+ // get saved tax recipient
+ $saved_shipping_tax_recipient = $order->get_meta( 'shipping_tax_fee_recipient', true );
+ if ( ! empty( $saved_shipping_tax_recipient ) ) {
+ return $saved_shipping_tax_recipient;
+ }
+
+ $default_tax_fee_recipient = $this->get_tax_fee_recipient( $order->get_id() ); // this is needed for backward compatibility
+ $shipping_tax_recipient = dokan_get_option( 'shipping_tax_fee_recipient', 'dokan_selling', $default_tax_fee_recipient );
+ $shipping_tax_recipient = apply_filters( 'dokan_shipping_tax_fee_recipient', $shipping_tax_recipient, $order->get_id() );
+
+ $order->update_meta_data( 'shipping_tax_fee_recipient', $shipping_tax_recipient, true );
+ $order->save();
+
+ return $shipping_tax_recipient;
+ }
+
+ /**
+ * Get total shipping tax refunded for the order.
+ * Move from commission.php in version 3.14.0
+ *
+ * @since 3.7.19
+ *
+ * @param WC_Order $order Order.
+ *
+ * @return float
+ */
+ public function get_total_shipping_tax_refunded( WC_Order $order ): float {
+ $tax_refunded = 0.0;
+
+ foreach ( $order->get_items( 'shipping' ) as $item_id => $item ) {
+ /**
+ * @var \WC_Order_Item_Shipping $item Shipping item.
+ */
+ foreach ( $item->get_taxes()['total'] as $tax_id => $tax_amount ) {
+ $tax_refunded += $order->get_tax_refunded_for_item( $item->get_id(), $tax_id, 'shipping' );
+ }
+ }
+
+ return $tax_refunded;
+ }
+}
diff --git a/includes/Install/Installer.php b/includes/Install/Installer.php
index 1d11c51141..4a49cd0ae4 100755
--- a/includes/Install/Installer.php
+++ b/includes/Install/Installer.php
@@ -41,9 +41,8 @@ public function do_install() {
$was_installed_before = get_option( 'dokan_theme_version', false );
- update_option( 'dokan_theme_version', DOKAN_PLUGIN_VERSION );
-
if ( ! $was_installed_before ) {
+ update_option( 'dokan_theme_version', DOKAN_PLUGIN_VERSION );
update_option( 'dokan_admin_setup_wizard_ready', false );
set_transient( '_dokan_setup_page_redirect', true, 30 );
}
diff --git a/includes/Order/Admin/Hooks.php b/includes/Order/Admin/Hooks.php
index 1e8631127c..591334a43b 100644
--- a/includes/Order/Admin/Hooks.php
+++ b/includes/Order/Admin/Hooks.php
@@ -55,6 +55,9 @@ public function __construct() {
add_filter( 'woocommerce_order_item_display_meta_value', [ $this, 'change_order_item_display_meta_value' ], 10, 2 );
add_filter( 'woocommerce_reports_get_order_report_query', [ $this, 'admin_order_reports_remove_parents' ] );
add_filter( 'post_class', [ $this, 'admin_shop_order_row_classes' ], 10, 3 );
+
+ // Add commission meta-box in order details page.
+ add_action( 'add_meta_boxes', [ $this, 'add_commission_metabox_and_related_orders_in_order_details_page' ], 10, 2 );
}
/**
@@ -89,9 +92,10 @@ public function admin_shop_order_edit_columns( $existing_columns ) {
}
$column_to_insert = [
- 'seller' => __( 'Vendor', 'dokan-lite' ),
- 'wc_actions' => __( 'Actions', 'dokan-lite' ),
- 'suborder' => __( 'Sub Order', 'dokan-lite' ),
+ 'admin_commission' => __( 'Commission', 'dokan-lite' ),
+ 'seller' => __( 'Vendor', 'dokan-lite' ),
+ 'wc_actions' => __( 'Actions', 'dokan-lite' ),
+ 'suborder' => __( 'Sub Order', 'dokan-lite' ),
];
$columns = dokan_array_insert_after( $existing_columns, $column_to_insert );
@@ -120,7 +124,7 @@ public function shop_order_custom_columns( $col, $post_id ) {
return;
}
- if ( ! in_array( $col, [ 'order_number', 'suborder', 'seller' ], true ) ) {
+ if ( ! in_array( $col, [ 'order_number', 'suborder', 'seller', 'admin_commission' ], true ) ) {
return;
}
@@ -155,6 +159,21 @@ public function shop_order_custom_columns( $col, $post_id ) {
}
break;
+
+ case 'admin_commission':
+ if ( '1' === $order->get_meta( 'has_sub_order', true ) ) {
+ $output = '--';
+ } else {
+ $commission = dokan()->commission->get_earning_by_order( $order->get_id(), 'admin' );
+ /**
+ * In case of refund, we are not excluding gateway fee; in case of stripe full/partial refund net amount can be negative
+ */
+ if ( $commission < 0 ) {
+ $commission = 0;
+ }
+ $output = wc_price( $commission );
+ }
+ break;
}
if ( ! empty( $output ) ) {
@@ -513,4 +532,127 @@ public function admin_shop_order_toggle_sub_orders( $typenow ) {
echo '' . esc_html__( 'Toggle Sub-orders', 'dokan-lite' ) . ' ';
}
}
+
+ /**
+ * Add dokan commission meta-box in woocommerce order details page
+ * and add suborders or related sibling orders in meta-box.
+ *
+ * @since 3.14.0
+ *
+ * @return void
+ */
+ public function add_commission_metabox_and_related_orders_in_order_details_page( $post_type, $post ) {
+ $screen = OrderUtil::get_order_admin_screen();
+
+ if ( $screen !== $post_type ) {
+ return;
+ }
+
+ $order = dokan()->order->get( OrderUtil::get_post_or_order_id( $post ) );
+ $has_sub_order = '1' === $order->get_meta( 'has_sub_order', true );
+
+ // Check if the screen is order details page and if it is a child order.
+ if ( ! $has_sub_order ) {
+ add_meta_box(
+ 'dokan_commission_box',
+ __( 'Commissions', 'dokan-lite' ),
+ [ $this, 'commission_meta_box' ],
+ $screen,
+ 'normal',
+ 'core'
+ );
+ }
+
+ // If the order has is a parent order or a child order, avoid those order that has no parent order or child order.
+ if ( $has_sub_order || ! empty( $order->get_parent_id() ) ) {
+ $title = $has_sub_order ? __( 'Sub orders', 'dokan-lite' ) : __( 'Related orders', 'dokan-lite' );
+
+ add_meta_box(
+ 'dokan_sub_or_related_orders',
+ $title,
+ [ $this, 'sub_or_related_orders_meta_box' ],
+ $screen,
+ 'normal',
+ 'core'
+ );
+ }
+ }
+
+ /**
+ * Dokan order commission meta-box body.
+ *
+ * @since 3.14.0
+ *
+ * @param WP_Post|WC_Order $post_or_order
+ *
+ * @return void
+ */
+ public function commission_meta_box( $post_or_order ) {
+ global $wpdb;
+ $order = dokan()->order->get( OrderUtil::get_post_or_order_id( $post_or_order ) );
+
+ $data = $wpdb->get_row(
+ $wpdb->prepare( "SELECT order_total,net_amount FROM {$wpdb->prefix}dokan_orders WHERE order_id = %d LIMIT 1", $order->get_id() )
+ );
+
+ $order_total = $data && property_exists( $data, 'order_total' ) ? $data->order_total : 0;
+ $net_amount = $data && property_exists( $data, 'net_amount' ) ? $data->net_amount : 0;
+
+ $total_commission = (float) $order_total - (float) $net_amount;
+ $all_commission_types = array_merge( dokan_commission_types(), dokan()->commission->get_legacy_commission_types() );
+
+ dokan_get_template_part(
+ 'orders/commission-meta-box-html', '', [
+ 'order' => $order,
+ 'data' => $data,
+ 'total_commission' => $total_commission,
+ 'all_commission_types' => $all_commission_types,
+ ]
+ );
+ }
+
+ /**
+ * Content of suborder or related order meta-box.
+ *
+ * @param $post_or_order
+ *
+ * @return void
+ */
+ public function sub_or_related_orders_meta_box( $post_or_order ) {
+ $order = dokan()->order->get( OrderUtil::get_post_or_order_id( $post_or_order ) );
+ $parent_order = new WC_Order();
+ $has_sub_order = '1' === $order->get_meta( 'has_sub_order', true );
+
+ if ( $has_sub_order ) {
+ $orders_to_render = dokan()->order->get_child_orders( $order->get_id() );
+ } else {
+ $orders_to_render = dokan()->order->all(
+ [
+ 'parent' => $order->get_parent_id(),
+ 'limit' => -1,
+ 'type' => 'shop_order',
+ ]
+ );
+
+ $parent_order = dokan()->order->get( $order->get_parent_id() );
+
+ $orders_to_render = array_filter(
+ $orders_to_render,
+ function ( $item ) use ( $order ) {
+ return $item->get_id() !== $order->get_id();
+ }
+ );
+
+ array_unshift( $orders_to_render, $parent_order );
+ }
+
+ dokan_get_template_part(
+ 'orders/sub-order-related-order-meta-box-html', '', array(
+ 'order' => $order,
+ 'parent_order' => $parent_order,
+ 'has_sub_order' => $has_sub_order,
+ 'orders_to_render' => $orders_to_render,
+ )
+ );
+ }
}
diff --git a/includes/Order/Hooks.php b/includes/Order/Hooks.php
index 3bef0c4f5d..dc2e1abecf 100644
--- a/includes/Order/Hooks.php
+++ b/includes/Order/Hooks.php
@@ -184,9 +184,9 @@ private function is_status_change_allowed( string $current_status, string $new_s
*/
$whitelist = apply_filters( 'dokan_sub_order_status_update_whitelist', $default_whitelist );
- // If the current status is not in the whitelist, status change is not allowed
- if ( ! isset( $whitelist[ $current_status ] ) ) {
- return false;
+ // Allow any status change if the current status is not in the whitelist or the new status is not allowed
+ if ( ! array_key_exists( $current_status, $whitelist ) || ! array_key_exists( $new_status, $whitelist ) ) {
+ return true;
}
// If 'any' is allowed for the current status, all transitions are allowed
diff --git a/includes/Product/Hooks.php b/includes/Product/Hooks.php
index 6543cb504a..d0b6c326e5 100644
--- a/includes/Product/Hooks.php
+++ b/includes/Product/Hooks.php
@@ -40,6 +40,11 @@ public function __construct() {
// Init Product Cache Class
new VendorStoreInfo();
new ProductCache();
+
+ // Product commission
+ add_action( 'woocommerce_product_options_advanced', array( $this, 'add_per_product_commission_options' ), 15 );
+ add_action( 'woocommerce_process_product_meta_simple', array( $this, 'save_per_product_commission_options' ), 15 );
+ add_action( 'woocommerce_process_product_meta_variable', array( $this, 'save_per_product_commission_options' ), 15 );
}
/**
@@ -453,4 +458,100 @@ public function product_review_notification_recipients( $emails, $comment_id ) {
return $filtered_emails;
}
+
+ /**
+ * Add per product commission options
+ * Moved from dokan pro in version 3.14.0
+ *
+ * @since 2.4.12
+ *
+ * @return void
+ */
+ public function add_per_product_commission_options() {
+ if ( ! current_user_can( 'manage_woocommerce' ) ) {
+ return;
+ }
+
+ $product = wc_get_product( get_the_ID() );
+ $admin_commission = $product->get_meta( '_per_product_admin_commission' );
+ $additional_fee = $product->get_meta( '_per_product_admin_additional_fee' );
+ ?>
+
+
+
+
+ = $_per_product_admin_commission ) {
+ $admin_commission = ( '' === $_POST['_per_product_admin_commission'] ) ? '' : $_per_product_admin_commission; // phpcs:ignore
+ }
+ }
+
+ if ( isset( $_POST['_per_product_admin_additional_fee'] ) ) { // phpcs:ignore
+ $additional_fee = ( '' === $_POST['_per_product_admin_additional_fee'] ) ? '' : sanitize_text_field( $_POST['_per_product_admin_additional_fee'] ); // phpcs:ignore
+ }
+
+ update_post_meta( $post_id, '_per_product_admin_commission', $admin_commission );
+ update_post_meta( $post_id, '_per_product_admin_additional_fee', wc_format_decimal( $additional_fee ) );
+ }
}
diff --git a/includes/Product/Manager.php b/includes/Product/Manager.php
index 6fdeaf0362..0a6a74cb69 100644
--- a/includes/Product/Manager.php
+++ b/includes/Product/Manager.php
@@ -5,8 +5,10 @@
use WC_Product;
use WC_Product_Download;
use WeDevs\Dokan\Cache;
-use WP_Query;
+use WeDevs\Dokan\Commission\Model\Setting;
+use WeDevs\Dokan\Commission\Settings\Product;
use WP_Error;
+use WP_Query;
/**
* Product manager Class
@@ -714,4 +716,55 @@ public function top_rated( $args = [] ) {
return $products;
}
+
+ /**
+ * Validate product id (if it's a variable product, return it's parent id)
+ *
+ * Moved from \WeDevs\Dokan\Commission() ( commission.php file ) in version 3.14.0
+ *
+ * @since 2.9.21
+ *
+ * @param int $product_id
+ *
+ * @return int
+ */
+ public function validate_product_id( $product_id ) {
+ $product = $this->get( $product_id );
+ if ( ! $product ) {
+ return 0;
+ }
+
+ $parent_id = $product->get_parent_id();
+
+ return $parent_id ? $parent_id : $product_id;
+ }
+
+ /**
+ * Returns product commission settings data.
+ *
+ * @since 3.14.0
+ *
+ * @return \WeDevs\Dokan\Commission\Model\Setting
+ */
+ public function get_commission_settings( $product_id = 0 ) {
+ $settings = new Product( $product_id );
+
+ return $settings->get();
+ }
+
+ /**
+ * Saves and returns product commission settings data.
+ *
+ * @since 3.14.0
+ *
+ * @return \WeDevs\Dokan\Commission\Model\Setting
+ */
+ public function save_commission_settings( $product_id, $commission ) {
+ $data['percentage'] = isset( $commission['percentage'] ) ? $commission['percentage'] : '';
+ $data['type'] = isset( $commission['type'] ) ? $commission['type'] : '';
+ $data['flat'] = isset( $commission['flat'] ) ? $commission['flat'] : '';
+
+ $setting = new Product( $product_id );
+ return $setting->save( $data );
+ }
}
diff --git a/includes/ProductCategory/Helper.php b/includes/ProductCategory/Helper.php
index b8bdfd671e..c582787ff6 100644
--- a/includes/ProductCategory/Helper.php
+++ b/includes/ProductCategory/Helper.php
@@ -99,13 +99,17 @@ private static function get_formatted_chosen_cat( $all_children, $all_ancestors
*
* @since 3.6.4
*
- * @param object $terms
+ * @param array $terms
*
* @return array
*/
public static function generate_chosen_categories( $terms ) {
$all_parents = [];
+ if ( ! is_array( $terms ) ) {
+ $terms = [];
+ }
+
// If any category selection option is turned we don't need to generate chosen categories, all terms are also chosen category.
if ( self::is_any_category_selection_enabled() ) {
return $terms;
diff --git a/includes/REST/AdminMiscController.php b/includes/REST/AdminMiscController.php
index 6716d8c3ae..db0c8ce644 100644
--- a/includes/REST/AdminMiscController.php
+++ b/includes/REST/AdminMiscController.php
@@ -36,6 +36,30 @@ public function register_routes() {
),
)
);
+
+ register_rest_route(
+ $this->namespace, '/option', [
+ [
+ 'methods' => WP_REST_Server::READABLE,
+ 'callback' => [ $this, 'get_option' ],
+ 'args' => [
+ 'section' => [
+ 'type' => 'string',
+ 'description' => __( 'Dokan setting section', 'dokan-lite' ),
+ 'required' => true,
+ 'sanitize_callback' => 'sanitize_text_field',
+ ],
+ 'option' => [
+ 'type' => 'string',
+ 'description' => __( 'Dokan setting section key', 'dokan-lite' ),
+ 'required' => true,
+ 'sanitize_callback' => 'sanitize_text_field',
+ ],
+ ],
+ 'permission_callback' => [ $this, 'check_permission' ],
+ ],
+ ]
+ );
}
/**
@@ -51,4 +75,20 @@ public function get_help() {
return rest_ensure_response( $help );
}
+ /**
+ * Get dokan option.
+ *
+ * @since 3.14.0
+ *
+ * @param \WP_REST_Request $request
+ *
+ * @return \WP_REST_Response|\WP_Error
+ */
+ public function get_option( $request ) {
+ $section = $request->get_param( 'section' );
+ $option = $request->get_param( 'option' );
+ $default = '';
+
+ return rest_ensure_response( dokan_get_option( $option, $section, $default ) );
+ }
}
diff --git a/includes/REST/AdminNoticeController.php b/includes/REST/AdminNoticeController.php
index e044b5fcf5..d5e2a8552f 100644
--- a/includes/REST/AdminNoticeController.php
+++ b/includes/REST/AdminNoticeController.php
@@ -5,6 +5,7 @@
use WeDevs\Dokan\Admin\Notices\Helper;
use WP_REST_Response;
use WP_REST_Server;
+use WP_REST_Request;
use WeDevs\Dokan\Abstracts\DokanRESTAdminController;
/**
@@ -36,6 +37,16 @@ public function register_routes() {
'methods' => WP_REST_Server::READABLE,
'callback' => [ $this, 'dokan_get_admin_notices' ],
'permission_callback' => [ $this, 'check_permission' ],
+ 'args' => [
+ 'scope' => [
+ 'description' => __( 'Choose notice scope: "local" displays only on Dokan pages, "global" displays across the entire site.', 'dokan-lite' ),
+ 'type' => 'string',
+ 'enum' => [ 'local', 'global' ],
+ 'required' => false,
+ 'default' => '',
+ 'sanitize_callback' => 'sanitize_text_field',
+ ],
+ ],
],
]
);
@@ -53,13 +64,26 @@ public function register_routes() {
/**
* Get dokan specific notices
+ * @param WP_REST_Request $request
*
* @return WP_REST_Response
*/
- public function dokan_get_admin_notices() {
+ public function dokan_get_admin_notices( WP_REST_Request $request ) {
+ $notice_scope = $request->get_param( 'scope' );
+ $notice_scope = ! empty( $notice_scope ) ? $notice_scope : 'local';
+
$notices = Helper::dokan_get_admin_notices();
- return rest_ensure_response( $notices );
+ // Filter notices by scope
+ $filter_notices = array_filter(
+ $notices,
+ function ( $notice ) use ( $notice_scope ) {
+ return $notice_scope === ( $notice['scope'] ?? 'local' );
+ }
+ );
+ $filter_notices = array_values( $filter_notices );
+
+ return rest_ensure_response( $filter_notices );
}
/**
diff --git a/includes/REST/CommissionControllerV1.php b/includes/REST/CommissionControllerV1.php
new file mode 100644
index 0000000000..b8e47bc13d
--- /dev/null
+++ b/includes/REST/CommissionControllerV1.php
@@ -0,0 +1,143 @@
+namespace, '/' . $this->base, [
+ [
+ 'methods' => WP_REST_Server::READABLE,
+ 'callback' => [ $this, 'get_commission' ],
+ 'args' => [
+ 'product_id' => [
+ 'description' => __( 'Products price', 'dokan-lite' ),
+ 'type' => 'integer',
+ 'default' => 0,
+ 'required' => true,
+ 'sanitize_callback' => 'absint',
+ ],
+ 'amount' => [
+ 'description' => __( 'The amount on that the commission will be calculated.', 'dokan-lite' ),
+ 'type' => 'number',
+ 'default' => 0,
+ 'required' => true,
+ 'sanitize_callback' => 'sanitize_text_field',
+ ],
+ 'vendor_id' => [
+ 'description' => __( 'Vendor id', 'dokan-lite' ),
+ 'type' => 'integer',
+ 'default' => 0,
+ 'required' => true,
+ 'sanitize_callback' => 'absint',
+ ],
+ 'category_ids' => [
+ 'description' => __( 'Category ids', 'dokan-lite' ),
+ 'type' => 'array',
+ 'sanitize_callback' => 'wc_clean',
+ 'items' => array(
+ 'type' => 'integer',
+ ),
+ 'default' => [],
+ 'required' => true,
+ ],
+ 'context' => [
+ 'required' => false,
+ 'description' => __( 'In which context the commission will be calculated', 'dokan-lite' ),
+ 'type' => 'string',
+ 'enum' => [ 'admin', 'seller' ],
+ 'context' => [ 'view', 'edit' ],
+ 'default' => 'seller',
+ ],
+ ],
+ 'permission_callback' => [ $this, 'get_permissions_check' ],
+ ],
+ ]
+ );
+ }
+
+ /**
+ * Checking if have any permission.
+ *
+ * @since 3.14.0
+ *
+ * @return boolean
+ */
+ public function get_permissions_check() {
+ // phpcs:ignore WordPress.WP.Capabilities.Unknown
+ return current_user_can( 'dokandar' ) || current_user_can( 'manage_options' );
+ }
+
+ /**
+ * Returns commission or earning based on context.
+ *
+ * @param WP_REST_Request $request
+ *
+ * @return WP_Error|WP_HTTP_Response|WP_REST_Response
+ */
+ public function get_commission( $request ) {
+ $product_id = $request->get_param( 'product_id' );
+ $amount = $request->get_param( 'amount' );
+ $vendor_id = $request->get_param( 'vendor_id' );
+ $category_ids = $request->get_param( 'category_ids' );
+ $context = $request->get_param( 'context' );
+
+ $chosen_cats = Helper::generate_chosen_categories( $category_ids );
+ $category_id = reset( $chosen_cats );
+
+ if ( ! $category_id ) {
+ $category_id = 0;
+ }
+
+ if ( ! $vendor_id ) {
+ $vendor_id = dokan_get_vendor_by_product( $product_id, true );
+ $vendor_id = $vendor_id ? $vendor_id : 0;
+ }
+
+ if ( ! is_numeric( $amount ) ) {
+ $amount = 0;
+ }
+
+ $commission_or_earning = dokan()->commission->get_commission(
+ [
+ 'total_amount' => $amount,
+ 'total_quantity' => 1,
+ 'product_id' => $product_id,
+ 'vendor_id' => $vendor_id,
+ 'category_id' => $category_id,
+ ]
+ );
+
+ $data = 'seller' === $context ? $commission_or_earning->get_vendor_earning() : $commission_or_earning->get_admin_commission();
+
+ return rest_ensure_response( wc_format_decimal( $data, wc_get_price_decimals() + 2 ) );
+ }
+}
diff --git a/includes/REST/Manager.php b/includes/REST/Manager.php
index ce0d1f936b..10d0a5970d 100644
--- a/includes/REST/Manager.php
+++ b/includes/REST/Manager.php
@@ -27,9 +27,6 @@ public function __construct() {
add_filter( 'woocommerce_rest_prepare_product_object', array( $this, 'prepeare_product_response' ), 10, 3 );
add_filter( 'dokan_vendor_to_array', array( $this, 'filter_store_open_close_option' ) );
- // populate admin commission data for admin
- add_filter( 'dokan_rest_store_additional_fields', array( $this, 'populate_admin_commission' ), 10, 2 );
-
// Send email to admin on adding a new product
add_action( 'dokan_rest_insert_product_object', array( $this, 'on_dokan_rest_insert_product' ), 10, 3 );
add_filter( 'dokan_vendor_to_array', [ $this, 'filter_payment_response' ] );
@@ -130,37 +127,6 @@ public function filter_store_open_close_option( $data ) {
return $data;
}
- /**
- * Populate admin commission
- *
- * @param array $data
- * @param array $store
- *
- * @since 2.9.13
- *
- * @return array
- */
- public function populate_admin_commission( $data, $store ) {
- if ( ! current_user_can( 'manage_woocommerce' ) ) {
- return $data;
- }
-
- $store_id = $store->get_id();
-
- if ( ! $store_id ) {
- return $data;
- }
-
- $commission = get_user_meta( $store_id, 'dokan_admin_percentage', true );
- $additional_fee = get_user_meta( $store_id, 'dokan_admin_additional_fee', true );
- $commission_type = get_user_meta( $store_id, 'dokan_admin_percentage_type', true );
- $data['admin_commission'] = $commission;
- $data['admin_additional_fee'] = $additional_fee;
- $data['admin_commission_type'] = $commission_type;
-
- return $data;
- }
-
/**
* Send email to admin on adding a new product
*
@@ -234,6 +200,7 @@ private function get_rest_api_class_map() {
DOKAN_DIR . '/includes/REST/StoreSettingControllerV2.php' => '\WeDevs\Dokan\REST\StoreSettingControllerV2',
DOKAN_DIR . '/includes/REST/VendorDashboardController.php' => '\WeDevs\Dokan\REST\VendorDashboardController',
DOKAN_DIR . '/includes/REST/ProductBlockController.php' => '\WeDevs\Dokan\REST\ProductBlockController',
+ DOKAN_DIR . '/includes/REST/CommissionControllerV1.php' => '\WeDevs\Dokan\REST\CommissionControllerV1',
)
);
}
diff --git a/includes/REST/ProductControllerV2.php b/includes/REST/ProductControllerV2.php
index 2015555b87..60d21506a9 100644
--- a/includes/REST/ProductControllerV2.php
+++ b/includes/REST/ProductControllerV2.php
@@ -2,6 +2,8 @@
namespace WeDevs\Dokan\REST;
+use WP_Error;
+use WP_REST_Response;
use WP_REST_Server;
use WP_REST_Request;
use WeDevs\Dokan\ProductCategory\Helper;
diff --git a/includes/REST/StoreController.php b/includes/REST/StoreController.php
index d0e491e99f..f6d71edafc 100644
--- a/includes/REST/StoreController.php
+++ b/includes/REST/StoreController.php
@@ -623,14 +623,21 @@ public function get_total_review_count( $id, $post_type, $status ) {
/**
* Prepare a single user output for response
*
- * @param $store
+ * @param Vendor $store
* @param WP_REST_Request $request Request object.
* @param array $additional_fields (optional)
*
* @return WP_REST_Response $response Response data.
*/
public function prepare_item_for_response( $store, $request, $additional_fields = [] ) {
- $data = $store->to_array();
+ $data = $store->to_array();
+
+ $commission_settings = $store->get_commission_settings();
+ $data['admin_category_commission'] = $commission_settings->get_category_commissions();
+ $data['admin_commission'] = $commission_settings->get_percentage();
+ $data['admin_additional_fee'] = $commission_settings->get_flat();
+ $data['admin_commission_type'] = $commission_settings->get_type();
+
$data = array_merge( $data, apply_filters( 'dokan_rest_store_additional_fields', $additional_fields, $store, $request ) );
$response = rest_ensure_response( $data );
$response->add_links( $this->prepare_links( $data, $request ) );
@@ -935,7 +942,22 @@ public function get_store_category( $request ) {
}
$category_data = $store->get_store_categories( $best_selling );
- $response = rest_ensure_response( $category_data );
+ $commission_settings = $store->get_commission_settings();
+ $category_commissions = $commission_settings->get_category_commissions();
+
+ foreach ( $category_data as $term ) {
+ $term->admin_commission_type = $commission_settings->get_type();
+
+ if ( isset( $category_commissions['items'][ $term->term_id ] ) ) {
+ $term->commission = $category_commissions['items'][ $term->term_id ];
+ } elseif ( $category_commissions['all'] ) {
+ $term->commission = $category_commissions['all'];
+ } else {
+ $term->commission = [];
+ }
+ }
+
+ $response = rest_ensure_response( $category_data );
return $response;
}
diff --git a/includes/Upgrade/AdminNotice.php b/includes/Upgrade/AdminNotice.php
index 980536c346..258af341f9 100644
--- a/includes/Upgrade/AdminNotice.php
+++ b/includes/Upgrade/AdminNotice.php
@@ -37,8 +37,9 @@ public static function show_notice( $notices ) {
$notices[] = [
'type' => 'info',
'title' => __( 'Dokan Data Update Required', 'dokan-lite' ),
- 'description' => __( 'We need to update your install to the latest version', 'dokan-lite' ),
+ 'description' => __( 'Updating your Dokan data is required to continue functional operations.', 'dokan-lite' ),
'priority' => 1,
+ 'scope' => 'global',
'actions' => [
[
'type' => 'primary',
diff --git a/includes/Upgrade/Hooks.php b/includes/Upgrade/Hooks.php
index c7cd4d9aa5..4c9bfc5f84 100644
--- a/includes/Upgrade/Hooks.php
+++ b/includes/Upgrade/Hooks.php
@@ -2,6 +2,10 @@
namespace WeDevs\Dokan\Upgrade;
+use WeDevs\Dokan\Commission\Upugrader\Update_Category_Commission;
+use WeDevs\Dokan\Commission\Upugrader\Update_Product_Commission;
+use WeDevs\Dokan\Commission\Upugrader\Update_Vendor_Commission;
+
class Hooks {
/**
@@ -18,5 +22,13 @@ public function __construct() {
add_action( 'wp_ajax_dokan_do_upgrade', [ AdminNotice::class, 'do_upgrade' ] );
add_action( 'dokan_upgrade_is_not_required', [ Upgrades::class, 'update_db_dokan_version' ] );
add_action( 'dokan_upgrade_finished', [ Upgrades::class, 'update_db_dokan_version' ] );
+
+ $p_scheduler = new Update_Product_Commission();
+ $v_scheduler = new Update_Vendor_Commission();
+ $c_scheduler = new Update_Category_Commission();
+
+ $p_scheduler->init_hooks();
+ $v_scheduler->init_hooks();
+ $c_scheduler->init_hooks();
}
}
diff --git a/includes/Upgrade/Upgrades.php b/includes/Upgrade/Upgrades.php
index a81110997f..68b999e47e 100644
--- a/includes/Upgrade/Upgrades.php
+++ b/includes/Upgrade/Upgrades.php
@@ -44,6 +44,7 @@ class Upgrades {
'3.7.10' => Upgrades\V_3_7_10::class,
'3.7.19' => Upgrades\V_3_7_19::class,
'3.13.0' => Upgrades\V_3_13_0::class,
+ '3.14.0' => Upgrades\V_3_14_0::class,
];
/**
diff --git a/includes/Upgrade/Upgrades/V_3_14_0.php b/includes/Upgrade/Upgrades/V_3_14_0.php
new file mode 100644
index 0000000000..d97969f94b
--- /dev/null
+++ b/includes/Upgrade/Upgrades/V_3_14_0.php
@@ -0,0 +1,71 @@
+commission->get_legacy_commission_types() ), true ) ) {
+ if ( Flat::SOURCE === $commission_type ) {
+ $options['admin_percentage'] = 0;
+ $options['additional_fee'] = $admin_percentage;
+ } elseif ( Percentage::SOURCE === $commission_type ) {
+ $options['admin_percentage'] = $admin_percentage;
+ $options['additional_fee'] = 0;
+ }
+ }
+
+ $options['commission_type'] = $type_to_update;
+ update_option( 'dokan_selling', $options );
+ }
+
+ /**
+ * Update vendor and product comission settings.
+ *
+ * @since 3.14.0
+ *
+ * @return void
+ */
+ public static function update_commission() {
+ $product_scheduler = new Update_Product_Commission();
+ if ( ! $product_scheduler->is_processing() ) {
+ $product_scheduler->start_processing();
+ }
+
+ $vendor_scheduler = new Update_Vendor_Commission();
+ if ( ! $vendor_scheduler->is_processing() ) {
+ $vendor_scheduler->start_processing();
+ }
+
+ $category_scheduler = new Update_Category_Commission();
+ if ( ! $category_scheduler->is_processing() ) {
+ $category_scheduler->start_processing();
+ }
+ }
+}
diff --git a/includes/Vendor/Manager.php b/includes/Vendor/Manager.php
index 439442c6c5..95346741d6 100644
--- a/includes/Vendor/Manager.php
+++ b/includes/Vendor/Manager.php
@@ -325,6 +325,14 @@ public function update( $vendor_id, $data = [] ) {
if ( isset( $data['admin_commission'] ) && ( is_numeric( wc_format_decimal( $data['admin_commission'] ) ) || '' === $data['admin_commission'] ) ) {
$vendor->update_meta( 'dokan_admin_percentage', wc_format_decimal( $data['admin_commission'] ) );
}
+
+ if ( isset( $data['admin_additional_fee'] ) && ( is_numeric( wc_format_decimal( $data['admin_additional_fee'] ) ) || '' === $data['admin_additional_fee'] ) ) {
+ $vendor->update_meta( 'dokan_admin_additional_fee', wc_format_decimal( $data['admin_additional_fee'] ) );
+ }
+
+ if ( isset( $data['admin_category_commission'] ) ) {
+ $vendor->update_meta( 'admin_category_commission', wc_clean( $data['admin_category_commission'] ) );
+ }
}
// update vendor store data
diff --git a/includes/Vendor/Vendor.php b/includes/Vendor/Vendor.php
index 3449228979..ae6ee2063d 100644
--- a/includes/Vendor/Vendor.php
+++ b/includes/Vendor/Vendor.php
@@ -5,9 +5,8 @@
use Automattic\WooCommerce\Utilities\NumberUtil;
use WC_Order;
use WeDevs\Dokan\Cache;
-use WeDevs\Dokan\Product\ProductCache;
+use WeDevs\Dokan\Commission\Model\Setting;
use WP_Error;
-use WP_Query;
use WP_User;
/**
@@ -630,8 +629,6 @@ public function get_store_categories( $best_selling = false ) {
// get extra information
$display_type = get_term_meta( $term->term_id, 'display_type', true );
$thumbnail_id = absint( get_term_meta( $term->term_id, 'thumbnail_id', true ) );
- $category_commision_type = get_term_meta( $term->term_id, 'per_category_admin_commission_type', true );
- $category_commision = get_term_meta( $term->term_id, 'per_category_admin_commission', true );
$category_icon = get_term_meta( $term->term_id, 'dokan_cat_icon', true );
$category_icon_color = get_term_meta( $term->term_id, 'dokan_cat_icon_color', true );
@@ -645,9 +642,6 @@ public function get_store_categories( $best_selling = false ) {
$image = $thumbnail = wc_placeholder_img_src();
}
- // fix commission
- $category_commision = ! empty( $category_commision ) ? wc_format_decimal( $category_commision ) : 0.00;
-
// set extra fields to term object
$term->thumbnail = $thumbnail;
$term->image = $image;
@@ -655,9 +649,6 @@ public function get_store_categories( $best_selling = false ) {
$term->icon = $category_icon;
$term->icon_color = $category_icon_color;
$term->display_type = $display_type;
- // set commissions
- $term->admin_commission_type = $category_commision_type;
- $term->admin_commission = $category_commision;
// finally store category data
$all_categories[] = $term;
@@ -943,17 +934,6 @@ public function get_readable_rating( $display = true ) {
echo esc_html( $html );
}
- /**
- * Get vendor percentage
- *
- * @param integer $product_id
- *
- * @return integer
- */
- public function get_percentage( $product_id = 0 ) {
- return dokan_get_seller_percentage( $this->id, $product_id );
- }
-
/**
* Make vendor active
*
@@ -1375,7 +1355,7 @@ protected function set_prop( $prop, $value ) {
* @param string $key
* @param bool $single Whether to return a single value
*
- * @return Mix
+ * @return mixed|null|false
*/
public function get_meta( $key, $single = false ) {
return get_user_meta( $this->get_id(), $key, $single );
@@ -1567,6 +1547,32 @@ public function save() {
$this->apply_changes();
}
+ /**
+ * Returns vendor commission settings data.
+ *
+ * @since 3.14.0
+ *
+ * @return \WeDevs\Dokan\Commission\Model\Setting
+ */
+ public function get_commission_settings() {
+ $settings = new \WeDevs\Dokan\Commission\Settings\Vendor( $this->get_id() );
+ return $settings->get();
+ }
+
+ /**
+ * Saves commission settings.
+ *
+ * @since 3.14.0
+ *
+ * @param array $commission
+ *
+ * @return \WeDevs\Dokan\Commission\Model\Setting
+ */
+ public function save_commission_settings( $commission = [] ) {
+ $settings = new \WeDevs\Dokan\Commission\Settings\Vendor( $this->get_id() );
+ return $settings->save( $commission );
+ }
+
/**
* Get vendor profile url for admin
*
diff --git a/includes/Walkers/CategoryDropdownSingle.php b/includes/Walkers/CategoryDropdownSingle.php
deleted file mode 100644
index eed9a56e57..0000000000
--- a/includes/Walkers/CategoryDropdownSingle.php
+++ /dev/null
@@ -1,56 +0,0 @@
- 'parent',
- 'id' => 'term_id',
- );
-
- public function __construct( $post_id ) {
- $this->post_id = $post_id;
- parent::__construct( $post_id );
- }
-
-
- public function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {
- if ( defined( 'DOKAN_PRO_PLUGIN_VERSION' ) && version_compare( DOKAN_PRO_PLUGIN_VERSION, '2.9.14', '<' ) ) {
- $commission_val = dokan_get_seller_percentage( dokan_get_current_user_id(), $this->post_id, $category->term_id );
- $commission_type = dokan_get_commission_type( dokan_get_current_user_id(), $this->post_id, $category->term_id );
- } else {
- $commission_val = dokan()->commission->get_earning_by_product( $this->post_id );
-
- if ( is_wp_error( $commission_val ) ) {
- $commission_val = 0;
- }
- }
-
- $pad = str_repeat( ' —', $depth * 1 );
- $cat_name = apply_filters( 'list_cats', $category->name, $category );
- $output .= "\tterm_id . '"';
-
- if ( defined( 'DOKAN_PRO_PLUGIN_VERSION' ) && version_compare( DOKAN_PRO_PLUGIN_VERSION, '2.9.14', '<' ) ) {
- $output .= ' data-commission="' . $commission_val . '" data-commission_type="' . $commission_type . '"';
- } else {
- $output .= ' data-commission="' . $commission_val . '" data-product-id="' . $this->post_id . '"';
- }
-
- if ( (int) $category->term_id === (int) $args['selected'] ) {
- $output .= ' selected="selected"';
- }
-
- $output .= '>';
- $output .= $pad . ' ' . $cat_name;
- $output .= " \n";
- }
-}
diff --git a/includes/Walkers/TaxonomyDropdown.php b/includes/Walkers/TaxonomyDropdown.php
index 106a1359d6..43228aa7e5 100644
--- a/includes/Walkers/TaxonomyDropdown.php
+++ b/includes/Walkers/TaxonomyDropdown.php
@@ -51,16 +51,16 @@ public function __construct( $post_id = 0 ) {
* @return void
*/
public function start_el( &$output, $category, $depth = 0, $args = [], $id = 0 ) {
- if ( defined( 'DOKAN_PRO_PLUGIN_VERSION' ) && version_compare( DOKAN_PRO_PLUGIN_VERSION, '2.9.14', '<' ) ) {
- $commission_val = dokan_get_seller_percentage( dokan_get_current_user_id(), $this->post_id, $category->term_id );
- $commission_type = dokan_get_commission_type( dokan_get_current_user_id(), $this->post_id, $category->term_id );
- } else {
- $commission_val = dokan()->commission->get_earning_by_product( $this->post_id );
-
- if ( is_wp_error( $commission_val ) ) {
- $commission_val = 0;
- }
- }
+ $commission_data = dokan()->commission->get_commission(
+ [
+ 'product_id' => $this->post_id,
+ 'category_id' => $category->term_id,
+ 'vendor_id' => dokan_get_current_user_id(),
+ ]
+ );
+
+ $commission_val = $commission_data->get_vendor_earning();
+ $commission_type = $commission_data->get_type();
$pad = str_repeat( ' —', $depth * 1 );
$cat_name = apply_filters( 'list_cats', $category->name, $category );
diff --git a/includes/functions.php b/includes/functions.php
index 5b1cfae3f6..32db2499c8 100755
--- a/includes/functions.php
+++ b/includes/functions.php
@@ -423,82 +423,25 @@ function dokan_author_pageviews( $seller_id ) {
/**
* Get store seller percentage settings
*
+ * @deprecated 3.14.0 Do Not Use This Function
+ *
* @param int $seller_id
* @param int $product_id
*
* @return int
*/
function dokan_get_seller_percentage( $seller_id = 0, $product_id = 0, $category_id = 0 ) {
+ wc_deprecated_function( __FUNCTION__, '3.14.0', 'dokan()->commission->get_commission()' );
- // Seller will get 100 percent if ( any_input_val < 0 || percentage_input_val > 100 )
- $commission_val = 100;
-
- //Global percentage
- $global_percentage = dokan_get_option( 'admin_percentage', 'dokan_selling', 0 );
-
- if ( $global_percentage !== '' && is_numeric( $global_percentage ) && $global_percentage >= 0 ) {
- $global_type = dokan_get_option( 'commission_type', 'dokan_selling', 'percentage' );
-
- if ( 'percentage' === $global_type ) {
- if ( $global_percentage <= 100 ) {
- $commission_val = (float) ( 100 - $global_percentage );
- }
- } elseif ( 'flat' === $global_type ) {
- $commission_val = (float) $global_percentage;
- }
- }
-
- //seller wise percentage
- if ( $seller_id ) {
- $admin_commission = get_user_meta( $seller_id, 'dokan_admin_percentage', true );
-
- if ( $admin_commission !== '' && is_numeric( $admin_commission ) && $admin_commission >= 0 ) {
- $admin_percentage_type = get_user_meta( $seller_id, 'dokan_admin_percentage_type', true );
-
- if ( 'percentage' === $admin_percentage_type ) {
- if ( $admin_commission <= 100 ) {
- $commission_val = (float) ( 100 - $admin_commission );
- }
- } elseif ( 'flat' === $admin_percentage_type ) {
- $commission_val = (float) $admin_commission;
- }
- }
- }
-
- //product and category wise percentage
- if ( $product_id ) {
-
- //category wise percentage
- $category_commission = dokan_get_category_wise_seller_commission( $product_id, $category_id );
- $is_single_category = dokan_get_option( 'product_category_style', 'dokan_selling', 'single' );
-
- if ( $is_single_category === 'single' && $category_commission !== '' && is_numeric( $category_commission ) && $category_commission >= 0 ) {
- $category_commission_type = dokan_get_category_wise_seller_commission_type( $product_id, $category_id );
-
- if ( 'percentage' === $category_commission_type ) {
- if ( $category_commission <= 100 ) {
- $commission_val = (float) ( 100 - $category_commission );
- }
- } elseif ( 'flat' === $category_commission_type ) {
- $commission_val = (float) $category_commission;
- }
- }
-
- //product wise percentage
- $_per_product_commission = get_post_meta( $product_id, '_per_product_admin_commission', true );
-
- if ( $_per_product_commission !== '' && is_numeric( $_per_product_commission ) && $_per_product_commission >= 0 ) {
- $_per_product_commission_type = get_post_meta( $product_id, '_per_product_admin_commission_type', true );
+ $commission_data = dokan()->commission->get_commission(
+ [
+ 'vendor_id' => $seller_id,
+ 'product_id' => $product_id,
+ 'category_id' => $category_id,
+ ]
+ );
- if ( 'percentage' === $_per_product_commission_type ) {
- if ( $_per_product_commission <= 100 ) {
- $commission_val = (float) ( 100 - $_per_product_commission );
- }
- } elseif ( 'flat' === $_per_product_commission_type ) {
- $commission_val = (float) $_per_product_commission;
- }
- }
- }
+ $commission_val = $commission_data->get_vendor_earning();
return apply_filters( 'dokan_get_seller_percentage', $commission_val, $seller_id, $product_id );
}
@@ -507,6 +450,8 @@ function dokan_get_seller_percentage( $seller_id = 0, $product_id = 0, $category
/**
* Get Dokan commission type by seller or product or both
*
+ * @deprecated 3.14.0 Do Not Use This Function
+ *
* @since 2.6.9
*
* @param int $seller_id
@@ -515,48 +460,17 @@ function dokan_get_seller_percentage( $seller_id = 0, $product_id = 0, $category
* @return string $type
*/
function dokan_get_commission_type( $seller_id = 0, $product_id = 0, $category_id = 0 ) {
- //return product wise percentage
- if ( $product_id ) {
- $_per_product_commission = get_post_meta( $product_id, '_per_product_admin_commission', true );
-
- if ( $_per_product_commission !== '' ) {
- $type = get_post_meta( $product_id, '_per_product_admin_commission_type', true );
- $type = empty( $type ) ? 'percentage' : $type;
-
- if ( 'flat' === $type || ( 'percentage' === $type && $_per_product_commission <= 100 ) ) {
- return $type;
- }
- }
-
- $category_commission = dokan_get_category_wise_seller_commission( $product_id, $category_id );
+ wc_deprecated_function( __FUNCTION__, '3.14.0', 'dokan()->commission->get_commission()' );
- if ( ! empty( $category_commission ) && $category_commission ) {
- $type = dokan_get_category_wise_seller_commission_type( $product_id, $category_id );
- $type = empty( $type ) ? 'percentage' : $type;
-
- if ( 'flat' === $type || ( 'percentage' === $type && $category_commission <= 100 ) ) {
- return $type;
- }
- }
- }
-
- //return seller wise percentage
- if ( $seller_id ) {
- $admin_commission = get_user_meta( $seller_id, 'dokan_admin_percentage', true );
-
- if ( $admin_commission !== '' ) {
- $type = get_user_meta( $seller_id, 'dokan_admin_percentage_type', true );
- $type = empty( $type ) ? 'percentage' : $type;
-
- if ( 'flat' === $type || ( 'percentage' === $type && $admin_commission <= 100 ) ) {
- return $type;
- }
- }
- }
-
- $global_type = dokan_get_option( 'commission_type', 'dokan_selling', 'percentage' );
+ $commission_data = dokan()->commission->get_commission(
+ [
+ 'vendor_id' => $seller_id,
+ 'product_id' => $product_id,
+ 'category_id' => $category_id,
+ ]
+ );
- return $global_type;
+ return $commission_data->get_type();
}
/**
@@ -1077,7 +991,8 @@ function dokan_edit_product_url( $product, bool $is_new_product = false ) {
* @return array
*/
function dokan_admin_product_columns( $columns ) {
- $columns['author'] = __( 'Author', 'dokan-lite' );
+ $columns['admin_commission'] = __( 'Commission', 'dokan-lite' );
+ $columns['author'] = __( 'Author', 'dokan-lite' );
return $columns;
}
@@ -2653,7 +2568,9 @@ function dokan_register_store_widget() {
add_action( 'widgets_init', 'dokan_register_store_widget' );
/**
- * Calculate category wise commission for given product
+ * Calculate category wise commission for given product.
+ *
+ * @deprecated 3.14.0 Do Not Use This Function
*
* @since 2.6.8
*
@@ -2662,34 +2579,15 @@ function dokan_register_store_widget() {
* @return int $commission_rate
*/
function dokan_get_category_wise_seller_commission( $product_id, $category_id = 0 ) {
- $terms = get_the_terms( $product_id, 'product_cat' );
-
- if ( empty( $terms ) ) {
- return 0;
- }
-
- $term_id = $terms[0]->term_id;
-
- $category_commision = null;
-
- if ( $category_id ) {
- $terms = get_term( $category_id );
- $term_id = $terms->term_id;
- }
-
- if ( $terms ) {
- $category_commision = get_term_meta( $term_id, 'per_category_admin_commission', true );
- }
-
- if ( ! empty( $category_commision ) ) {
- return wc_format_decimal( $category_commision );
- }
+ wc_deprecated_function( __FUNCTION__, '3.14.0' );
return 0;
}
/**
- * Calculate category wise commission type for given product
+ * Calculate category wise commission type for given product.
+ *
+ * @deprecated 3.14.0 Do Not Use This Function
*
* @since 2.6.9
*
@@ -2698,20 +2596,9 @@ function dokan_get_category_wise_seller_commission( $product_id, $category_id =
* @return int $commission_rate
*/
function dokan_get_category_wise_seller_commission_type( $product_id, $category_id = 0 ) {
- $terms = get_the_terms( $product_id, 'product_cat' );
- $term_id = $terms[0]->term_id;
- $category_commision = '';
-
- if ( $category_id ) {
- $terms = get_term( $category_id );
- $term_id = $terms->term_id;
- }
+ wc_deprecated_function( __FUNCTION__, '3.14.0' );
- if ( $terms ) {
- $category_commision = get_term_meta( $term_id, 'per_category_admin_commission_type', true );
- }
-
- return $category_commision;
+ return '';
}
/**
@@ -3191,6 +3078,8 @@ function dokan_remove_hook_for_anonymous_class( $hook_name = '', $class_name = '
/**
* Dokan get variable product earnings
*
+ * @deprecated 2.9.21
+ *
* @param int $product_id
* @param bool $formated
* @param bool $deprecated
@@ -3364,8 +3253,8 @@ function dokan_privacy_policy_text( $return = false ) {
function dokan_commission_types() {
return apply_filters(
'dokan_commission_types', [
- 'flat' => __( 'Flat', 'dokan-lite' ),
- 'percentage' => __( 'Percentage', 'dokan-lite' ),
+ 'fixed' => __( 'Fixed', 'dokan-lite' ),
+ 'category_based' => __( 'Category Based', 'dokan-lite' ),
]
);
}
diff --git a/includes/wc-template.php b/includes/wc-template.php
index bca7bece9e..9b3b2d5410 100755
--- a/includes/wc-template.php
+++ b/includes/wc-template.php
@@ -217,9 +217,27 @@ function dokan_vendor_quick_edit_data( $column, $post_id ) {
commission->get_earning_by_product( $post_id, 'admin' );
+ echo is_numeric( $commission ) ? wc_price( $commission ) : '';
+
+ break;
+
default:
break;
}
+
+ ?>
+
+ \n"
"Language-Team: LANGUAGE \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"POT-Creation-Date: 2024-11-08T11:44:36+00:00\n"
+"POT-Creation-Date: 2024-11-29T10:41:37+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.11.0\n"
"X-Domain: dokan-lite\n"
@@ -78,7 +78,7 @@ msgstr ""
#: includes/Abstracts/DokanPromotion.php:185
#: includes/Admin/Notices/LimitedTimePromotion.php:50
-#: includes/Admin/Notices/Manager.php:171
+#: includes/Admin/Notices/Manager.php:186
#: includes/Admin/Notices/PluginReview.php:119
#: includes/Admin/Notices/SetupWizard.php:81
msgid "You have no permission to do that"
@@ -86,12 +86,12 @@ msgstr ""
#: includes/Abstracts/DokanPromotion.php:189
#: includes/Admin/Notices/LimitedTimePromotion.php:46
-#: includes/Admin/Notices/Manager.php:166
+#: includes/Admin/Notices/Manager.php:181
#: includes/Admin/Notices/PluginReview.php:115
#: includes/Admin/Notices/SetupWizard.php:77
#: includes/Admin/Notices/WhatsNew.php:74
-#: includes/Admin/Settings.php:98
-#: includes/Admin/Settings.php:124
+#: includes/Admin/Settings.php:120
+#: includes/Admin/Settings.php:146
#: includes/Ajax.php:320
#: includes/ReverseWithdrawal/Ajax.php:37
msgid "Invalid nonce"
@@ -127,9 +127,9 @@ msgstr ""
#: includes/Admin/AdminBar.php:54
#: includes/Admin/Menu.php:46
-#: includes/Admin/Settings.php:671
+#: includes/Admin/Settings.php:749
#: includes/functions-dashboard-navigation.php:30
-#: includes/Install/Installer.php:234
+#: includes/Install/Installer.php:233
#: assets/js/vue-admin.js:2
msgid "Dashboard"
msgstr ""
@@ -137,9 +137,9 @@ msgstr ""
#: includes/Admin/AdminBar.php:63
#: includes/Admin/Menu.php:34
#: includes/Admin/Menu.php:47
-#: includes/Admin/SetupWizard.php:164
+#: includes/Admin/SetupWizard.php:205
#: includes/functions-dashboard-navigation.php:51
-#: includes/functions.php:2878
+#: includes/functions.php:2765
#: templates/withdraw/header.php:11
msgid "Withdraw"
msgstr ""
@@ -196,17 +196,18 @@ msgid "Commision: "
msgstr ""
#: includes/Admin/Hooks.php:66
-#: includes/Admin/Settings.php:513
-#: includes/Admin/Settings.php:524
-#: includes/Admin/Settings.php:535
-#: includes/Admin/SetupWizard.php:366
-#: includes/Install/Installer.php:171
-#: includes/Order/Admin/Hooks.php:92
-#: includes/Order/Admin/Hooks.php:375
+#: includes/Admin/Settings.php:590
+#: includes/Admin/Settings.php:601
+#: includes/Admin/Settings.php:612
+#: includes/Admin/SetupWizard.php:407
+#: includes/Install/Installer.php:170
+#: includes/Order/Admin/Hooks.php:96
+#: includes/Order/Admin/Hooks.php:394
#: includes/wc-template.php:18
#: includes/wc-template.php:164
-#: includes/wc-template.php:311
+#: includes/wc-template.php:329
#: templates/my-orders.php:29
+#: templates/orders/sub-order-related-order-meta-box-html.php:41
#: assets/js/vue-admin.js:2
msgid "Vendor"
msgstr ""
@@ -230,7 +231,7 @@ msgid "Withdraw %s"
msgstr ""
#: includes/Admin/Menu.php:48
-#: includes/Admin/Settings.php:326
+#: includes/Admin/Settings.php:348
#: includes/ReverseWithdrawal/Hooks.php:232
#: templates/reverse-withdrawal/header.php:9
#: assets/js/vue-admin.js:2
@@ -253,20 +254,32 @@ msgid "Help "
msgstr ""
#. translators: %s permalink settings url
-#: includes/Admin/Notices/Manager.php:115
+#: includes/Admin/Notices/Manager.php:116
msgid "The Plain permalink structure is not working for the Dokan plugin. Please change your permalink structure from Settings > Permalinks "
msgstr ""
-#: includes/Admin/Notices/Manager.php:120
+#: includes/Admin/Notices/Manager.php:121
msgid "Go to Settings"
msgstr ""
-#: includes/Admin/Notices/Manager.php:143
-msgid "New One-Step Product Form"
+#: includes/Admin/Notices/Manager.php:146
+msgid "Dokan came up with a new look!"
+msgstr ""
+
+#: includes/Admin/Notices/Manager.php:147
+msgid "A new rebranded look is introduced in the entire platform. Check the updated visuals in different places."
+msgstr ""
+
+#: includes/Admin/Notices/Manager.php:214
+msgid "Dokan Update Required"
+msgstr ""
+
+#: includes/Admin/Notices/Manager.php:215
+msgid "To ensure all the feature compatibility and accessibility, Dokan Pro minimum v3.14.0 is required."
msgstr ""
-#: includes/Admin/Notices/Manager.php:144
-msgid "Try it now to enhance your vendor's product upload experience, the older two-step version will be retired in one month."
+#: includes/Admin/Notices/Manager.php:219
+msgid "Update Now"
msgstr ""
#: includes/Admin/Notices/PluginReview.php:66
@@ -348,7 +361,7 @@ msgid "Get all the latest news and updates of Dokan from here."
msgstr ""
#: includes/Admin/Pointers.php:174
-#: includes/Admin/Settings.php:303
+#: includes/Admin/Settings.php:325
msgid "General Settings"
msgstr ""
@@ -357,7 +370,7 @@ msgid "Configure all general settings for your marketplace from this tab."
msgstr ""
#: includes/Admin/Pointers.php:191
-#: includes/Admin/Settings.php:308
+#: includes/Admin/Settings.php:330
msgid "Selling Options"
msgstr ""
@@ -366,7 +379,7 @@ msgid "You can configure different selling options for your vendors"
msgstr ""
#: includes/Admin/Pointers.php:208
-#: includes/Admin/Settings.php:317
+#: includes/Admin/Settings.php:339
msgid "Withdraw Options"
msgstr ""
@@ -438,613 +451,642 @@ msgstr ""
msgid "With the simplest configuration options available, only by enabling a single toggle button you will be able to do everything your competitors are doing and even more."
msgstr ""
-#: includes/Admin/Settings.php:94
+#: includes/Admin/Settings.php:116
msgid "You have no permission to get settings value"
msgstr ""
-#: includes/Admin/Settings.php:120
-#: includes/Admin/Settings.php:931
+#: includes/Admin/Settings.php:142
+#: includes/Admin/Settings.php:1009
msgid "You are not authorized to perform this action."
msgstr ""
-#: includes/Admin/Settings.php:128
+#: includes/Admin/Settings.php:150
msgid "`section` parameter is required."
msgstr ""
-#: includes/Admin/Settings.php:160
+#: includes/Admin/Settings.php:182
msgid "Setting has been saved successfully."
msgstr ""
-#: includes/Admin/Settings.php:299
+#: includes/Admin/Settings.php:321
#: includes/Vendor/SettingsApi/Settings/Pages/Payments/Payments.php:60
#: includes/Vendor/SettingsApi/Settings/Pages/Store.php:48
msgid "General"
msgstr ""
-#: includes/Admin/Settings.php:301
+#: includes/Admin/Settings.php:323
msgid "Site Settings and Store Options"
msgstr ""
-#: includes/Admin/Settings.php:304
+#: includes/Admin/Settings.php:326
msgid "You can configure your general site settings and vendor store options from this settings menu. Dokan offers countless custom options when setting up your store to provide you with the ultimate flexibility."
msgstr ""
-#: includes/Admin/Settings.php:310
+#: includes/Admin/Settings.php:332
msgid "Store Settings, Commissions"
msgstr ""
-#: includes/Admin/Settings.php:312
+#: includes/Admin/Settings.php:334
msgid "Selling Option Settings"
msgstr ""
-#: includes/Admin/Settings.php:313
+#: includes/Admin/Settings.php:335
msgid "You can configure commissions scales and vendor capabilities from this menu."
msgstr ""
-#: includes/Admin/Settings.php:319
+#: includes/Admin/Settings.php:341
msgid "Withdraw Settings, Threshold"
msgstr ""
-#: includes/Admin/Settings.php:321
+#: includes/Admin/Settings.php:343
msgid "Withdraw Settings"
msgstr ""
-#: includes/Admin/Settings.php:322
+#: includes/Admin/Settings.php:344
msgid "You can configure your store's withdrawal methods, charges, limits, order status and more."
msgstr ""
-#: includes/Admin/Settings.php:328
+#: includes/Admin/Settings.php:350
msgid "Admin commission config (on COD)"
msgstr ""
-#: includes/Admin/Settings.php:330
+#: includes/Admin/Settings.php:352
msgid "Reverse Withdrawal Settings"
msgstr ""
-#: includes/Admin/Settings.php:331
+#: includes/Admin/Settings.php:353
msgid "Configure commission from vendors on Cash on Delivery orders, method and threshold for reverse balance, restrictive actions on vendors and more."
msgstr ""
-#: includes/Admin/Settings.php:335
+#: includes/Admin/Settings.php:357
msgid "Page Settings"
msgstr ""
-#: includes/Admin/Settings.php:337
+#: includes/Admin/Settings.php:359
msgid "Store Page Settings Manage"
msgstr ""
-#: includes/Admin/Settings.php:339
+#: includes/Admin/Settings.php:361
msgid "Site and Store Page Settings"
msgstr ""
-#: includes/Admin/Settings.php:340
+#: includes/Admin/Settings.php:362
msgid "You can configure and setup your necessary page settings from this menu."
msgstr ""
-#: includes/Admin/Settings.php:344
+#: includes/Admin/Settings.php:366
msgid "Appearance"
msgstr ""
-#: includes/Admin/Settings.php:346
+#: includes/Admin/Settings.php:368
msgid "Custom Store Appearance"
msgstr ""
-#: includes/Admin/Settings.php:348
+#: includes/Admin/Settings.php:370
msgid "Appearance Settings"
msgstr ""
-#: includes/Admin/Settings.php:349
+#: includes/Admin/Settings.php:371
msgid "You can configure your store appearance settings, configure map API, Google reCaptcha and more. Dokan offers various store header templates to choose from."
msgstr ""
-#: includes/Admin/Settings.php:353
-#: includes/Admin/Settings.php:867
+#: includes/Admin/Settings.php:375
+#: includes/Admin/Settings.php:945
msgid "Privacy Policy"
msgstr ""
-#: includes/Admin/Settings.php:355
+#: includes/Admin/Settings.php:377
msgid "Update Store Privacy Policies"
msgstr ""
-#: includes/Admin/Settings.php:356
+#: includes/Admin/Settings.php:378
msgid "Privacy Settings"
msgstr ""
-#: includes/Admin/Settings.php:357
+#: includes/Admin/Settings.php:379
msgid "You can configure your site's privacy settings and policy."
msgstr ""
-#: includes/Admin/Settings.php:378
-#: includes/Admin/SetupWizard.php:557
+#: includes/Admin/Settings.php:400
+#: includes/Admin/SetupWizard.php:654
#: includes/Dashboard/Templates/Dashboard.php:104
#: includes/Order/functions.php:430
#: templates/dashboard/orders-widget.php:33
msgid "Completed"
msgstr ""
-#: includes/Admin/Settings.php:379
-#: includes/Admin/SetupWizard.php:564
+#: includes/Admin/Settings.php:401
+#: includes/Admin/SetupWizard.php:661
#: includes/Dashboard/Templates/Dashboard.php:114
#: includes/Order/functions.php:445
#: templates/dashboard/orders-widget.php:43
-#: templates/orders/listing.php:132
+#: templates/orders/listing.php:142
msgid "Processing"
msgstr ""
-#: includes/Admin/Settings.php:380
+#: includes/Admin/Settings.php:402
#: includes/Order/functions.php:440
msgid "On-hold"
msgstr ""
-#: includes/Admin/Settings.php:389
+#: includes/Admin/Settings.php:411
msgid "Site Settings"
msgstr ""
-#: includes/Admin/Settings.php:390
+#: includes/Admin/Settings.php:412
msgid "Configure your site settings and control access to your site."
msgstr ""
-#: includes/Admin/Settings.php:394
+#: includes/Admin/Settings.php:416
msgid "Admin Area Access"
msgstr ""
-#: includes/Admin/Settings.php:395
+#: includes/Admin/Settings.php:417
msgid "Prevent vendors from accessing the wp-admin dashboard area. If HPOS feature is enabled, admin access will be blocked regardless of this setting."
msgstr ""
-#: includes/Admin/Settings.php:401
+#: includes/Admin/Settings.php:423
#: templates/admin-setup-wizard/step-store.php:7
msgid "Vendor Store URL"
msgstr ""
#. translators: %s: store url
-#: includes/Admin/Settings.php:403
+#: includes/Admin/Settings.php:425
msgid "Define the vendor store URL (%s[this-text] /[vendor-name])"
msgstr ""
-#: includes/Admin/Settings.php:409
+#: includes/Admin/Settings.php:431
msgid "Vendor Setup Wizard Logo"
msgstr ""
-#: includes/Admin/Settings.php:411
+#: includes/Admin/Settings.php:433
msgid "Recommended logo size ( 270px X 90px ). If no logo is uploaded, site title is shown by default."
msgstr ""
-#: includes/Admin/Settings.php:415
+#: includes/Admin/Settings.php:437
msgid "Vendor Setup Wizard Message"
msgstr ""
-#: includes/Admin/Settings.php:417
+#: includes/Admin/Settings.php:439
msgid "Thank you for choosing The Marketplace to power your online store! This quick setup wizard will help you configure the basic settings. It’s completely optional and shouldn’t take longer than two minutes. "
msgstr ""
-#: includes/Admin/Settings.php:421
+#: includes/Admin/Settings.php:443
msgid "Disable Welcome Wizard"
msgstr ""
-#: includes/Admin/Settings.php:422
+#: includes/Admin/Settings.php:444
msgid "Disable welcome wizard for newly registered vendors"
msgstr ""
-#: includes/Admin/Settings.php:425
+#: includes/Admin/Settings.php:447
msgid "If checked, vendors will not be prompted through a guided setup process but redirected straight to the vendor dashboard."
msgstr ""
-#: includes/Admin/Settings.php:435
+#: includes/Admin/Settings.php:457
#: includes/Vendor/SettingsApi/Settings/Pages/Store.php:31
msgid "Vendor Store Settings"
msgstr ""
-#: includes/Admin/Settings.php:436
+#: includes/Admin/Settings.php:458
msgid "Configure your vendor store settings and setup your store policy for vendor."
msgstr ""
-#: includes/Admin/Settings.php:441
+#: includes/Admin/Settings.php:463
msgid "Store Terms and Conditions"
msgstr ""
-#: includes/Admin/Settings.php:442
+#: includes/Admin/Settings.php:464
msgid "Enable terms and conditions for vendor stores"
msgstr ""
-#: includes/Admin/Settings.php:448
+#: includes/Admin/Settings.php:470
msgid "Store Products Per Page"
msgstr ""
-#: includes/Admin/Settings.php:449
+#: includes/Admin/Settings.php:471
msgid "Set how many products to display per page on the vendor store page."
msgstr ""
-#: includes/Admin/Settings.php:455
+#: includes/Admin/Settings.php:477
msgid "Enable Address Fields"
msgstr ""
-#: includes/Admin/Settings.php:456
+#: includes/Admin/Settings.php:478
msgid "Add Address Fields on the Vendor Registration form"
msgstr ""
-#: includes/Admin/Settings.php:468
+#: includes/Admin/Settings.php:490
msgid "Product Page Settings"
msgstr ""
-#: includes/Admin/Settings.php:469
+#: includes/Admin/Settings.php:491
msgid "Configure single product page for vendors."
msgstr ""
-#: includes/Admin/Settings.php:474
+#: includes/Admin/Settings.php:496
msgid "Enable More Products Tab"
msgstr ""
-#: includes/Admin/Settings.php:475
+#: includes/Admin/Settings.php:497
msgid "Enable \"More Products\" tab on the single product page."
msgstr ""
-#: includes/Admin/Settings.php:486
+#: includes/Admin/Settings.php:508
+#: includes/Admin/SetupWizard.php:200
+#: includes/functions.php:994
+#: includes/Order/Admin/Hooks.php:95
#: includes/ReverseWithdrawal/Helper.php:65
+#: templates/orders/commission-meta-box-html.php:66
msgid "Commission"
msgstr ""
-#: includes/Admin/Settings.php:488
+#: includes/Admin/Settings.php:510
msgid "Define commission types, admin commissions, shipping and tax recipients, and more."
msgstr ""
-#: includes/Admin/Settings.php:492
+#: includes/Admin/Settings.php:514
msgid "Commission Type "
msgstr ""
-#: includes/Admin/Settings.php:493
+#: includes/Admin/Settings.php:515
msgid "Select a commission type for vendor"
msgstr ""
-#: includes/Admin/Settings.php:497
+#: includes/Admin/Settings.php:519
msgid "Select a commission type"
msgstr ""
-#: includes/Admin/Settings.php:501
-#: templates/admin-setup-wizard/step-selling.php:31
+#: includes/Admin/Settings.php:523
+#: includes/Admin/Settings.php:563
+#: includes/Product/Hooks.php:483
#: assets/js/vue-admin.js:2
-#: assets/js/vue-bootstrap.js:2
msgid "Admin Commission"
msgstr ""
-#: includes/Admin/Settings.php:502
-msgid "Amount you get from each sale"
+#: includes/Admin/Settings.php:528
+msgid "Percent Fee"
msgstr ""
-#: includes/Admin/Settings.php:509
-#: templates/admin-setup-wizard/step-store.php:14
-msgid "Shipping Fee Recipient"
+#: includes/Admin/Settings.php:531
+msgid "Amount you will get from sales in percentage (10%)"
msgstr ""
-#: includes/Admin/Settings.php:510
+#: includes/Admin/Settings.php:538
+msgid "Fixed Fee"
+msgstr ""
+
+#: includes/Admin/Settings.php:541
+msgid "Amount you will get from sales in flat rate(+5)"
+msgstr ""
+
+#: includes/Admin/Settings.php:550
+msgid "Amount you will get from sales in both percentage and fixed fee"
+msgstr ""
+
+#: includes/Admin/Settings.php:564
+msgid "Amount you will get from each sale"
+msgstr ""
+
+#: includes/Admin/Settings.php:579
+msgid "Fee Recipients"
+msgstr ""
+
+#: includes/Admin/Settings.php:581
+msgid "Define the fees that admin or vendor will recive"
+msgstr ""
+
+#: includes/Admin/Settings.php:586
+msgid "Shipping Fee"
+msgstr ""
+
+#: includes/Admin/Settings.php:587
msgid "Who will be receiving the shipping fees? Note that, tax fees for corresponding shipping method will not be included with shipping fees."
msgstr ""
-#: includes/Admin/Settings.php:514
-#: includes/Admin/Settings.php:525
-#: includes/Admin/Settings.php:536
-#: includes/Admin/SetupWizard.php:367
+#: includes/Admin/Settings.php:591
+#: includes/Admin/Settings.php:602
+#: includes/Admin/Settings.php:613
+#: includes/Admin/SetupWizard.php:408
msgid "Admin"
msgstr ""
-#: includes/Admin/Settings.php:520
-#: templates/admin-setup-wizard/step-store.php:27
-msgid "Product Tax Fee Recipient"
+#: includes/Admin/Settings.php:597
+msgid "Product Tax Fee"
msgstr ""
-#: includes/Admin/Settings.php:521
+#: includes/Admin/Settings.php:598
msgid "Who will be receiving the tax fees for products? Note that, shipping tax fees will not be included with product tax."
msgstr ""
-#: includes/Admin/Settings.php:531
-#: templates/admin-setup-wizard/step-store.php:41
-msgid "Shipping Tax Fee Recipient"
+#: includes/Admin/Settings.php:608
+msgid "Shipping Tax Fee"
msgstr ""
-#: includes/Admin/Settings.php:532
+#: includes/Admin/Settings.php:609
msgid "Who will be receiving the tax fees for shipping?"
msgstr ""
-#: includes/Admin/Settings.php:547
+#: includes/Admin/Settings.php:624
#: assets/js/vue-admin.js:2
msgid "Vendor Capabilities"
msgstr ""
-#: includes/Admin/Settings.php:549
+#: includes/Admin/Settings.php:626
msgid "Configure your multivendor site settings and vendor selling capabilities."
msgstr ""
-#: includes/Admin/Settings.php:554
+#: includes/Admin/Settings.php:631
#: assets/js/vue-admin.js:2
#: assets/js/vue-bootstrap.js:2
msgid "Enable Selling"
msgstr ""
-#: includes/Admin/Settings.php:555
+#: includes/Admin/Settings.php:632
msgid "Immediately enable selling for newly registered vendors"
msgstr ""
-#: includes/Admin/Settings.php:558
+#: includes/Admin/Settings.php:635
msgid "If checked, vendors will have permission to sell immediately after registration. If unchecked, newly registered vendors cannot add products until selling capability is activated manually from admin dashboard."
msgstr ""
-#: includes/Admin/Settings.php:562
+#: includes/Admin/Settings.php:639
msgid "One Page Product Creation"
msgstr ""
-#: includes/Admin/Settings.php:563
+#: includes/Admin/Settings.php:640
msgid "Add new product in single page view"
msgstr ""
-#: includes/Admin/Settings.php:566
+#: includes/Admin/Settings.php:643
msgid "If disabled, instead of a single add product page it will open a pop up window or vendor will redirect to product page when adding new product."
msgstr ""
-#: includes/Admin/Settings.php:570
+#: includes/Admin/Settings.php:647
msgid "Disable Product Popup"
msgstr ""
-#: includes/Admin/Settings.php:571
+#: includes/Admin/Settings.php:648
msgid "Disable add new product in popup view"
msgstr ""
-#: includes/Admin/Settings.php:577
+#: includes/Admin/Settings.php:654
msgid "If disabled, instead of a pop up window vendor will redirect to product page when adding new product."
msgstr ""
-#: includes/Admin/Settings.php:581
-#: templates/admin-setup-wizard/step-selling.php:39
+#: includes/Admin/Settings.php:658
+#: templates/admin-setup-wizard/step-selling.php:18
#: assets/js/vue-admin.js:2
msgid "Order Status Change"
msgstr ""
-#: includes/Admin/Settings.php:582
+#: includes/Admin/Settings.php:659
msgid "Allow vendor to update order status"
msgstr ""
-#: includes/Admin/Settings.php:585
+#: includes/Admin/Settings.php:662
msgid "Checking this will enable sellers to change the order status. If unchecked, only admin can change the order status."
msgstr ""
-#: includes/Admin/Settings.php:589
+#: includes/Admin/Settings.php:666
msgid "Select any category"
msgstr ""
-#: includes/Admin/Settings.php:590
+#: includes/Admin/Settings.php:667
msgid "Allow vendors to select any category while creating/editing products."
msgstr ""
-#: includes/Admin/Settings.php:613
-#: includes/Admin/SetupWizard.php:500
+#: includes/Admin/Settings.php:691
+#: includes/Admin/SetupWizard.php:597
msgid "Withdraw Methods"
msgstr ""
-#: includes/Admin/Settings.php:614
+#: includes/Admin/Settings.php:692
msgid "Select suitable withdraw methods for vendors"
msgstr ""
-#: includes/Admin/Settings.php:618
+#: includes/Admin/Settings.php:696
msgid "Check to add available payment methods for vendors to withdraw money."
msgstr ""
-#: includes/Admin/Settings.php:622
+#: includes/Admin/Settings.php:700
msgid "Withdraw Charges"
msgstr ""
-#: includes/Admin/Settings.php:623
+#: includes/Admin/Settings.php:701
msgid "Select suitable withdraw charges for vendors"
msgstr ""
-#: includes/Admin/Settings.php:641
-#: includes/Admin/SetupWizard.php:543
+#: includes/Admin/Settings.php:719
+#: includes/Admin/SetupWizard.php:640
msgid "Minimum Withdraw Limit"
msgstr ""
-#: includes/Admin/Settings.php:642
+#: includes/Admin/Settings.php:720
msgid "Minimum balance required to make a withdraw request. Leave blank to set no minimum limits."
msgstr ""
-#: includes/Admin/Settings.php:651
-#: includes/Admin/SetupWizard.php:550
+#: includes/Admin/Settings.php:729
+#: includes/Admin/SetupWizard.php:647
msgid "Order Status for Withdraw"
msgstr ""
-#: includes/Admin/Settings.php:652
-#: includes/Admin/SetupWizard.php:569
+#: includes/Admin/Settings.php:730
+#: includes/Admin/SetupWizard.php:666
msgid "Order status for which vendor can make a withdraw request."
msgstr ""
-#: includes/Admin/Settings.php:658
+#: includes/Admin/Settings.php:736
msgid "Select the order status that will allow vendors to make withdraw request. We prefer you select \"completed\", \"processing\"."
msgstr ""
-#: includes/Admin/Settings.php:662
+#: includes/Admin/Settings.php:740
msgid "Exclude COD Payments"
msgstr ""
-#: includes/Admin/Settings.php:663
+#: includes/Admin/Settings.php:741
msgid "If an order is paid with Cash on Delivery (COD), then exclude that payment from vendor balance."
msgstr ""
-#: includes/Admin/Settings.php:672
+#: includes/Admin/Settings.php:750
msgid "Select a page to show vendor dashboard"
msgstr ""
-#: includes/Admin/Settings.php:675
-#: includes/Admin/Settings.php:682
-#: includes/Admin/Settings.php:690
-#: includes/Admin/Settings.php:700
-#: includes/Admin/Settings.php:862
+#: includes/Admin/Settings.php:753
+#: includes/Admin/Settings.php:760
+#: includes/Admin/Settings.php:768
+#: includes/Admin/Settings.php:778
+#: includes/Admin/Settings.php:940
msgid "Select page"
msgstr ""
-#: includes/Admin/Settings.php:679
-#: includes/Install/Installer.php:246
+#: includes/Admin/Settings.php:757
+#: includes/Install/Installer.php:245
#: templates/global/header-menu.php:52
msgid "My Orders"
msgstr ""
-#: includes/Admin/Settings.php:680
+#: includes/Admin/Settings.php:758
msgid "Select a page to show my orders"
msgstr ""
-#: includes/Admin/Settings.php:687
+#: includes/Admin/Settings.php:765
msgid "Store Listing"
msgstr ""
-#: includes/Admin/Settings.php:688
+#: includes/Admin/Settings.php:766
msgid "Select a page to show all stores"
msgstr ""
-#: includes/Admin/Settings.php:696
+#: includes/Admin/Settings.php:774
msgid "Select where you want to add Dokan pages."
msgstr ""
-#: includes/Admin/Settings.php:697
+#: includes/Admin/Settings.php:775
msgid "Terms and Conditions Page"
msgstr ""
-#: includes/Admin/Settings.php:699
+#: includes/Admin/Settings.php:777
msgid "Select a page to display the Terms and Conditions of your store for Vendors."
msgstr ""
-#: includes/Admin/Settings.php:707
+#: includes/Admin/Settings.php:785
msgid "Store Appearance"
msgstr ""
-#: includes/Admin/Settings.php:708
+#: includes/Admin/Settings.php:786
msgid "Configure your site appearances."
msgstr ""
-#: includes/Admin/Settings.php:712
+#: includes/Admin/Settings.php:790
msgid "Show map on Store Page"
msgstr ""
-#: includes/Admin/Settings.php:713
+#: includes/Admin/Settings.php:791
msgid "Enable map of the store location in the store sidebar"
msgstr ""
-#: includes/Admin/Settings.php:719
+#: includes/Admin/Settings.php:797
#: templates/admin-setup-wizard/step-store.php:55
msgid "Map API Source"
msgstr ""
-#: includes/Admin/Settings.php:720
+#: includes/Admin/Settings.php:798
msgid "Which map API source you want to use in your site?"
msgstr ""
-#: includes/Admin/Settings.php:725
-#: includes/Admin/SetupWizard.php:381
+#: includes/Admin/Settings.php:803
+#: includes/Admin/SetupWizard.php:422
#: assets/js/vue-admin.js:2
msgid "Google Maps"
msgstr ""
-#: includes/Admin/Settings.php:726
-#: includes/Admin/SetupWizard.php:382
+#: includes/Admin/Settings.php:804
+#: includes/Admin/SetupWizard.php:423
msgid "Mapbox"
msgstr ""
-#: includes/Admin/Settings.php:731
+#: includes/Admin/Settings.php:809
#: templates/admin-setup-wizard/step-store.php:68
msgid "Google Map API Key"
msgstr ""
-#: includes/Admin/Settings.php:732
+#: includes/Admin/Settings.php:810
msgid "API Key is needed to display map on store page"
msgstr ""
-#: includes/Admin/Settings.php:735
+#: includes/Admin/Settings.php:813
msgid "Insert Google API Key (with hyperlink) to display store map."
msgstr ""
-#: includes/Admin/Settings.php:744
+#: includes/Admin/Settings.php:822
#: templates/admin-setup-wizard/step-store.php:84
msgid "Mapbox Access Token"
msgstr ""
-#: includes/Admin/Settings.php:745
+#: includes/Admin/Settings.php:823
msgid "Access Token is needed to display map on store page"
msgstr ""
-#: includes/Admin/Settings.php:748
+#: includes/Admin/Settings.php:826
msgid "Insert Mapbox Access Token (with hyperlink) to display store map."
msgstr ""
#. translators: 1) Opening anchor tag, 2) Closing anchor tag, 3) Opening anchor tag, 4) Closing anchor tag
-#: includes/Admin/Settings.php:760
+#: includes/Admin/Settings.php:838
msgid "%1$sreCAPTCHA%2$s credentials required to enable invisible captcha for contact forms. %3$sGet Help%4$s"
msgstr ""
-#: includes/Admin/Settings.php:766
+#: includes/Admin/Settings.php:844
msgid "Google reCAPTCHA Validation"
msgstr ""
-#: includes/Admin/Settings.php:768
+#: includes/Admin/Settings.php:846
msgid "You can successfully connect to your Google reCaptcha account from here."
msgstr ""
-#: includes/Admin/Settings.php:776
+#: includes/Admin/Settings.php:854
msgid "Site Key"
msgstr ""
-#: includes/Admin/Settings.php:777
+#: includes/Admin/Settings.php:855
msgid "Insert Google reCAPTCHA v3 site key."
msgstr ""
-#: includes/Admin/Settings.php:783
+#: includes/Admin/Settings.php:861
msgid "Secret Key"
msgstr ""
-#: includes/Admin/Settings.php:785
+#: includes/Admin/Settings.php:863
msgid "Insert Google reCAPTCHA v3 secret key."
msgstr ""
-#: includes/Admin/Settings.php:793
+#: includes/Admin/Settings.php:871
msgid "Show Contact Form on Store Page"
msgstr ""
-#: includes/Admin/Settings.php:794
+#: includes/Admin/Settings.php:872
msgid "Display a vendor contact form in the store sidebar"
msgstr ""
-#: includes/Admin/Settings.php:801
+#: includes/Admin/Settings.php:879
msgid "Select a store header for your store."
msgstr ""
-#: includes/Admin/Settings.php:802
+#: includes/Admin/Settings.php:880
msgid "Store Header Template"
msgstr ""
-#: includes/Admin/Settings.php:813
+#: includes/Admin/Settings.php:891
msgid "Store Opening Closing Time Widget"
msgstr ""
-#: includes/Admin/Settings.php:814
+#: includes/Admin/Settings.php:892
msgid "Enable store opening & closing time widget in the store sidebar"
msgstr ""
-#: includes/Admin/Settings.php:820
+#: includes/Admin/Settings.php:898
msgid "Enable Store Sidebar From Theme"
msgstr ""
-#: includes/Admin/Settings.php:821
+#: includes/Admin/Settings.php:899
msgid "Enable showing store sidebar from your theme."
msgstr ""
-#: includes/Admin/Settings.php:827
+#: includes/Admin/Settings.php:905
msgid "Hide Vendor Info"
msgstr ""
-#: includes/Admin/Settings.php:828
+#: includes/Admin/Settings.php:906
msgid "Hide vendor contact info from single store page."
msgstr ""
-#: includes/Admin/Settings.php:836
+#: includes/Admin/Settings.php:914
msgid "Email Address"
msgstr ""
-#: includes/Admin/Settings.php:837
-#: includes/Admin/UserProfile.php:211
+#: includes/Admin/Settings.php:915
+#: includes/Admin/UserProfile.php:208
#: templates/account/update-customer-to-vendor.php:48
#: templates/account/vendor-registration.php:45
#: templates/global/seller-registration-form.php:54
@@ -1053,277 +1095,279 @@ msgstr ""
msgid "Phone Number"
msgstr ""
-#: includes/Admin/Settings.php:838
+#: includes/Admin/Settings.php:916
#: includes/Vendor/SettingsApi/Settings/Pages/Store.php:249
#: includes/Vendor/SettingsApi/Settings/Pages/Store.php:250
msgid "Store Address"
msgstr ""
-#: includes/Admin/Settings.php:843
+#: includes/Admin/Settings.php:921
msgid "Disable Dokan FontAwesome"
msgstr ""
-#: includes/Admin/Settings.php:844
+#: includes/Admin/Settings.php:922
msgid "If disabled then dokan fontawesome library won't be loaded in frontend"
msgstr ""
-#: includes/Admin/Settings.php:852
+#: includes/Admin/Settings.php:930
msgid "Enable Privacy Policy"
msgstr ""
-#: includes/Admin/Settings.php:854
+#: includes/Admin/Settings.php:932
msgid "Enable privacy policy for vendor store contact form"
msgstr ""
-#: includes/Admin/Settings.php:859
+#: includes/Admin/Settings.php:937
msgid "Privacy Page"
msgstr ""
-#: includes/Admin/Settings.php:861
+#: includes/Admin/Settings.php:939
msgid "Select a page to show your privacy policy"
msgstr ""
-#: includes/Admin/Settings.php:869
-#: includes/functions.php:3342
+#: includes/Admin/Settings.php:947
+#: includes/functions.php:3231
msgid "Your personal data will be used to support your experience throughout this website, to manage access to your account, and for other purposes described in our [dokan_privacy_policy]"
msgstr ""
-#: includes/Admin/Settings.php:870
+#: includes/Admin/Settings.php:948
msgid "Customize the Privacy Policy text that will be displayed on your store."
msgstr ""
-#: includes/Admin/Settings.php:942
+#: includes/Admin/Settings.php:1020
msgid "Both section and field params are required."
msgstr ""
-#: includes/Admin/Settings.php:951
+#: includes/Admin/Settings.php:1029
msgid "No filter found to refresh the setting options"
msgstr ""
-#: includes/Admin/Settings.php:983
+#: includes/Admin/Settings.php:1061
msgid "Minimum Withdraw Limit can't be negative value."
msgstr ""
-#: includes/Admin/Settings.php:994
+#: includes/Admin/Settings.php:1072
#: includes/ReverseWithdrawal/Admin/Settings.php:223
msgid "Validation error"
msgstr ""
-#: includes/Admin/Settings.php:1012
+#: includes/Admin/Settings.php:1090
msgid "Data Clear"
msgstr ""
-#: includes/Admin/Settings.php:1013
+#: includes/Admin/Settings.php:1091
msgid "Delete all data and tables related to Dokan and Dokan Pro plugin while deleting the Dokan plugin."
msgstr ""
-#: includes/Admin/Settings.php:1016
+#: includes/Admin/Settings.php:1094
msgid "Check this to remove Dokan related data and table from the database upon deleting the plugin. When you delete the Dokan lite version, it will also delete all the data related to Dokan Pro as well. This won't happen when the plugins are deactivated.."
msgstr ""
-#: includes/Admin/SetupWizard.php:76
+#: includes/Admin/SetupWizard.php:78
msgctxt "enhanced select"
msgid "No matches found"
msgstr ""
-#: includes/Admin/SetupWizard.php:77
+#: includes/Admin/SetupWizard.php:79
msgctxt "enhanced select"
msgid "Loading failed"
msgstr ""
-#: includes/Admin/SetupWizard.php:78
+#: includes/Admin/SetupWizard.php:80
msgctxt "enhanced select"
msgid "Please enter 1 or more characters"
msgstr ""
-#: includes/Admin/SetupWizard.php:79
+#: includes/Admin/SetupWizard.php:81
msgctxt "enhanced select"
msgid "Please enter %qty% or more characters"
msgstr ""
-#: includes/Admin/SetupWizard.php:80
+#: includes/Admin/SetupWizard.php:82
msgctxt "enhanced select"
msgid "Please delete 1 character"
msgstr ""
-#: includes/Admin/SetupWizard.php:81
+#: includes/Admin/SetupWizard.php:83
msgctxt "enhanced select"
msgid "Please delete %qty% characters"
msgstr ""
-#: includes/Admin/SetupWizard.php:82
+#: includes/Admin/SetupWizard.php:84
msgctxt "enhanced select"
msgid "You can only select 1 item"
msgstr ""
-#: includes/Admin/SetupWizard.php:83
+#: includes/Admin/SetupWizard.php:85
msgctxt "enhanced select"
msgid "You can only select %qty% items"
msgstr ""
-#: includes/Admin/SetupWizard.php:84
+#: includes/Admin/SetupWizard.php:86
msgctxt "enhanced select"
msgid "Loading more results…"
msgstr ""
-#: includes/Admin/SetupWizard.php:85
+#: includes/Admin/SetupWizard.php:87
msgctxt "enhanced select"
msgid "Searching…"
msgstr ""
-#: includes/Admin/SetupWizard.php:150
+#: includes/Admin/SetupWizard.php:186
#: includes/Vendor/SetupWizard.php:78
msgid "Introduction"
msgstr ""
-#: includes/Admin/SetupWizard.php:154
+#: includes/Admin/SetupWizard.php:190
#: includes/functions-dashboard-navigation.php:67
#: includes/Vendor/SetupWizard.php:83
#: assets/js/vue-admin.js:2
msgid "Store"
msgstr ""
-#: includes/Admin/SetupWizard.php:159
-#: includes/Admin/UserProfile.php:301
+#: includes/Admin/SetupWizard.php:195
+#: includes/Admin/UserProfile.php:298
msgid "Selling"
msgstr ""
-#: includes/Admin/SetupWizard.php:169
+#: includes/Admin/SetupWizard.php:210
msgid "Recommended"
msgstr ""
-#: includes/Admin/SetupWizard.php:174
+#: includes/Admin/SetupWizard.php:215
#: includes/Vendor/SetupWizard.php:93
msgid "Ready!"
msgstr ""
-#: includes/Admin/SetupWizard.php:271
+#: includes/Admin/SetupWizard.php:312
msgid "Dokan › Setup Wizard"
msgstr ""
-#: includes/Admin/SetupWizard.php:291
+#: includes/Admin/SetupWizard.php:332
#: includes/Admin/SetupWizardNoWC.php:95
msgid "Return to the WordPress Dashboard"
msgstr ""
-#: includes/Admin/SetupWizard.php:340
+#: includes/Admin/SetupWizard.php:381
#: templates/admin-setup-wizard/step-no-wc-introduction.php:2
msgid "Welcome to the world of Dokan!"
msgstr ""
-#: includes/Admin/SetupWizard.php:341
+#: includes/Admin/SetupWizard.php:382
msgid "Thank you for choosing Dokan to power your online marketplace! This quick setup wizard will help you configure the basic settings. It’s completely optional and shouldn’t take longer than three minutes. "
msgstr ""
-#: includes/Admin/SetupWizard.php:342
+#: includes/Admin/SetupWizard.php:383
msgid "No time right now? If you don’t want to go through the wizard, you can skip and return to the WordPress dashboard. Come back anytime if you change your mind!"
msgstr ""
-#: includes/Admin/SetupWizard.php:344
+#: includes/Admin/SetupWizard.php:385
#: includes/Vendor/SetupWizard.php:191
#: templates/admin-setup-wizard/step-no-wc-introduction.php:74
msgid "Let's Go!"
msgstr ""
-#: includes/Admin/SetupWizard.php:345
+#: includes/Admin/SetupWizard.php:386
#: includes/Vendor/SetupWizard.php:192
msgid "Not right now"
msgstr ""
-#: includes/Admin/SetupWizard.php:496
+#: includes/Admin/SetupWizard.php:593
msgid "Withdraw Setup"
msgstr ""
#. translators: %s: withdraw method name
-#: includes/Admin/SetupWizard.php:518
+#: includes/Admin/SetupWizard.php:615
msgid "Enable %s for your vendor as a withdraw method"
msgstr ""
-#: includes/Admin/SetupWizard.php:546
+#: includes/Admin/SetupWizard.php:643
msgid "Minimum balance required to make a withdraw request ( Leave it blank to set no limits )"
msgstr ""
-#: includes/Admin/SetupWizard.php:574
-#: includes/Admin/SetupWizard.php:657
+#: includes/Admin/SetupWizard.php:671
+#: includes/Admin/SetupWizard.php:754
#: includes/Admin/SetupWizardWCAdmin.php:232
#: includes/Vendor/SetupWizard.php:368
#: includes/Vendor/SetupWizard.php:575
-#: templates/admin-setup-wizard/step-selling.php:53
+#: templates/admin-setup-wizard/step-commission.php:12
+#: templates/admin-setup-wizard/step-selling.php:32
#: templates/admin-setup-wizard/step-store.php:153
msgid "Continue"
msgstr ""
-#: includes/Admin/SetupWizard.php:575
+#: includes/Admin/SetupWizard.php:672
#: includes/Vendor/SetupWizard.php:370
#: includes/Vendor/SetupWizard.php:577
-#: templates/admin-setup-wizard/step-selling.php:54
+#: templates/admin-setup-wizard/step-commission.php:13
+#: templates/admin-setup-wizard/step-selling.php:33
#: templates/admin-setup-wizard/step-store.php:154
msgid "Skip this step"
msgstr ""
-#: includes/Admin/SetupWizard.php:591
+#: includes/Admin/SetupWizard.php:688
msgid "Recommended for All Dokan Marketplaces"
msgstr ""
-#: includes/Admin/SetupWizard.php:593
+#: includes/Admin/SetupWizard.php:690
msgid "Enhance your store with these recommended features."
msgstr ""
-#: includes/Admin/SetupWizard.php:603
-#: includes/Admin/SetupWizard.php:609
-#: includes/Admin/SetupWizard.php:682
+#: includes/Admin/SetupWizard.php:700
+#: includes/Admin/SetupWizard.php:706
+#: includes/Admin/SetupWizard.php:779
msgid "WooCommerce Conversion Tracking"
msgstr ""
-#: includes/Admin/SetupWizard.php:604
+#: includes/Admin/SetupWizard.php:701
msgid "Track conversions on your WooCommerce store like a pro!"
msgstr ""
-#: includes/Admin/SetupWizard.php:606
+#: includes/Admin/SetupWizard.php:703
msgid "WooCommerce Conversion Tracking logo"
msgstr ""
-#: includes/Admin/SetupWizard.php:621
-#: includes/Admin/SetupWizard.php:627
-#: includes/Admin/SetupWizard.php:693
+#: includes/Admin/SetupWizard.php:718
+#: includes/Admin/SetupWizard.php:724
+#: includes/Admin/SetupWizard.php:790
msgid "weMail"
msgstr ""
-#: includes/Admin/SetupWizard.php:622
+#: includes/Admin/SetupWizard.php:719
msgid "Simplified Email Marketing Solution for WordPress!"
msgstr ""
-#: includes/Admin/SetupWizard.php:624
+#: includes/Admin/SetupWizard.php:721
msgid "weMail logo"
msgstr ""
-#: includes/Admin/SetupWizard.php:639
-#: includes/Admin/SetupWizard.php:645
-#: includes/Admin/SetupWizard.php:704
+#: includes/Admin/SetupWizard.php:736
+#: includes/Admin/SetupWizard.php:742
+#: includes/Admin/SetupWizard.php:801
msgid "Texty"
msgstr ""
-#: includes/Admin/SetupWizard.php:640
+#: includes/Admin/SetupWizard.php:737
msgid "SMS Notification for WordPress, WooCommerce, Dokan and more"
msgstr ""
-#: includes/Admin/SetupWizard.php:642
+#: includes/Admin/SetupWizard.php:739
msgid "Texty logo"
msgstr ""
-#: includes/Admin/SetupWizard.php:767
+#: includes/Admin/SetupWizard.php:864
msgid "Your Marketplace is Ready!"
msgstr ""
-#: includes/Admin/SetupWizard.php:772
+#: includes/Admin/SetupWizard.php:869
msgid "Visit Dokan Dashboard"
msgstr ""
-#: includes/Admin/SetupWizard.php:773
+#: includes/Admin/SetupWizard.php:870
msgid "More Settings"
msgstr ""
-#: includes/Admin/SetupWizard.php:899
+#: includes/Admin/SetupWizard.php:996
msgid "The following plugins will be installed and activated for you:"
msgstr ""
@@ -1407,20 +1451,20 @@ msgstr ""
#: includes/Admin/UserProfile.php:38
#: includes/Ajax.php:142
-#: includes/Assets.php:588
+#: includes/Assets.php:604
#: assets/js/vue-admin.js:2
#: assets/js/vue-bootstrap.js:2
msgid "Available"
msgstr ""
#: includes/Admin/UserProfile.php:39
-#: includes/Assets.php:589
+#: includes/Assets.php:605
#: assets/js/vue-admin.js:2
#: assets/js/vue-bootstrap.js:2
msgid "Not Available"
msgstr ""
-#: includes/Admin/UserProfile.php:87
+#: includes/Admin/UserProfile.php:84
#: includes/Privacy.php:226
#: includes/Vendor/SettingsApi/Settings/Pages/Store.php:218
#: includes/Vendor/SetupWizard.php:294
@@ -1430,98 +1474,98 @@ msgstr ""
msgid "Country"
msgstr ""
-#: includes/Admin/UserProfile.php:91
+#: includes/Admin/UserProfile.php:88
#: includes/Vendor/SettingsApi/Settings/Pages/Store.php:222
msgid "Select a country…"
msgstr ""
-#: includes/Admin/UserProfile.php:94
+#: includes/Admin/UserProfile.php:91
msgid "State/County"
msgstr ""
-#: includes/Admin/UserProfile.php:95
+#: includes/Admin/UserProfile.php:92
msgid "State/County or state code"
msgstr ""
-#: includes/Admin/UserProfile.php:100
+#: includes/Admin/UserProfile.php:97
msgid "Dokan Options"
msgstr ""
-#: includes/Admin/UserProfile.php:105
+#: includes/Admin/UserProfile.php:102
msgid "Banner"
msgstr ""
-#: includes/Admin/UserProfile.php:117
+#: includes/Admin/UserProfile.php:114
#: templates/settings/store-form.php:72
msgid "Upload banner"
msgstr ""
#. translators: %1$s: banner width, %2$s: banner height in integers
#. translators: 1) store banner width 2) store banner height
-#: includes/Admin/UserProfile.php:122
+#: includes/Admin/UserProfile.php:119
#: templates/settings/store-form.php:86
msgid "Upload a banner for your store. Banner size is (%1$sx%2$s) pixels."
msgstr ""
-#: includes/Admin/UserProfile.php:134
+#: includes/Admin/UserProfile.php:131
#: includes/REST/ReverseWithdrawalController.php:679
msgid "Store name"
msgstr ""
-#: includes/Admin/UserProfile.php:141
+#: includes/Admin/UserProfile.php:138
#: assets/js/vue-admin.js:2
#: assets/js/vue-bootstrap.js:2
msgid "Store URL"
msgstr ""
-#: includes/Admin/UserProfile.php:149
+#: includes/Admin/UserProfile.php:146
#: includes/Privacy.php:222
msgid "Address 1"
msgstr ""
-#: includes/Admin/UserProfile.php:156
+#: includes/Admin/UserProfile.php:153
#: includes/Privacy.php:223
msgid "Address 2"
msgstr ""
-#: includes/Admin/UserProfile.php:163
+#: includes/Admin/UserProfile.php:160
msgid "Town/City"
msgstr ""
-#: includes/Admin/UserProfile.php:170
+#: includes/Admin/UserProfile.php:167
#: includes/Vendor/SettingsApi/Settings/Pages/Store.php:210
msgid "Zip Code"
msgstr ""
-#: includes/Admin/UserProfile.php:236
+#: includes/Admin/UserProfile.php:233
msgid "Payment Options : "
msgstr ""
-#: includes/Admin/UserProfile.php:241
+#: includes/Admin/UserProfile.php:238
msgid "Paypal Email "
msgstr ""
-#: includes/Admin/UserProfile.php:249
+#: includes/Admin/UserProfile.php:246
msgid "Skrill Email "
msgstr ""
-#: includes/Admin/UserProfile.php:258
+#: includes/Admin/UserProfile.php:255
msgid "Bank name "
msgstr ""
-#: includes/Admin/UserProfile.php:264
+#: includes/Admin/UserProfile.php:261
msgid "Account Name "
msgstr ""
-#: includes/Admin/UserProfile.php:270
+#: includes/Admin/UserProfile.php:267
msgid "Account Number "
msgstr ""
-#: includes/Admin/UserProfile.php:276
+#: includes/Admin/UserProfile.php:273
msgid "Bank Address "
msgstr ""
-#: includes/Admin/UserProfile.php:282
+#: includes/Admin/UserProfile.php:279
#: includes/Privacy.php:278
#: includes/Vendor/SettingsApi/Settings/Pages/Payments/Gateways/Bank.php:83
#: includes/Withdraw/functions.php:297
@@ -1531,59 +1575,43 @@ msgstr ""
msgid "Routing Number"
msgstr ""
-#: includes/Admin/UserProfile.php:288
+#: includes/Admin/UserProfile.php:285
msgid "Bank IBAN "
msgstr ""
-#: includes/Admin/UserProfile.php:294
+#: includes/Admin/UserProfile.php:291
msgid "Bank Swift "
msgstr ""
-#: includes/Admin/UserProfile.php:306
+#: includes/Admin/UserProfile.php:303
msgid "Enable Adding Products"
msgstr ""
-#: includes/Admin/UserProfile.php:309
+#: includes/Admin/UserProfile.php:306
msgid "Enable or disable product adding capability"
msgstr ""
-#: includes/Admin/UserProfile.php:314
+#: includes/Admin/UserProfile.php:311
msgid "Publishing"
msgstr ""
-#: includes/Admin/UserProfile.php:319
+#: includes/Admin/UserProfile.php:316
msgid "Publish product directly"
msgstr ""
-#: includes/Admin/UserProfile.php:322
+#: includes/Admin/UserProfile.php:319
msgid "Bypass pending, publish products directly"
msgstr ""
-#: includes/Admin/UserProfile.php:327
-msgid "Admin Commission Type "
-msgstr ""
-
-#: includes/Admin/UserProfile.php:334
-msgid "Set the commmission type admin gets from this seller"
-msgstr ""
-
-#: includes/Admin/UserProfile.php:338
-msgid "Admin Commission "
-msgstr ""
-
-#: includes/Admin/UserProfile.php:342
-msgid "It will override the default commission admin gets from each sales"
-msgstr ""
-
-#: includes/Admin/UserProfile.php:347
+#: includes/Admin/UserProfile.php:324
msgid "Featured vendor"
msgstr ""
-#: includes/Admin/UserProfile.php:352
+#: includes/Admin/UserProfile.php:329
msgid "Mark as featured vendor"
msgstr ""
-#: includes/Admin/UserProfile.php:355
+#: includes/Admin/UserProfile.php:332
msgid "This vendor will be marked as a featured vendor."
msgstr ""
@@ -1608,7 +1636,8 @@ msgstr ""
#: includes/Product/functions.php:215
#: templates/my-orders.php:27
#: templates/orders/listing.php:33
-#: templates/orders/listing.php:83
+#: templates/orders/listing.php:93
+#: templates/orders/sub-order-related-order-meta-box-html.php:39
#: templates/products/products-listing-row.php:140
#: templates/products/products-listing.php:121
#: templates/sub-orders.php:47
@@ -1632,9 +1661,10 @@ msgstr ""
#: includes/Admin/WithdrawLogExporter.php:116
#: templates/my-orders.php:26
#: templates/orders/listing.php:35
-#: templates/orders/listing.php:93
-#: templates/products/products-listing-row.php:280
-#: templates/products/products-listing.php:130
+#: templates/orders/listing.php:103
+#: templates/orders/sub-order-related-order-meta-box-html.php:38
+#: templates/products/products-listing-row.php:290
+#: templates/products/products-listing.php:131
#: templates/reverse-withdrawal/transaction-listing.php:19
#: templates/sub-orders.php:46
#: templates/withdraw/approved-request-listing.php:20
@@ -1782,7 +1812,7 @@ msgid "reCAPTCHA verification failed!"
msgstr ""
#: includes/Ajax.php:359
-#: includes/REST/StoreController.php:831
+#: includes/REST/StoreController.php:838
msgid "Email sent successfully!"
msgstr ""
@@ -1810,7 +1840,7 @@ msgid "Delete"
msgstr ""
#: includes/Ajax.php:529
-#: includes/Product/Hooks.php:53
+#: includes/Product/Hooks.php:58
msgid "Error: Nonce verification failed"
msgstr ""
@@ -1838,101 +1868,102 @@ msgstr ""
msgid "id param is required"
msgstr ""
-#: includes/Assets.php:148
+#: includes/Assets.php:151
msgid "Could not find any vendor."
msgstr ""
-#: includes/Assets.php:149
+#: includes/Assets.php:152
msgid "Searching vendors"
msgstr ""
-#: includes/Assets.php:150
+#: includes/Assets.php:153
msgid "Search vendors"
msgstr ""
-#: includes/Assets.php:151
+#: includes/Assets.php:154
msgid "Are you sure ?"
msgstr ""
-#: includes/Assets.php:591
+#: includes/Assets.php:607
#: includes/Product/functions.php:504
#: templates/products/products-listing.php:109
+#: assets/js/dokan-admin-notice.js:2
#: assets/js/dokan-promo-notice.js:2
#: assets/js/vue-admin.js:2
#: assets/js/vue-bootstrap.js:2
msgid "Are you sure?"
msgstr ""
-#: includes/Assets.php:592
+#: includes/Assets.php:608
msgid "Something went wrong. Please try again."
msgstr ""
-#: includes/Assets.php:606
+#: includes/Assets.php:622
msgid "Are you sure you want to revoke access to this download?"
msgstr ""
-#: includes/Assets.php:607
+#: includes/Assets.php:623
msgid "Could not grant access - the user may already have permission for this file or billing email is not set. Ensure the billing email is set, and the order has been saved."
msgstr ""
-#: includes/Assets.php:737
+#: includes/Assets.php:753
msgctxt "time constant"
msgid "am"
msgstr ""
-#: includes/Assets.php:738
+#: includes/Assets.php:754
msgctxt "time constant"
msgid "pm"
msgstr ""
-#: includes/Assets.php:739
+#: includes/Assets.php:755
msgctxt "time constant"
msgid "AM"
msgstr ""
-#: includes/Assets.php:740
+#: includes/Assets.php:756
msgctxt "time constant"
msgid "PM"
msgstr ""
-#: includes/Assets.php:741
+#: includes/Assets.php:757
msgctxt "time constant"
msgid "hr"
msgstr ""
-#: includes/Assets.php:742
+#: includes/Assets.php:758
msgctxt "time constant"
msgid "hrs"
msgstr ""
-#: includes/Assets.php:743
+#: includes/Assets.php:759
msgctxt "time constant"
msgid "mins"
msgstr ""
-#: includes/Assets.php:746
-#: templates/products/edit-product-single.php:338
+#: includes/Assets.php:762
+#: templates/products/edit-product-single.php:368
#: templates/products/new-product.php:252
-#: templates/products/tmpl-add-product-popup.php:88
+#: templates/products/tmpl-add-product-popup.php:87
msgid "To"
msgstr ""
-#: includes/Assets.php:748
-#: templates/products/edit-product-single.php:331
+#: includes/Assets.php:764
+#: templates/products/edit-product-single.php:361
#: templates/products/new-product.php:245
-#: templates/products/tmpl-add-product-popup.php:81
+#: templates/products/tmpl-add-product-popup.php:80
msgid "From"
msgstr ""
-#: includes/Assets.php:749
+#: includes/Assets.php:765
msgid " - "
msgstr ""
-#: includes/Assets.php:750
+#: includes/Assets.php:766
msgid "W"
msgstr ""
-#: includes/Assets.php:751
+#: includes/Assets.php:767
#: templates/orders/listing.php:20
#: templates/products/products-listing.php:108
#: templates/store-lists-filter.php:84
@@ -1940,100 +1971,100 @@ msgstr ""
msgid "Apply"
msgstr ""
-#: includes/Assets.php:752
+#: includes/Assets.php:768
#: assets/js/vue-admin.js:2
msgid "Clear"
msgstr ""
-#: includes/Assets.php:753
+#: includes/Assets.php:769
#: includes/Withdraw/Hooks.php:68
msgid "Custom"
msgstr ""
-#: includes/Assets.php:755
+#: includes/Assets.php:771
msgid "Su"
msgstr ""
-#: includes/Assets.php:756
+#: includes/Assets.php:772
msgid "Mo"
msgstr ""
-#: includes/Assets.php:757
+#: includes/Assets.php:773
msgid "Tu"
msgstr ""
-#: includes/Assets.php:758
+#: includes/Assets.php:774
msgid "We"
msgstr ""
-#: includes/Assets.php:759
+#: includes/Assets.php:775
msgid "Th"
msgstr ""
-#: includes/Assets.php:760
+#: includes/Assets.php:776
msgid "Fr"
msgstr ""
-#: includes/Assets.php:761
+#: includes/Assets.php:777
msgid "Sa"
msgstr ""
-#: includes/Assets.php:764
+#: includes/Assets.php:780
msgid "January"
msgstr ""
-#: includes/Assets.php:765
+#: includes/Assets.php:781
msgid "February"
msgstr ""
-#: includes/Assets.php:766
+#: includes/Assets.php:782
msgid "March"
msgstr ""
-#: includes/Assets.php:767
+#: includes/Assets.php:783
msgid "April"
msgstr ""
-#: includes/Assets.php:768
+#: includes/Assets.php:784
msgid "May"
msgstr ""
-#: includes/Assets.php:769
+#: includes/Assets.php:785
msgid "June"
msgstr ""
-#: includes/Assets.php:770
+#: includes/Assets.php:786
msgid "July"
msgstr ""
-#: includes/Assets.php:771
+#: includes/Assets.php:787
msgid "August"
msgstr ""
-#: includes/Assets.php:772
+#: includes/Assets.php:788
msgid "September"
msgstr ""
-#: includes/Assets.php:773
+#: includes/Assets.php:789
msgid "October"
msgstr ""
-#: includes/Assets.php:774
+#: includes/Assets.php:790
msgid "November"
msgstr ""
-#: includes/Assets.php:775
+#: includes/Assets.php:791
msgid "December"
msgstr ""
-#: includes/Assets.php:779
-#: includes/Assets.php:1051
+#: includes/Assets.php:795
+#: includes/Assets.php:1067
#: includes/Product/functions.php:310
#: templates/my-orders.php:95
#: templates/orders/details.php:196
-#: templates/products/edit-product-single.php:302
+#: templates/products/edit-product-single.php:332
#: templates/products/new-product.php:232
-#: templates/products/tmpl-add-product-popup.php:68
+#: templates/products/tmpl-add-product-popup.php:67
#: templates/settings/bank-payment-method-settings.php:203
#: templates/store-lists-filter.php:83
#: templates/withdraw/pending-request-listing-dashboard.php:24
@@ -2041,25 +2072,26 @@ msgstr ""
#: templates/withdraw/pending-request-listing.php:19
#: templates/withdraw/pending-request-listing.php:39
#: templates/withdraw/pending-request-listing.php:63
+#: assets/js/dokan-admin-notice.js:2
#: assets/js/dokan-promo-notice.js:2
#: assets/js/vue-admin.js:2
#: assets/js/vue-bootstrap.js:2
msgid "Cancel"
msgstr ""
-#: includes/Assets.php:780
+#: includes/Assets.php:796
#: includes/Product/functions.php:321
#: templates/orders/details.php:347
#: templates/settings/store-form.php:38
msgid "Close"
msgstr ""
-#: includes/Assets.php:781
-#: includes/Assets.php:1050
+#: includes/Assets.php:797
+#: includes/Assets.php:1066
msgid "OK"
msgstr ""
-#: includes/Assets.php:782
+#: includes/Assets.php:798
#: includes/Vendor/SettingsApi/Settings/Pages/Store.php:283
#: includes/Vendor/SettingsApi/Settings/Pages/Store.php:430
#: includes/Vendor/SettingsApi/Settings/Pages/Store.php:446
@@ -2069,312 +2101,312 @@ msgstr ""
msgid "No"
msgstr ""
-#: includes/Assets.php:783
+#: includes/Assets.php:799
msgid "Close this dialog"
msgstr ""
-#: includes/Assets.php:798
+#: includes/Assets.php:814
msgid "This field is required"
msgstr ""
-#: includes/Assets.php:799
+#: includes/Assets.php:815
msgid "Please fix this field."
msgstr ""
-#: includes/Assets.php:800
+#: includes/Assets.php:816
msgid "Please enter a valid email address."
msgstr ""
-#: includes/Assets.php:801
+#: includes/Assets.php:817
msgid "Please enter a valid URL."
msgstr ""
-#: includes/Assets.php:802
+#: includes/Assets.php:818
msgid "Please enter a valid date."
msgstr ""
-#: includes/Assets.php:803
+#: includes/Assets.php:819
msgid "Please enter a valid date (ISO)."
msgstr ""
-#: includes/Assets.php:804
+#: includes/Assets.php:820
msgid "Please enter a valid number."
msgstr ""
-#: includes/Assets.php:805
+#: includes/Assets.php:821
msgid "Please enter only digits."
msgstr ""
-#: includes/Assets.php:806
+#: includes/Assets.php:822
msgid "Please enter a valid credit card number."
msgstr ""
-#: includes/Assets.php:807
+#: includes/Assets.php:823
msgid "Please enter the same value again."
msgstr ""
-#: includes/Assets.php:808
+#: includes/Assets.php:824
msgid "Please enter no more than {0} characters."
msgstr ""
-#: includes/Assets.php:809
+#: includes/Assets.php:825
msgid "Please enter at least {0} characters."
msgstr ""
-#: includes/Assets.php:810
+#: includes/Assets.php:826
msgid "Please enter a value between {0} and {1} characters long."
msgstr ""
-#: includes/Assets.php:811
+#: includes/Assets.php:827
msgid "Please enter a value between {0} and {1}."
msgstr ""
-#: includes/Assets.php:812
+#: includes/Assets.php:828
msgid "Please enter a value less than or equal to {0}."
msgstr ""
-#: includes/Assets.php:813
+#: includes/Assets.php:829
msgid "Please enter a value greater than or equal to {0}."
msgstr ""
-#: includes/Assets.php:975
+#: includes/Assets.php:991
msgid "Upload featured image"
msgstr ""
-#: includes/Assets.php:976
+#: includes/Assets.php:992
msgid "Choose a file"
msgstr ""
-#: includes/Assets.php:977
+#: includes/Assets.php:993
msgid "Add Images to Product Gallery"
msgstr ""
-#: includes/Assets.php:978
+#: includes/Assets.php:994
msgid "Set featured image"
msgstr ""
-#: includes/Assets.php:979
+#: includes/Assets.php:995
#: includes/woo-views/html-product-download.php:8
msgid "Insert file URL"
msgstr ""
-#: includes/Assets.php:980
+#: includes/Assets.php:996
msgid "Add to gallery"
msgstr ""
-#: includes/Assets.php:981
+#: includes/Assets.php:997
msgid "Sorry, this attribute option already exists, Try a different one."
msgstr ""
-#: includes/Assets.php:982
+#: includes/Assets.php:998
msgid "Warning! This product will not have any variations if this option is not checked."
msgstr ""
-#: includes/Assets.php:983
+#: includes/Assets.php:999
msgid "Enter a name for the new attribute term:"
msgstr ""
-#: includes/Assets.php:984
+#: includes/Assets.php:1000
msgid "Remove this attribute?"
msgstr ""
#. translators: %d: max linked variation.
-#: includes/Assets.php:993
+#: includes/Assets.php:1009
msgid "Are you sure you want to link all variations? This will create a new variation for each and every possible combination of variation attributes (max %d per run)."
msgstr ""
-#: includes/Assets.php:994
+#: includes/Assets.php:1010
msgid "Enter a value"
msgstr ""
-#: includes/Assets.php:995
+#: includes/Assets.php:1011
msgid "Variation menu order (determines position in the list of variations)"
msgstr ""
-#: includes/Assets.php:996
+#: includes/Assets.php:1012
msgid "Enter a value (fixed or %)"
msgstr ""
-#: includes/Assets.php:997
+#: includes/Assets.php:1013
msgid "Are you sure you want to delete all variations? This cannot be undone."
msgstr ""
-#: includes/Assets.php:998
+#: includes/Assets.php:1014
msgid "Last warning, are you sure?"
msgstr ""
-#: includes/Assets.php:999
+#: includes/Assets.php:1015
msgid "Choose an image"
msgstr ""
-#: includes/Assets.php:1000
+#: includes/Assets.php:1016
msgid "Set variation image"
msgstr ""
-#: includes/Assets.php:1001
+#: includes/Assets.php:1017
msgid "variation added"
msgstr ""
-#: includes/Assets.php:1002
+#: includes/Assets.php:1018
msgid "variations added"
msgstr ""
-#: includes/Assets.php:1003
+#: includes/Assets.php:1019
msgid "No variations added"
msgstr ""
-#: includes/Assets.php:1004
+#: includes/Assets.php:1020
msgid "Are you sure you want to remove this variation?"
msgstr ""
-#: includes/Assets.php:1005
+#: includes/Assets.php:1021
msgid "Sale start date (YYYY-MM-DD format or leave blank)"
msgstr ""
-#: includes/Assets.php:1006
+#: includes/Assets.php:1022
msgid "Sale end date (YYYY-MM-DD format or leave blank)"
msgstr ""
-#: includes/Assets.php:1007
+#: includes/Assets.php:1023
msgid "Save changes before changing page?"
msgstr ""
-#: includes/Assets.php:1008
+#: includes/Assets.php:1024
msgid "%qty% variation"
msgstr ""
-#: includes/Assets.php:1009
+#: includes/Assets.php:1025
msgid "%qty% variations"
msgstr ""
-#: includes/Assets.php:1010
+#: includes/Assets.php:1026
msgid "No Result Found"
msgstr ""
-#: includes/Assets.php:1011
+#: includes/Assets.php:1027
msgid "Please insert value less than the regular price!"
msgstr ""
#. translators: %s: decimal
-#: includes/Assets.php:1013
-#: includes/Assets.php:1193
+#: includes/Assets.php:1029
+#: includes/Assets.php:1209
msgid "Please enter with one decimal point (%s) without thousand separators."
msgstr ""
#. translators: %s: price decimal separator
-#: includes/Assets.php:1015
-#: includes/Assets.php:1195
+#: includes/Assets.php:1031
+#: includes/Assets.php:1211
msgid "Please enter with one monetary decimal point (%s) without thousand separators and currency symbols."
msgstr ""
-#: includes/Assets.php:1016
-#: includes/Assets.php:1196
+#: includes/Assets.php:1032
+#: includes/Assets.php:1212
msgid "Please enter in country code with two capital letters."
msgstr ""
-#: includes/Assets.php:1017
-#: includes/Assets.php:1197
+#: includes/Assets.php:1033
+#: includes/Assets.php:1213
msgid "Please enter in a value less than the regular price."
msgstr ""
-#: includes/Assets.php:1018
-#: includes/Assets.php:1198
+#: includes/Assets.php:1034
+#: includes/Assets.php:1214
msgid "This product has produced sales and may be linked to existing orders. Are you sure you want to delete it?"
msgstr ""
-#: includes/Assets.php:1019
-#: includes/Assets.php:1199
+#: includes/Assets.php:1035
+#: includes/Assets.php:1215
msgid "This action cannot be reversed. Are you sure you wish to erase personal data from the selected orders?"
msgstr ""
-#: includes/Assets.php:1029
+#: includes/Assets.php:1045
msgid "Select and Crop"
msgstr ""
-#: includes/Assets.php:1030
+#: includes/Assets.php:1046
msgid "Choose Image"
msgstr ""
-#: includes/Assets.php:1031
+#: includes/Assets.php:1047
msgid "Product title is required"
msgstr ""
-#: includes/Assets.php:1032
+#: includes/Assets.php:1048
msgid "Product category is required"
msgstr ""
-#: includes/Assets.php:1033
+#: includes/Assets.php:1049
msgid "Product created successfully"
msgstr ""
-#: includes/Assets.php:1037
+#: includes/Assets.php:1053
msgid "One result is available, press enter to select it."
msgstr ""
-#: includes/Assets.php:1038
+#: includes/Assets.php:1054
msgid "%qty% results are available, use up and down arrow keys to navigate."
msgstr ""
-#: includes/Assets.php:1039
+#: includes/Assets.php:1055
msgid "No matches found"
msgstr ""
-#: includes/Assets.php:1040
+#: includes/Assets.php:1056
msgid "Loading failed"
msgstr ""
-#: includes/Assets.php:1041
+#: includes/Assets.php:1057
msgid "Please enter 1 or more characters"
msgstr ""
-#: includes/Assets.php:1042
+#: includes/Assets.php:1058
msgid "Please enter %qty% or more characters"
msgstr ""
-#: includes/Assets.php:1043
+#: includes/Assets.php:1059
msgid "Please delete 1 character"
msgstr ""
-#: includes/Assets.php:1044
+#: includes/Assets.php:1060
msgid "Please delete %qty% characters"
msgstr ""
-#: includes/Assets.php:1045
+#: includes/Assets.php:1061
msgid "You can only select 1 item"
msgstr ""
-#: includes/Assets.php:1046
+#: includes/Assets.php:1062
msgid "You can only select %qty% items"
msgstr ""
-#: includes/Assets.php:1047
+#: includes/Assets.php:1063
msgid "Loading more results…"
msgstr ""
-#: includes/Assets.php:1048
+#: includes/Assets.php:1064
msgid "Searching…"
msgstr ""
-#: includes/Assets.php:1049
+#: includes/Assets.php:1065
msgid "Calculating"
msgstr ""
-#: includes/Assets.php:1052
+#: includes/Assets.php:1068
msgid "Attribute Name"
msgstr ""
-#: includes/Assets.php:1054
+#: includes/Assets.php:1070
msgid "Are you sure? You have uploaded banner but didn't click the Update Settings button!"
msgstr ""
-#: includes/Assets.php:1055
+#: includes/Assets.php:1071
#: templates/settings/header.php:20
#: templates/settings/payment-manage.php:48
#: templates/settings/store-form.php:270
msgid "Update Settings"
msgstr ""
-#: includes/Assets.php:1057
+#: includes/Assets.php:1073
msgid "Please enter 3 or more characters"
msgstr ""
@@ -2411,16 +2443,16 @@ msgid "Allow"
msgstr ""
#: includes/Blocks/ProductBlock.php:40
-#: templates/products/edit-product-single.php:361
+#: templates/products/edit-product-single.php:384
#: templates/products/new-product.php:271
-#: templates/products/tmpl-add-product-popup.php:19
+#: templates/products/tmpl-add-product-popup.php:18
msgid "Select tags/Add tags"
msgstr ""
#: includes/Blocks/ProductBlock.php:40
-#: templates/products/edit-product-single.php:361
+#: templates/products/edit-product-single.php:384
#: templates/products/new-product.php:271
-#: templates/products/tmpl-add-product-popup.php:19
+#: templates/products/tmpl-add-product-popup.php:18
msgid "Select product tags"
msgstr ""
@@ -2479,23 +2511,31 @@ msgstr ""
msgid "Check to hide product price from your products."
msgstr ""
-#. translators: %s: Geteway fee
-#: includes/Commission.php:116
-msgid "Payment gateway processing fee %s"
-msgstr ""
-
-#: includes/Commission.php:238
+#: includes/Commission.php:174
#: includes/REST/ProductBlockController.php:69
msgid "Product not found"
msgstr ""
-#: includes/Commission.php:268
+#: includes/Commission.php:211
msgid "Order not found"
msgstr ""
-#: includes/Commission.php:771
-#: includes/Commission.php:803
-msgid "Please provide a valid order object."
+#: includes/Commission.php:539
+msgid "Combine"
+msgstr ""
+
+#: includes/Commission.php:540
+#: assets/js/dokan-setup-wizard-commission.js:1
+#: assets/js/vue-admin.js:2
+#: assets/js/vue-bootstrap.js:2
+msgid "Percentage"
+msgstr ""
+
+#: includes/Commission.php:541
+#: assets/js/dokan-setup-wizard-commission.js:1
+#: assets/js/vue-admin.js:2
+#: assets/js/vue-bootstrap.js:2
+msgid "Flat"
msgstr ""
#. translators: 1) page number
@@ -2589,7 +2629,7 @@ msgid "Show store opening/closing Time"
msgstr ""
#: includes/Customizer.php:392
-#: includes/Install/Installer.php:240
+#: includes/Install/Installer.php:239
msgid "Store List"
msgstr ""
@@ -3287,6 +3327,16 @@ msgstr ""
msgid "Withdrawal request for {amount} is cancelled"
msgstr ""
+#. translators: %s: Geteway fee
+#: includes/Fees.php:112
+msgid "Payment gateway processing fee %s"
+msgstr ""
+
+#: includes/Fees.php:168
+#: includes/Fees.php:201
+msgid "Please provide a valid order object."
+msgstr ""
+
#: includes/Frontend/MyAccount/BecomeAVendor.php:82
#: includes/Frontend/MyAccount/BecomeAVendor.php:166
msgid "You need to login before applying for vendor."
@@ -3314,7 +3364,7 @@ msgid "You are an administrator. Please use dokan admin settings to enable your
msgstr ""
#: includes/functions-dashboard-navigation.php:37
-#: includes/functions.php:1284
+#: includes/functions.php:1199
#: templates/dashboard/products-widget.php:22
#: assets/js/vue-admin.js:2
msgid "Products"
@@ -3365,540 +3415,550 @@ msgstr ""
msgid "No store found with given store id"
msgstr ""
-#: includes/functions.php:768
+#: includes/functions.php:682
msgid "Online"
msgstr ""
-#: includes/functions.php:769
+#: includes/functions.php:683
#: includes/Order/functions.php:464
msgid "Draft"
msgstr ""
-#: includes/functions.php:770
+#: includes/functions.php:684
#: templates/dashboard/products-widget.php:47
#: templates/withdraw/pending-request-listing-dashboard.php:52
#: templates/withdraw/pending-request-listing.php:45
msgid "Pending Review"
msgstr ""
-#: includes/functions.php:771
-#: templates/products/products-listing-row.php:319
+#: includes/functions.php:685
+#: templates/products/products-listing-row.php:329
msgid "Scheduled"
msgstr ""
-#: includes/functions.php:840
+#: includes/functions.php:754
msgid "Simple Product"
msgstr ""
-#: includes/functions.php:841
+#: includes/functions.php:755
#: assets/js/vue-admin.js:2
msgid "Variable Product"
msgstr ""
-#: includes/functions.php:842
+#: includes/functions.php:756
msgid "Grouped Product"
msgstr ""
-#: includes/functions.php:843
+#: includes/functions.php:757
msgid "External/Affiliate Product"
msgstr ""
-#: includes/functions.php:1080
+#: includes/functions.php:995
msgid "Author"
msgstr ""
-#: includes/functions.php:1288
+#: includes/functions.php:1203
#: includes/Vendor/SettingsApi/Settings/Pages/Store.php:518
#: templates/settings/store-form.php:195
msgid "Terms and Conditions"
msgstr ""
#. translators: 1) bank account name
-#: includes/functions.php:1328
+#: includes/functions.php:1243
#: assets/js/vue-admin.js:2
msgid "Account Name: %s"
msgstr ""
#. translators: 1) bank account number
-#: includes/functions.php:1333
+#: includes/functions.php:1248
#: assets/js/vue-admin.js:2
msgid "Account Number: %s"
msgstr ""
#. translators: 1) bank name
-#: includes/functions.php:1338
+#: includes/functions.php:1253
#: assets/js/vue-admin.js:2
msgid "Bank Name: %s"
msgstr ""
#. translators: 1) bank address
-#: includes/functions.php:1343
+#: includes/functions.php:1258
msgid "Address: %s"
msgstr ""
#. translators: 1) bank routing number
-#: includes/functions.php:1348
+#: includes/functions.php:1263
#: assets/js/vue-admin.js:2
msgid "Routing Number: %s"
msgstr ""
#. translators: 1) bank iban
-#: includes/functions.php:1353
+#: includes/functions.php:1268
#: assets/js/vue-admin.js:2
msgid "IBAN: %s"
msgstr ""
#. translators: 1) bank swift
-#: includes/functions.php:1358
+#: includes/functions.php:1273
msgid "SWIFT: %s"
msgstr ""
-#: includes/functions.php:1713
+#: includes/functions.php:1628
msgid "Date is not valid"
msgstr ""
-#: includes/functions.php:2079
+#: includes/functions.php:1994
msgid "- Select a location -"
msgstr ""
-#: includes/functions.php:2083
-#: includes/functions.php:2107
+#: includes/functions.php:1998
+#: includes/functions.php:2022
msgid "Everywhere Else"
msgstr ""
-#: includes/functions.php:2103
+#: includes/functions.php:2018
msgid "- Select a State -"
msgstr ""
-#: includes/functions.php:2126
+#: includes/functions.php:2041
msgid "Ready to ship in..."
msgstr ""
-#: includes/functions.php:2127
+#: includes/functions.php:2042
msgid "1 business day"
msgstr ""
-#: includes/functions.php:2128
+#: includes/functions.php:2043
msgid "1-2 business days"
msgstr ""
-#: includes/functions.php:2129
+#: includes/functions.php:2044
msgid "1-3 business days"
msgstr ""
-#: includes/functions.php:2130
+#: includes/functions.php:2045
msgid "3-5 business days"
msgstr ""
-#: includes/functions.php:2131
+#: includes/functions.php:2046
msgid "1-2 weeks"
msgstr ""
-#: includes/functions.php:2132
+#: includes/functions.php:2047
msgid "2-3 weeks"
msgstr ""
-#: includes/functions.php:2133
+#: includes/functions.php:2048
msgid "3-4 weeks"
msgstr ""
-#: includes/functions.php:2134
+#: includes/functions.php:2049
msgid "4-6 weeks"
msgstr ""
-#: includes/functions.php:2135
+#: includes/functions.php:2050
msgid "6-8 weeks"
msgstr ""
-#: includes/functions.php:2235
+#: includes/functions.php:2150
msgid "All dates"
msgstr ""
#. translators: 1: month name, 2: 4-digit year
-#: includes/functions.php:2250
-#: includes/REST/ProductControllerV2.php:198
+#: includes/functions.php:2165
+#: includes/REST/ProductControllerV2.php:200
msgid "%1$s %2$d"
msgstr ""
-#: includes/functions.php:2265
-#: includes/REST/ProductControllerV2.php:236
+#: includes/functions.php:2180
+#: includes/REST/ProductControllerV2.php:238
#: templates/products/edit-product-single.php:257
-#: templates/products/products-listing-row.php:237
-#: templates/products/products-listing.php:138
+#: templates/products/products-listing-row.php:247
+#: templates/products/products-listing.php:139
msgid "Simple"
msgstr ""
-#: includes/functions.php:2348
+#: includes/functions.php:2263
#: includes/Privacy.php:201
#: assets/js/vue-bootstrap.js:2
msgid "Facebook"
msgstr ""
-#: includes/functions.php:2352
+#: includes/functions.php:2267
#: includes/Privacy.php:202
#: assets/js/vue-bootstrap.js:2
msgid "Twitter"
msgstr ""
-#: includes/functions.php:2356
+#: includes/functions.php:2271
#: includes/Privacy.php:203
#: assets/js/vue-bootstrap.js:2
msgid "Pinterest"
msgstr ""
-#: includes/functions.php:2360
+#: includes/functions.php:2275
msgid "LinkedIn"
msgstr ""
-#: includes/functions.php:2364
+#: includes/functions.php:2279
#: includes/Privacy.php:205
#: assets/js/vue-bootstrap.js:2
msgid "Youtube"
msgstr ""
-#: includes/functions.php:2368
+#: includes/functions.php:2283
#: includes/Privacy.php:206
#: assets/js/vue-bootstrap.js:2
msgid "Instagram"
msgstr ""
-#: includes/functions.php:2372
+#: includes/functions.php:2287
#: includes/Privacy.php:207
#: assets/js/vue-bootstrap.js:2
msgid "Flickr"
msgstr ""
-#: includes/functions.php:2376
+#: includes/functions.php:2291
msgid "Threads"
msgstr ""
-#: includes/functions.php:2642
+#: includes/functions.php:2557
msgid "Dokan Store Sidebar"
msgstr ""
-#: includes/functions.php:2799
+#: includes/functions.php:2686
msgid "View sales overview"
msgstr ""
-#: includes/functions.php:2800
+#: includes/functions.php:2687
msgid "View sales report chart"
msgstr ""
-#: includes/functions.php:2801
+#: includes/functions.php:2688
msgid "View announcement"
msgstr ""
-#: includes/functions.php:2802
+#: includes/functions.php:2689
msgid "View order report"
msgstr ""
-#: includes/functions.php:2803
+#: includes/functions.php:2690
msgid "View review report"
msgstr ""
-#: includes/functions.php:2804
+#: includes/functions.php:2691
msgid "View product status report"
msgstr ""
-#: includes/functions.php:2807
+#: includes/functions.php:2694
msgid "View overview report"
msgstr ""
-#: includes/functions.php:2808
+#: includes/functions.php:2695
msgid "View daily sales report"
msgstr ""
-#: includes/functions.php:2809
+#: includes/functions.php:2696
msgid "View top selling report"
msgstr ""
-#: includes/functions.php:2810
+#: includes/functions.php:2697
msgid "View top earning report"
msgstr ""
-#: includes/functions.php:2811
+#: includes/functions.php:2698
msgid "View statement report"
msgstr ""
-#: includes/functions.php:2814
+#: includes/functions.php:2701
msgid "View order"
msgstr ""
-#: includes/functions.php:2815
+#: includes/functions.php:2702
msgid "Manage order"
msgstr ""
-#: includes/functions.php:2816
+#: includes/functions.php:2703
msgid "Manage order note"
msgstr ""
-#: includes/functions.php:2817
+#: includes/functions.php:2704
msgid "Manage refund"
msgstr ""
-#: includes/functions.php:2818
+#: includes/functions.php:2705
msgid "Export order"
msgstr ""
-#: includes/functions.php:2821
+#: includes/functions.php:2708
msgid "Add coupon"
msgstr ""
-#: includes/functions.php:2822
+#: includes/functions.php:2709
msgid "Edit coupon"
msgstr ""
-#: includes/functions.php:2823
+#: includes/functions.php:2710
msgid "Delete coupon"
msgstr ""
-#: includes/functions.php:2826
+#: includes/functions.php:2713
msgid "View reviews"
msgstr ""
-#: includes/functions.php:2827
+#: includes/functions.php:2714
#: assets/js/vue-admin.js:2
msgid "Manage reviews"
msgstr ""
-#: includes/functions.php:2831
+#: includes/functions.php:2718
msgid "Manage withdraw"
msgstr ""
-#: includes/functions.php:2834
+#: includes/functions.php:2721
msgid "Add product"
msgstr ""
-#: includes/functions.php:2835
+#: includes/functions.php:2722
msgid "Edit product"
msgstr ""
-#: includes/functions.php:2836
+#: includes/functions.php:2723
msgid "Delete product"
msgstr ""
-#: includes/functions.php:2837
+#: includes/functions.php:2724
msgid "View product"
msgstr ""
-#: includes/functions.php:2838
+#: includes/functions.php:2725
msgid "Duplicate product"
msgstr ""
-#: includes/functions.php:2839
+#: includes/functions.php:2726
msgid "Import product"
msgstr ""
-#: includes/functions.php:2840
+#: includes/functions.php:2727
msgid "Export product"
msgstr ""
-#: includes/functions.php:2843
+#: includes/functions.php:2730
msgid "View overview menu"
msgstr ""
-#: includes/functions.php:2844
+#: includes/functions.php:2731
msgid "View product menu"
msgstr ""
-#: includes/functions.php:2845
+#: includes/functions.php:2732
msgid "View order menu"
msgstr ""
-#: includes/functions.php:2846
+#: includes/functions.php:2733
msgid "View coupon menu"
msgstr ""
-#: includes/functions.php:2847
+#: includes/functions.php:2734
msgid "View report menu"
msgstr ""
-#: includes/functions.php:2848
+#: includes/functions.php:2735
msgid "View review menu"
msgstr ""
-#: includes/functions.php:2849
+#: includes/functions.php:2736
msgid "View withdraw menu"
msgstr ""
-#: includes/functions.php:2850
+#: includes/functions.php:2737
msgid "View store settings menu"
msgstr ""
-#: includes/functions.php:2851
+#: includes/functions.php:2738
msgid "View payment settings menu"
msgstr ""
-#: includes/functions.php:2852
+#: includes/functions.php:2739
msgid "View shipping settings menu"
msgstr ""
-#: includes/functions.php:2853
+#: includes/functions.php:2740
msgid "View social settings menu"
msgstr ""
-#: includes/functions.php:2854
+#: includes/functions.php:2741
msgid "View seo settings menu"
msgstr ""
-#: includes/functions.php:2873
+#: includes/functions.php:2760
#: assets/js/vue-admin.js:2
msgid "Overview"
msgstr ""
-#: includes/functions.php:2874
+#: includes/functions.php:2761
msgid "Report"
msgstr ""
-#: includes/functions.php:2875
+#: includes/functions.php:2762
#: templates/dashboard/big-counter-widget.php:29
#: templates/my-orders.php:25
#: templates/orders/details.php:19
#: templates/orders/listing.php:30
#: templates/orders/listing.php:57
+#: templates/orders/sub-order-related-order-meta-box-html.php:37
#: templates/sub-orders.php:45
#: assets/js/vue-admin.js:2
msgid "Order"
msgstr ""
-#: includes/functions.php:2876
+#: includes/functions.php:2763
msgid "Coupon"
msgstr ""
-#: includes/functions.php:2877
+#: includes/functions.php:2764
msgid "Review"
msgstr ""
-#: includes/functions.php:2879
+#: includes/functions.php:2766
#: templates/emails/vendor-completed-order.php:54
#: templates/emails/vendor-new-order.php:53
#: assets/js/vue-admin.js:2
msgid "Product"
msgstr ""
-#: includes/functions.php:2880
+#: includes/functions.php:2767
msgid "Menu"
msgstr ""
-#: includes/functions.php:3009
+#: includes/functions.php:2896
#: includes/Vendor/SettingsApi/Settings/Pages/Store.php:350
msgid "Sunday"
msgstr ""
-#: includes/functions.php:3010
+#: includes/functions.php:2897
#: includes/Vendor/SettingsApi/Settings/Pages/Store.php:302
msgid "Monday"
msgstr ""
-#: includes/functions.php:3011
+#: includes/functions.php:2898
#: includes/Vendor/SettingsApi/Settings/Pages/Store.php:310
msgid "Tuesday"
msgstr ""
-#: includes/functions.php:3012
+#: includes/functions.php:2899
#: includes/Vendor/SettingsApi/Settings/Pages/Store.php:318
msgid "Wednesday"
msgstr ""
-#: includes/functions.php:3013
+#: includes/functions.php:2900
#: includes/Vendor/SettingsApi/Settings/Pages/Store.php:326
msgid "Thursday"
msgstr ""
-#: includes/functions.php:3014
+#: includes/functions.php:2901
#: includes/Vendor/SettingsApi/Settings/Pages/Store.php:334
msgid "Friday"
msgstr ""
-#: includes/functions.php:3015
+#: includes/functions.php:2902
#: includes/Vendor/SettingsApi/Settings/Pages/Store.php:342
msgid "Saturday"
msgstr ""
-#: includes/functions.php:3020
+#: includes/functions.php:2907
msgid "Sun"
msgstr ""
-#: includes/functions.php:3021
+#: includes/functions.php:2908
msgid "Mon"
msgstr ""
-#: includes/functions.php:3022
+#: includes/functions.php:2909
msgid "Tue"
msgstr ""
-#: includes/functions.php:3023
+#: includes/functions.php:2910
msgid "Wed"
msgstr ""
-#: includes/functions.php:3024
+#: includes/functions.php:2911
msgid "Thu"
msgstr ""
-#: includes/functions.php:3025
+#: includes/functions.php:2912
msgid "Fri"
msgstr ""
-#: includes/functions.php:3026
+#: includes/functions.php:2913
msgid "Sat"
msgstr ""
-#: includes/functions.php:3320
+#: includes/functions.php:3209
msgid "privacy policy"
msgstr ""
-#: includes/functions.php:3367
-#: assets/js/vue-admin.js:2
-#: assets/js/vue-bootstrap.js:2
-msgid "Flat"
+#: includes/functions.php:3256
+msgid "Fixed"
msgstr ""
-#: includes/functions.php:3368
-#: assets/js/vue-admin.js:2
-#: assets/js/vue-bootstrap.js:2
-msgid "Percentage"
+#: includes/functions.php:3257
+msgid "Category Based"
msgstr ""
#. translators: 1) plugin slug
-#: includes/functions.php:3542
+#: includes/functions.php:3431
msgid "Unable to fetch plugin information from wordpress.org for %s."
msgstr ""
#. translators: 1) plugin slug
-#: includes/functions.php:3555
+#: includes/functions.php:3444
msgid "Unable to install %s from wordpress.org"
msgstr ""
-#: includes/Order/Admin/Hooks.php:93
+#: includes/Order/Admin/Hooks.php:97
#: assets/js/vue-admin.js:2
msgid "Actions"
msgstr ""
-#: includes/Order/Admin/Hooks.php:94
+#: includes/Order/Admin/Hooks.php:98
msgid "Sub Order"
msgstr ""
-#: includes/Order/Admin/Hooks.php:133
+#: includes/Order/Admin/Hooks.php:137
msgid " Sub Order of"
msgstr ""
-#: includes/Order/Admin/Hooks.php:141
+#: includes/Order/Admin/Hooks.php:145
msgid "Show Sub-Orders"
msgstr ""
-#: includes/Order/Admin/Hooks.php:141
+#: includes/Order/Admin/Hooks.php:145
msgid "Hide Sub-Orders"
msgstr ""
-#: includes/Order/Admin/Hooks.php:154
+#: includes/Order/Admin/Hooks.php:158
+#: templates/orders/sub-order-related-order-meta-box-html.php:96
#: assets/js/vue-admin.js:2
msgid "(no name)"
msgstr ""
-#: includes/Order/Admin/Hooks.php:513
+#: includes/Order/Admin/Hooks.php:532
msgid "Toggle Sub-orders"
msgstr ""
+#: includes/Order/Admin/Hooks.php:558
+msgid "Commissions"
+msgstr ""
+
+#: includes/Order/Admin/Hooks.php:568
+msgid "Sub orders"
+msgstr ""
+
+#: includes/Order/Admin/Hooks.php:568
+msgid "Related orders"
+msgstr ""
+
#: includes/Order/EmailHooks.php:145
msgid "Your {site_title} order receipt from {order_date}"
msgstr ""
@@ -4496,7 +4556,7 @@ msgid "Catalog"
msgstr ""
#: includes/Product/functions.php:363
-#: includes/Product/Hooks.php:190
+#: includes/Product/Hooks.php:195
#: templates/products/listing-filter.php:85
msgid "Search"
msgstr ""
@@ -4513,7 +4573,7 @@ msgstr ""
#: includes/Product/functions.php:510
#: templates/my-orders.php:101
-#: templates/orders/listing.php:150
+#: templates/orders/listing.php:160
#: templates/sub-orders.php:99
msgid "View"
msgstr ""
@@ -4546,27 +4606,34 @@ msgstr ""
msgid "Relevance"
msgstr ""
-#: includes/Product/Hooks.php:60
+#: includes/Product/Hooks.php:65
msgid "Products not found with this search"
msgstr ""
-#: includes/Product/Hooks.php:149
+#: includes/Product/Hooks.php:154
+#: templates/orders/commission-meta-box-html.php:111
msgid "SKU:"
msgstr ""
-#: includes/Product/Hooks.php:186
+#: includes/Product/Hooks.php:191
msgid "Enter product name"
msgstr ""
-#: includes/Product/Hooks.php:194
+#: includes/Product/Hooks.php:199
msgid "Shop order"
msgstr ""
-#: includes/Product/Hooks.php:412
+#: includes/Product/Hooks.php:417
msgid "As this is your own product, the \"Add to Cart\" button has been removed. Please visit as a guest to view it."
msgstr ""
-#: includes/Product/Manager.php:472
+#: includes/Product/Hooks.php:487
+#: includes/Product/Hooks.php:488
+#: assets/js/vue-admin.js:2
+msgid "When the value is 0, no commissions will be deducted from this vendor."
+msgstr ""
+
+#: includes/Product/Manager.php:474
msgid "No product ID found for updating"
msgstr ""
@@ -4578,11 +4645,11 @@ msgstr ""
msgid "Show vendor information on single product page"
msgstr ""
-#: includes/ProductCategory/Helper.php:244
+#: includes/ProductCategory/Helper.php:248
msgid "Select a category"
msgstr ""
-#: includes/ProductCategory/Helper.php:245
+#: includes/ProductCategory/Helper.php:249
msgid "This category has already been selected"
msgstr ""
@@ -4696,15 +4763,48 @@ msgstr ""
msgid "Untitled"
msgstr ""
+#: includes/REST/AdminMiscController.php:48
+msgid "Dokan setting section"
+msgstr ""
+
+#: includes/REST/AdminMiscController.php:54
+msgid "Dokan setting section key"
+msgstr ""
+
+#: includes/REST/AdminNoticeController.php:42
+msgid "Choose notice scope: \"local\" displays only on Dokan pages, \"global\" displays across the entire site."
+msgstr ""
+
#: includes/REST/AdminReportController.php:145
#: templates/dashboard/orders-widget.php:28
#: templates/dashboard/products-widget.php:32
#: templates/my-orders.php:28
#: templates/orders/order-fee-html.php:24
+#: templates/orders/sub-order-related-order-meta-box-html.php:40
#: templates/sub-orders.php:51
msgid "Total"
msgstr ""
+#: includes/REST/CommissionControllerV1.php:42
+msgid "Products price"
+msgstr ""
+
+#: includes/REST/CommissionControllerV1.php:49
+msgid "The amount on that the commission will be calculated."
+msgstr ""
+
+#: includes/REST/CommissionControllerV1.php:56
+msgid "Vendor id"
+msgstr ""
+
+#: includes/REST/CommissionControllerV1.php:63
+msgid "Category ids"
+msgstr ""
+
+#: includes/REST/CommissionControllerV1.php:74
+msgid "In which context the commission will be calculated"
+msgstr ""
+
#: includes/REST/DummyDataController.php:171
msgid "Vendors products data."
msgstr ""
@@ -5915,47 +6015,47 @@ msgstr ""
msgid "Price formatted in HTML."
msgstr ""
-#: includes/REST/ProductControllerV2.php:124
+#: includes/REST/ProductControllerV2.php:126
msgid "Products author id"
msgstr ""
-#: includes/REST/ProductControllerV2.php:132
+#: includes/REST/ProductControllerV2.php:134
msgid "Product status publish, pending, draft etc."
msgstr ""
-#: includes/REST/ProductControllerV2.php:140
+#: includes/REST/ProductControllerV2.php:142
msgid "Products publish month"
msgstr ""
-#: includes/REST/ProductControllerV2.php:148
+#: includes/REST/ProductControllerV2.php:150
msgid "Products category."
msgstr ""
-#: includes/REST/ProductControllerV2.php:156
+#: includes/REST/ProductControllerV2.php:158
msgid "Products type simple, variable, grouped product etc."
msgstr ""
-#: includes/REST/ProductControllerV2.php:164
+#: includes/REST/ProductControllerV2.php:166
msgid "Products stock status in stock or out of stock."
msgstr ""
-#: includes/REST/ProductControllerV2.php:172
+#: includes/REST/ProductControllerV2.php:174
msgid "Best selling, featured products etc."
msgstr ""
-#: includes/REST/ProductControllerV2.php:302
+#: includes/REST/ProductControllerV2.php:304
msgid "All product created months."
msgstr ""
-#: includes/REST/ProductControllerV2.php:309
+#: includes/REST/ProductControllerV2.php:311
msgid "Product publish year."
msgstr ""
-#: includes/REST/ProductControllerV2.php:313
+#: includes/REST/ProductControllerV2.php:315
msgid "Product publish month."
msgstr ""
-#: includes/REST/ProductControllerV2.php:317
+#: includes/REST/ProductControllerV2.php:319
msgid "Product publish month and year full title."
msgstr ""
@@ -6134,7 +6234,7 @@ msgid "Invalid user ID for reassignment."
msgstr ""
#: includes/REST/StoreController.php:538
-#: includes/REST/StoreController.php:934
+#: includes/REST/StoreController.php:941
msgid "No store found"
msgstr ""
@@ -6143,36 +6243,36 @@ msgstr ""
msgid "No reviews found"
msgstr ""
-#: includes/REST/StoreController.php:760
+#: includes/REST/StoreController.php:767
msgid "This email address is not valid"
msgstr ""
-#: includes/REST/StoreController.php:803
+#: includes/REST/StoreController.php:810
msgid "No vendor is found to be send an email."
msgstr ""
-#: includes/REST/StoreController.php:850
+#: includes/REST/StoreController.php:857
msgid "Status parameter must be active or inactive"
msgstr ""
-#: includes/REST/StoreController.php:856
+#: includes/REST/StoreController.php:863
msgid "No vendor found for updating status"
msgstr ""
-#: includes/REST/StoreController.php:884
+#: includes/REST/StoreController.php:891
msgid "No items found for bulk updating"
msgstr ""
-#: includes/REST/StoreController.php:953
+#: includes/REST/StoreController.php:975
msgid "Status of the store"
msgstr ""
-#: includes/REST/StoreController.php:960
+#: includes/REST/StoreController.php:982
msgid "Store List Order By"
msgstr ""
-#: includes/REST/StoreController.php:966
-#: includes/REST/StoreController.php:972
+#: includes/REST/StoreController.php:988
+#: includes/REST/StoreController.php:994
msgid "Store List Order"
msgstr ""
@@ -6727,35 +6827,35 @@ msgid "Dokan Data Update Required"
msgstr ""
#: includes/Upgrade/AdminNotice.php:40
-msgid "We need to update your install to the latest version"
+msgid "Updating your Dokan data is required to continue functional operations."
msgstr ""
-#: includes/Upgrade/AdminNotice.php:45
+#: includes/Upgrade/AdminNotice.php:46
#: templates/orders/details.php:194
msgid "Update"
msgstr ""
-#: includes/Upgrade/AdminNotice.php:46
+#: includes/Upgrade/AdminNotice.php:47
msgid "Updating..."
msgstr ""
-#: includes/Upgrade/AdminNotice.php:47
+#: includes/Upgrade/AdminNotice.php:48
msgid "Updated"
msgstr ""
-#: includes/Upgrade/AdminNotice.php:49
+#: includes/Upgrade/AdminNotice.php:50
msgid "It is strongly recommended that you backup your database before proceeding. Are you sure you wish to run the updater now?"
msgstr ""
-#: includes/Upgrade/AdminNotice.php:73
+#: includes/Upgrade/AdminNotice.php:74
msgid "You are not authorize to perform this operation."
msgstr ""
-#: includes/Upgrade/AdminNotice.php:77
+#: includes/Upgrade/AdminNotice.php:78
msgid "There is an upgrading process going on."
msgstr ""
-#: includes/Upgrade/AdminNotice.php:81
+#: includes/Upgrade/AdminNotice.php:82
msgid "Update is not required."
msgstr ""
@@ -7133,14 +7233,14 @@ msgstr ""
#: includes/Vendor/SettingsApi/Settings/Pages/Store.php:535
#: templates/admin-setup-wizard/step-selling.php:9
-#: templates/admin-setup-wizard/step-selling.php:43
+#: templates/admin-setup-wizard/step-selling.php:22
#: templates/admin-setup-wizard/step-store.php:105
msgid "On"
msgstr ""
#: includes/Vendor/SettingsApi/Settings/Pages/Store.php:536
#: templates/admin-setup-wizard/step-selling.php:10
-#: templates/admin-setup-wizard/step-selling.php:44
+#: templates/admin-setup-wizard/step-selling.php:23
#: templates/admin-setup-wizard/step-store.php:106
msgid "Off"
msgstr ""
@@ -7264,26 +7364,26 @@ msgstr ""
msgid "Switched back to %1$s (%2$s)."
msgstr ""
-#: includes/Vendor/Vendor.php:925
+#: includes/Vendor/Vendor.php:916
msgid "No ratings found yet!"
msgstr ""
-#: includes/Vendor/Vendor.php:927
+#: includes/Vendor/Vendor.php:918
msgid "%s rating from %d review"
msgid_plural "%s rating from %d reviews"
msgstr[0] ""
msgstr[1] ""
-#: includes/Vendor/Vendor.php:928
+#: includes/Vendor/Vendor.php:919
msgid "Rated %s out of %d"
msgstr ""
-#: includes/Vendor/Vendor.php:1039
+#: includes/Vendor/Vendor.php:1019
#: templates/settings/store-form.php:252
msgid "Store is open"
msgstr ""
-#: includes/Vendor/Vendor.php:1053
+#: includes/Vendor/Vendor.php:1033
#: templates/settings/store-form.php:260
msgid "Store is closed"
msgstr ""
@@ -7368,7 +7468,7 @@ msgstr ""
msgid "— No change —"
msgstr ""
-#: includes/wc-template.php:280
+#: includes/wc-template.php:298
msgid "Go to Vendor Dashboard"
msgstr ""
@@ -7678,10 +7778,6 @@ msgstr ""
msgid "Choose file"
msgstr ""
-#: lib/class.category-walker.php:13
-msgid "Use `WeDevs\\Dokan\\Walkers\\CategoryDropdownSingle` instead."
-msgstr ""
-
#: templates/account/become-a-vendor-section.php:16
#: templates/account/become-a-vendor-section.php:20
#: templates/account/update-customer-to-vendor.php:78
@@ -7800,6 +7896,10 @@ msgstr ""
msgid "%1$sDokan is inactive.%2$s The %3$sWooCommerce plugin%4$s must be active for Dokan to work. Please %5$s activate WooCommerce »%6$s"
msgstr ""
+#: templates/admin-setup-wizard/step-commission.php:7
+msgid "Commission Setup"
+msgstr ""
+
#. translators: %1$s: line break and opening strong tag, %2$s: closing strong tag
#: templates/admin-setup-wizard/step-no-wc-introduction.php:8
msgid "Thanks for choosing Dokan to power your online marketplace! This quick setup wizard will help you configure the basic settings. %1$sThis setup wizard is completely optional and shouldn't take longer than three minutes.%2$s"
@@ -7831,19 +7931,7 @@ msgstr ""
msgid "Make selling status enable for new registred vendor"
msgstr ""
-#: templates/admin-setup-wizard/step-selling.php:18
-msgid "Commission Type"
-msgstr ""
-
-#: templates/admin-setup-wizard/step-selling.php:27
-msgid "Set your commission type"
-msgstr ""
-
-#: templates/admin-setup-wizard/step-selling.php:35
-msgid "How much amount (%) you will get from each order"
-msgstr ""
-
-#: templates/admin-setup-wizard/step-selling.php:47
+#: templates/admin-setup-wizard/step-selling.php:26
msgid "Vendor can change order status"
msgstr ""
@@ -7902,14 +7990,26 @@ msgstr ""
msgid "Define vendor store URL"
msgstr ""
+#: templates/admin-setup-wizard/step-store.php:14
+msgid "Shipping Fee Recipient"
+msgstr ""
+
#: templates/admin-setup-wizard/step-store.php:23
msgid "Shipping fees will go to"
msgstr ""
+#: templates/admin-setup-wizard/step-store.php:27
+msgid "Product Tax Fee Recipient"
+msgstr ""
+
#: templates/admin-setup-wizard/step-store.php:36
msgid "Product Tax fees will go to"
msgstr ""
+#: templates/admin-setup-wizard/step-store.php:41
+msgid "Shipping Tax Fee Recipient"
+msgstr ""
+
#: templates/admin-setup-wizard/step-store.php:51
msgid "Shipping Tax fees will go to"
msgstr ""
@@ -7949,6 +8049,8 @@ msgstr ""
#: templates/dashboard/big-counter-widget.php:21
#: templates/orders/listing.php:32
#: templates/orders/listing.php:80
+#: templates/products/products-listing-row.php:225
+#: templates/products/products-listing.php:128
msgid "Earning"
msgstr ""
@@ -8407,11 +8509,11 @@ msgstr ""
#: templates/emails/vendor-completed-order.php:56
#: templates/emails/vendor-new-order.php:55
-#: templates/products/edit-product-single.php:281
+#: templates/products/edit-product-single.php:290
#: templates/products/new-product.php:221
#: templates/products/products-listing-row.php:207
#: templates/products/products-listing.php:127
-#: templates/products/tmpl-add-product-popup.php:57
+#: templates/products/tmpl-add-product-popup.php:56
msgid "Price"
msgstr ""
@@ -8574,6 +8676,54 @@ msgstr ""
msgid "No orders found!"
msgstr ""
+#: templates/orders/commission-meta-box-html.php:63
+#: templates/products/products-listing-row.php:235
+#: templates/products/products-listing.php:129
+msgid "Type"
+msgstr ""
+
+#: templates/orders/commission-meta-box-html.php:64
+msgid "Rate"
+msgstr ""
+
+#: templates/orders/commission-meta-box-html.php:65
+#: templates/orders/details.php:33
+msgid "Qty"
+msgstr ""
+
+#: templates/orders/commission-meta-box-html.php:120
+msgid "Variation ID:"
+msgstr ""
+
+#. translators: %s: variation id
+#: templates/orders/commission-meta-box-html.php:126
+msgid "%s (No longer exists)"
+msgstr ""
+
+#: templates/orders/commission-meta-box-html.php:208
+msgid "Net total:"
+msgstr ""
+
+#: templates/orders/commission-meta-box-html.php:222
+msgid "Vendor earning:"
+msgstr ""
+
+#: templates/orders/commission-meta-box-html.php:237
+msgid "Shipping Fee:"
+msgstr ""
+
+#: templates/orders/commission-meta-box-html.php:269
+msgid "Product Tax Fee:"
+msgstr ""
+
+#: templates/orders/commission-meta-box-html.php:301
+msgid "Shipping Tax Fee:"
+msgstr ""
+
+#: templates/orders/commission-meta-box-html.php:340
+msgid "Total commission:"
+msgstr ""
+
#: templates/orders/date-export.php:16
msgid "Filter by registered customer"
msgstr ""
@@ -8623,10 +8773,6 @@ msgstr ""
msgid "Item"
msgstr ""
-#: templates/orders/details.php:33
-msgid "Qty"
-msgstr ""
-
#: templates/orders/details.php:35
msgid "Totals"
msgstr ""
@@ -8750,7 +8896,7 @@ msgid "Select bulk action"
msgstr ""
#: templates/orders/listing.php:34
-#: templates/orders/listing.php:86
+#: templates/orders/listing.php:96
msgid "Customer"
msgstr ""
@@ -8760,7 +8906,7 @@ msgid "Shipment"
msgstr ""
#: templates/orders/listing.php:41
-#: templates/orders/listing.php:122
+#: templates/orders/listing.php:132
#: templates/products/downloadable.php:40
msgid "Action"
msgstr ""
@@ -8771,34 +8917,34 @@ msgstr ""
msgid "Order %s"
msgstr ""
-#: templates/orders/listing.php:89
+#: templates/orders/listing.php:99
msgid "Guest"
msgstr ""
-#: templates/orders/listing.php:96
-#: templates/orders/listing.php:97
-#: templates/products/products-listing-row.php:284
-#: templates/products/products-listing-row.php:285
+#: templates/orders/listing.php:106
+#: templates/orders/listing.php:107
+#: templates/products/products-listing-row.php:294
+#: templates/products/products-listing-row.php:295
msgid "Unpublished"
msgstr ""
#. translators: 1) human-readable date
#. translators: %s: time difference
-#: templates/orders/listing.php:105
-#: templates/products/products-listing-row.php:306
+#: templates/orders/listing.php:115
+#: templates/products/products-listing-row.php:316
msgid "%s ago"
msgstr ""
-#: templates/orders/listing.php:116
+#: templates/orders/listing.php:126
#: templates/sub-orders.php:79
msgid "Shipping Status"
msgstr ""
-#: templates/orders/listing.php:141
+#: templates/orders/listing.php:151
msgid "Complete"
msgstr ""
-#: templates/orders/listing.php:193
+#: templates/orders/listing.php:203
msgid "No orders found"
msgstr ""
@@ -8860,6 +9006,10 @@ msgstr ""
msgid "← Orders"
msgstr ""
+#: templates/orders/sub-order-related-order-meta-box-html.php:68
+msgid "(Parent order)"
+msgstr ""
+
#: templates/products/add-new-product-modal.php:2
#: templates/products/edit-product-single.php:147
#: templates/products/new-product.php:107
@@ -8875,6 +9025,9 @@ msgid "Enable/Disable Catalog Mode for this product"
msgstr ""
#: templates/products/dokan-category-header-ui.php:23
+#: assets/js/dokan-setup-wizard-commission.js:1
+#: assets/js/vue-admin.js:2
+#: assets/js/vue-bootstrap.js:2
msgid "Category"
msgstr ""
@@ -8912,7 +9065,7 @@ msgid "Done"
msgstr ""
#: templates/products/download-virtual.php:4
-#: templates/products/products-listing-row.php:235
+#: templates/products/products-listing-row.php:245
msgid "Downloadable"
msgstr ""
@@ -8921,7 +9074,7 @@ msgid "Downloadable products give access to a file upon purchase."
msgstr ""
#: templates/products/download-virtual.php:9
-#: templates/products/products-listing-row.php:233
+#: templates/products/products-listing-row.php:243
msgid "Virtual"
msgstr ""
@@ -9003,7 +9156,7 @@ msgstr ""
#: templates/products/edit-product-single.php:242
#: templates/products/new-product.php:215
-#: templates/products/tmpl-add-product-popup.php:51
+#: templates/products/tmpl-add-product-popup.php:50
msgid "Product name.."
msgstr ""
@@ -9019,69 +9172,73 @@ msgstr ""
msgid "Choose Variable if your product has multiple attributes - like sizes, colors, quality etc"
msgstr ""
-#: templates/products/edit-product-single.php:290
-#: templates/products/edit-product-single.php:313
+#: templates/products/edit-product-single.php:295
+msgid " You Earn : "
+msgstr ""
+
+#: templates/products/edit-product-single.php:320
+#: templates/products/edit-product-single.php:343
msgid "0.00"
msgstr ""
-#: templates/products/edit-product-single.php:300
+#: templates/products/edit-product-single.php:330
#: templates/products/new-product.php:230
-#: templates/products/tmpl-add-product-popup.php:66
+#: templates/products/tmpl-add-product-popup.php:65
msgid "Discounted Price"
msgstr ""
-#: templates/products/edit-product-single.php:301
+#: templates/products/edit-product-single.php:331
#: templates/products/new-product.php:231
-#: templates/products/tmpl-add-product-popup.php:67
+#: templates/products/tmpl-add-product-popup.php:66
msgid "Schedule"
msgstr ""
-#: templates/products/edit-product-single.php:324
+#: templates/products/edit-product-single.php:354
msgid "Product price can't be less than the vendor fee!"
msgstr ""
-#: templates/products/edit-product-single.php:332
-#: templates/products/edit-product-single.php:339
+#: templates/products/edit-product-single.php:362
+#: templates/products/edit-product-single.php:369
#: templates/products/new-product.php:246
#: templates/products/new-product.php:253
-#: templates/products/tmpl-add-product-popup.php:82
-#: templates/products/tmpl-add-product-popup.php:89
+#: templates/products/tmpl-add-product-popup.php:81
+#: templates/products/tmpl-add-product-popup.php:88
msgid "YYYY-MM-DD"
msgstr ""
-#: templates/products/edit-product-single.php:357
+#: templates/products/edit-product-single.php:380
#: templates/products/new-product.php:270
-#: templates/products/tmpl-add-product-popup.php:105
+#: templates/products/tmpl-add-product-popup.php:104
msgid "Tags"
msgstr ""
-#: templates/products/edit-product-single.php:398
-#: templates/products/tmpl-add-product-popup.php:25
+#: templates/products/edit-product-single.php:421
+#: templates/products/tmpl-add-product-popup.php:24
msgid "Upload a product cover image"
msgstr ""
-#: templates/products/edit-product-single.php:438
+#: templates/products/edit-product-single.php:461
#: templates/products/new-product.php:195
msgid "Delete image"
msgstr ""
-#: templates/products/edit-product-single.php:444
+#: templates/products/edit-product-single.php:467
#: templates/products/new-product.php:202
-#: templates/products/tmpl-add-product-popup.php:39
+#: templates/products/tmpl-add-product-popup.php:38
msgid "Add gallery image"
msgstr ""
-#: templates/products/edit-product-single.php:460
+#: templates/products/edit-product-single.php:483
msgid "Short Description"
msgstr ""
-#: templates/products/edit-product-single.php:480
+#: templates/products/edit-product-single.php:503
#: templates/products/new-product.php:286
msgid "Description"
msgstr ""
-#: templates/products/edit-product-single.php:512
-#: templates/products/edit-product-single.php:513
+#: templates/products/edit-product-single.php:535
+#: templates/products/edit-product-single.php:536
msgid "Save Product"
msgstr ""
@@ -9215,74 +9372,69 @@ msgstr ""
msgid "Image"
msgstr ""
-#: templates/products/products-listing-row.php:225
-#: templates/products/products-listing.php:128
-msgid "Type"
-msgstr ""
-
-#: templates/products/products-listing-row.php:228
+#: templates/products/products-listing-row.php:238
msgid "Grouped"
msgstr ""
-#: templates/products/products-listing-row.php:230
+#: templates/products/products-listing-row.php:240
msgid "External/Affiliate"
msgstr ""
-#: templates/products/products-listing-row.php:240
+#: templates/products/products-listing-row.php:250
msgid "Variable"
msgstr ""
-#: templates/products/products-listing-row.php:266
-#: templates/products/products-listing.php:129
+#: templates/products/products-listing-row.php:276
+#: templates/products/products-listing.php:130
msgid "Views"
msgstr ""
-#: templates/products/products-listing-row.php:314
+#: templates/products/products-listing-row.php:324
msgid "Published"
msgstr ""
-#: templates/products/products-listing-row.php:317
+#: templates/products/products-listing-row.php:327
msgid "Missed schedule"
msgstr ""
-#: templates/products/products-listing-row.php:322
+#: templates/products/products-listing-row.php:332
msgid "Last Modified"
msgstr ""
#: templates/products/products-listing.php:71
-#: templates/products/products-listing.php:283
+#: templates/products/products-listing.php:284
msgid "Add new product"
msgstr ""
-#: templates/products/products-listing.php:228
+#: templates/products/products-listing.php:229
msgid "No product found"
msgstr ""
-#: templates/products/products-listing.php:254
+#: templates/products/products-listing.php:255
msgid "« Previous"
msgstr ""
-#: templates/products/products-listing.php:255
+#: templates/products/products-listing.php:256
msgid "Next »"
msgstr ""
-#: templates/products/products-listing.php:271
+#: templates/products/products-listing.php:272
msgid "No Products Found!"
msgstr ""
-#: templates/products/products-listing.php:276
+#: templates/products/products-listing.php:277
msgid "Ready to start selling something awesome?"
msgstr ""
-#: templates/products/tmpl-add-product-popup.php:112
+#: templates/products/tmpl-add-product-popup.php:111
msgid "Enter some short description about this product..."
msgstr ""
-#: templates/products/tmpl-add-product-popup.php:120
+#: templates/products/tmpl-add-product-popup.php:119
msgid "Create product"
msgstr ""
-#: templates/products/tmpl-add-product-popup.php:130
+#: templates/products/tmpl-add-product-popup.php:129
msgid "Create & add new"
msgstr ""
@@ -9691,11 +9843,30 @@ msgstr ""
msgid "Setup"
msgstr ""
+#: assets/js/dokan-admin-notice.js:2
#: assets/js/dokan-promo-notice.js:2
#: assets/js/vue-bootstrap.js:2
msgid "Loading..."
msgstr ""
+#: assets/js/dokan-setup-wizard-commission.js:1
+#: assets/js/vue-admin.js:2
+#: assets/js/vue-bootstrap.js:2
+msgid "All Categories"
+msgstr ""
+
+#: assets/js/dokan-setup-wizard-commission.js:1
+#: assets/js/vue-admin.js:2
+#: assets/js/vue-bootstrap.js:2
+msgid "%"
+msgstr ""
+
+#: assets/js/dokan-setup-wizard-commission.js:1
+#: assets/js/vue-admin.js:2
+#: assets/js/vue-bootstrap.js:2
+msgid "+"
+msgstr ""
+
#: assets/js/vue-admin.js:2
msgid "Dokan Premium"
msgstr ""
@@ -9973,11 +10144,7 @@ msgid "Seems To Be Convinced, You Need More Out Of Your Marketplace"
msgstr ""
#: assets/js/vue-admin.js:2
-msgid "Dokan Vendor Capabilities Banner"
-msgstr ""
-
-#: assets/js/vue-admin.js:2
-msgid "One of the finest attractions of Dokan PRO is the vast array of powerful vendor controls & functions it provides so sellers can enjoy ownership, automation & freedom to run their stores. To use these awesome vendor features listed below, consider Upgrading to PRO."
+msgid "Dokan PRO offers powerful vendor controls and features, giving sellers full ownership, automation, and freedom to run their stores. Upgrade to PRO to unlock these great features!."
msgstr ""
#: assets/js/vue-admin.js:2
@@ -10285,11 +10452,6 @@ msgstr ""
msgid "Select State"
msgstr ""
-#: assets/js/vue-admin.js:2
-#: assets/js/vue-bootstrap.js:2
-msgid "Combine"
-msgstr ""
-
#: assets/js/vue-admin.js:2
#: assets/js/vue-bootstrap.js:2
msgid "Payment Options"
@@ -10310,11 +10472,6 @@ msgstr ""
msgid "Swift"
msgstr ""
-#: assets/js/vue-admin.js:2
-#: assets/js/vue-bootstrap.js:2
-msgid "Admin Commission Type"
-msgstr ""
-
#: assets/js/vue-admin.js:2
#: assets/js/vue-bootstrap.js:2
msgid "Publish Product Directly"
@@ -10381,6 +10538,18 @@ msgstr ""
msgid "All"
msgstr ""
+#: assets/js/vue-admin.js:2
+msgid "Commission Options"
+msgstr ""
+
+#: assets/js/vue-admin.js:2
+msgid "Admin Commission type"
+msgstr ""
+
+#: assets/js/vue-admin.js:2
+msgid "Set the commission type that admin will get"
+msgstr ""
+
#: assets/js/vue-admin.js:2
msgid "Import"
msgstr ""
@@ -10533,6 +10702,10 @@ msgstr ""
msgid "The Yoast SEO integration lets vendors define Store Title, Description, Slug and Keyword to appear in search engine results."
msgstr ""
+#: assets/js/vue-admin.js:2
+msgid "One of the finest attractions of Dokan PRO is the vast array of powerful vendor controls & functions it provides so sellers can enjoy ownership, automation & freedom to run their stores. To use these awesome vendor features listed below, consider Upgrading to PRO."
+msgstr ""
+
#: assets/js/vue-admin.js:2
msgid "Dokan Capability"
msgstr ""
diff --git a/lib/class.category-walker.php b/lib/class.category-walker.php
deleted file mode 100644
index 93d54da01c..0000000000
--- a/lib/class.category-walker.php
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
- {{ '%' }}
-
-
- {{ '+' }}
-
-
- {{ getCurrencySymbol }}
-
-
+
+
+
+
+ {{ __( '%', 'dokan-lite' ) }}
+
+ {{ __( '+', 'dokan-lite' ) }}
+
+
+
+ {{ getCurrencySymbol }}
+
+
+
-
diff --git a/src/admin/components/Commission/CategoryBasedCommission.vue b/src/admin/components/Commission/CategoryBasedCommission.vue
new file mode 100644
index 0000000000..c380948270
--- /dev/null
+++ b/src/admin/components/Commission/CategoryBasedCommission.vue
@@ -0,0 +1,402 @@
+
+
+
+
+
{{ __( 'Category', 'dokan-lite' ) }}
+
+
+
+
+
{{ __( 'Percentage', 'dokan-lite' ) }}
+
+
+
{{ __( 'Flat', 'dokan-lite' ) }}
+
+
+
+
+
+
+
+
allCategroyEnabled = !allCategroyEnabled'>
+
+
+
{{__( 'All Categories', 'dokan-lite' )}}
+
+
+
+
+
+
{{ __( '%', 'dokan-lite' ) }}
+
+
+ {{ __( '+', 'dokan-lite' ) }}
+
+
+
{{ getCurrencySymbol }}
+
+
+
+
+
+
+
+
+
+
+
catRowClick( item, index )'>
+
+
+
+
+ #{{ item.term_id }}
+
+
+
+
+
+
+
{{ __( '%', 'dokan-lite' ) }}
+
+
+ {{ __( '+', 'dokan-lite' ) }}
+
+
+
{{ getCurrencySymbol }}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/admin/components/Commission/index.js b/src/admin/components/Commission/index.js
new file mode 100644
index 0000000000..aa3357bf63
--- /dev/null
+++ b/src/admin/components/Commission/index.js
@@ -0,0 +1 @@
+import './style.css';
diff --git a/src/admin/components/Commission/style.css b/src/admin/components/Commission/style.css
new file mode 100644
index 0000000000..c38c0f161c
--- /dev/null
+++ b/src/admin/components/Commission/style.css
@@ -0,0 +1,4 @@
+@config './tailwind-category-commission.config.js';
+@tailwind base;
+@tailwind components;
+@tailwind utilities;
diff --git a/src/admin/components/Commission/tailwind-category-commission.config.js b/src/admin/components/Commission/tailwind-category-commission.config.js
new file mode 100644
index 0000000000..063f70ff4f
--- /dev/null
+++ b/src/admin/components/Commission/tailwind-category-commission.config.js
@@ -0,0 +1,20 @@
+/** @type {import('tailwindcss').Config} */
+const defaultTheme = require("tailwindcss/defaultTheme");
+module.exports = {
+ corePlugins: {
+ preflight: false,
+ },
+ content: [
+ './src/admin/components/Commission/CategoryBasedCommission.vue',
+ './src/admin/components/CombineInput.vue',
+ ],
+ theme: {
+ extend: {
+ screens: {
+ ...defaultTheme.screens,
+ 'd-xs': '360px',
+ }
+ }
+ },
+ plugins: [],
+};
diff --git a/src/admin/components/Currency.vue b/src/admin/components/Currency.vue
index 9a3c4268af..9ec4fc48fe 100644
--- a/src/admin/components/Currency.vue
+++ b/src/admin/components/Currency.vue
@@ -8,7 +8,7 @@ export default {
methods: {
formattedPrice(value) {
- return accounting.formatMoney( value, dokan.currency );
+ return accounting.formatMoney( value, {...dokan.currency, precision: dokan.currency.precision+ 2} );
}
}
};
diff --git a/src/admin/components/Fields.vue b/src/admin/components/Fields.vue
index e3646fdb5f..bb9a9ec9ef 100644
--- a/src/admin/components/Fields.vue
+++ b/src/admin/components/Fields.vue
@@ -72,58 +72,17 @@
-
-
-
+
+
+
-
-
- inputValueHandler( fieldData.name, event.target.value, fieldValue[fieldData.name] )"
- />
-
-
-
-
- {{ getError( fieldData.label ) }}
-
-
- {{ getValidationErrorMessage( fieldData.name ) }}
-
-
-
-
-
-
-
-
-
+
{{ __( 'Both percentage and fixed fee is required.', 'dokan-lite' ) }}
@@ -137,6 +96,45 @@
+
+
+
+
+
+
+
+
+
+
+ {{ getError( fieldData.label ) }}
+
+
+ {{ getValidationErrorMessage( fieldData.name ) }}
+
+
+
+
+
+
+
+
@@ -511,8 +509,9 @@
import FieldHeading from './FieldHeading.vue';
import SecretInput from './SecretInput.vue';
import WithdrawCharges from './Fields/WithdrawCharges.vue'
+ import CombineInput from "admin/components/CombineInput.vue";
+ import CategoryBasedCommission from "admin/components/Commission/CategoryBasedCommission.vue";
import DokanRadioGroup from "admin/components/DokanRadioGroup.vue";
-
let Mapbox = dokan_get_lib('Mapbox');
let TextEditor = dokan_get_lib('TextEditor');
let GoogleMaps = dokan_get_lib('GoogleMaps');
@@ -522,7 +521,9 @@
name: 'Fields',
components: {
- DokanRadioGroup,
+ CategoryBasedCommission,
+ CombineInput,
+ DokanRadioGroup,
Mapbox,
Switches,
TextEditor,
@@ -548,6 +549,7 @@
singleColorPicker : { default: this.fieldData.default, label: '', show_pallete: false },
yourStringTimeValue : '',
customFieldComponents : dokan.hooks.applyFilters( 'getDokanCustomFieldComponents', [] ),
+ commissionFieldComponents : dokan.hooks.applyFilters( 'getDokanCommissionFieldComponents', [] ),
multiCheckValues : {},
}
},
@@ -568,14 +570,6 @@
});
},
- watch: {
- fieldValue: {
- handler() {
- },
- deep: true,
- }
- },
-
computed: {
shouldShow(e) {
let shouldShow = true;
@@ -690,6 +684,16 @@
return true;
},
+
+ watchCategoryCommission() {
+ let data = JSON.parse( JSON.stringify( this.fieldValue[this.fieldData.name] ) );
+
+ if ( window._.isEmpty( data ) ) {
+ return {};
+ }
+
+ return data;
+ },
},
beforeMount() {
@@ -820,7 +824,6 @@
return 'on';
},
-
thisSomeEvent(value) {
console.log('hello priting...', value);
},
@@ -941,6 +944,22 @@
this.fieldData[ key ] = hexPattern.test( value ) ? value : defaultValue;
},
+
+ commissionUpdated( data ) {
+ if (isNaN( data.fixed )) {
+ data.fixed = this.fieldValue[this.fieldData.fields.fixed_fee.name] ?? '';
+ }
+ if (isNaN( data.percentage )) {
+ data.percentage = this.fieldValue[this.fieldData.fields.percent_fee.name] ?? '';
+ }
+
+ this.fieldValue[this.fieldData.fields.percent_fee.name] = data.percentage;
+ this.fieldValue[this.fieldData.fields.fixed_fee.name] = data.fixed;
+ },
+
+ onCategoryUpdate(data) {
+ this.fieldValue[this.fieldData.name] = data;
+ },
},
};
diff --git a/src/admin/components/Fields/WithdrawCharges.vue b/src/admin/components/Fields/WithdrawCharges.vue
index fffd290705..d2cc051827 100644
--- a/src/admin/components/Fields/WithdrawCharges.vue
+++ b/src/admin/components/Fields/WithdrawCharges.vue
@@ -58,6 +58,12 @@ export default {
percentage: Math.abs( data.percentage ) ? Math.abs( data.percentage ) : 0
};
},
+ formatPositiveValue( data ) {
+ return {
+ fixed: accounting.formatNumber( data.fixed, dokan.currency.precision, dokan.currency.thousand, dokan.currency.decimal ),
+ percentage: accounting.formatNumber( data.percentage, dokan.currency.precision, dokan.currency.thousand, dokan.currency.decimal )
+ };
+ },
unFormatValue( data ) {
return {
fixed: Math.abs( accounting.unformat( data.fixed , dokan.currency.decimal ) ),
@@ -77,6 +83,17 @@ export default {
: '';
},
chargeChangeHandler( data, field ) {
+ let fixedCommission = this.fieldValue[ this.fieldData.name ][ field ];
+ if (isNaN( data.fixed )) {
+ data.fixed = fixedCommission.fixed ?? '';
+ }
+ if (isNaN( data.percentage )) {
+ data.percentage = fixedCommission.percentage ?? '';
+ }
+
+ // let positiveValue = this.unFormatValue(data);
+ // let formatedData = this.formatPositiveValue( positiveValue );
+
this.fieldValue[ this.fieldData.name ][ field ] = dokan.hooks.applyFilters(
'dokanFieldComponentInputValue',
this.unFormatValue(data),
diff --git a/src/admin/components/ModuleUpgradePopup.vue b/src/admin/components/ModuleUpgradePopup.vue
index add89e26f1..4e028fca04 100644
--- a/src/admin/components/ModuleUpgradePopup.vue
+++ b/src/admin/components/ModuleUpgradePopup.vue
@@ -128,7 +128,7 @@ export default {
diff --git a/src/admin/notice/App.vue b/src/admin/notice/App.vue
new file mode 100644
index 0000000000..f0c4882d33
--- /dev/null
+++ b/src/admin/notice/App.vue
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
diff --git a/src/admin/notice/main.js b/src/admin/notice/main.js
new file mode 100644
index 0000000000..bdd5a2befa
--- /dev/null
+++ b/src/admin/notice/main.js
@@ -0,0 +1,14 @@
+import Vue from 'vue';
+import App from './App.vue';
+import Mixin from '../../utils/Mixin';
+
+const { jQuery: $ } = window;
+
+if ( $( '#dokan-admin-notices' ).length ) {
+ Vue.mixin( Mixin );
+
+ new Vue( {
+ el: '#dokan-admin-notices',
+ render: ( h ) => h( App ),
+ } );
+}
diff --git a/src/admin/pages/AddVendor.vue b/src/admin/pages/AddVendor.vue
index 398cac3a72..0941fbeec6 100644
--- a/src/admin/pages/AddVendor.vue
+++ b/src/admin/pages/AddVendor.vue
@@ -183,12 +183,7 @@ export default {
if ( result.value ) {
this.$root.$emit( 'addAnotherVendor' );
} else if ( result.dismiss === Swal.DismissReason.cancel ) {
-
- if ( this.hasPro ) {
- this.$router.push( { path: 'vendors/' + response.id, query:{ edit: 'true' } } );
- } else {
- window.location.replace( `${dokan.urls.adminRoot}user-edit.php?user_id=${response.id}` );
- }
+ this.$router.push( { path: 'vendors/' + response.id, query:{ edit: 'true' } } );
}
} );
} )
diff --git a/src/admin/pages/ChangeLog.vue b/src/admin/pages/ChangeLog.vue
index ae36365a21..12c9f316d9 100644
--- a/src/admin/pages/ChangeLog.vue
+++ b/src/admin/pages/ChangeLog.vue
@@ -285,6 +285,7 @@ export default {
diff --git a/src/admin/pages/Settings.vue b/src/admin/pages/Settings.vue
index 2d985d9556..522f88d425 100644
--- a/src/admin/pages/Settings.vue
+++ b/src/admin/pages/Settings.vue
@@ -13,32 +13,38 @@
-
-
-
-
-
-
+
+
+
+
{{ __( 'Settings', 'dokan-lite' ) }}
+
+
showMenu = !showMenu' type='checkbox'>
+
+
+
+
+
+
-
-
-
-
-
{{ section.title }}
-
{{ section.description }}
+
+
+
+
+
{{ section.title }}
+
{{ section.description }}
+
-
-
+
+
-
-
-
+
+
+
-
@@ -146,6 +152,8 @@
isSaveConfirm: false,
dokanAssetsUrl: dokan.urls.assetsUrl,
disableSubmit: false,
+ showMenu: false,
+ screenWidth: window.document.documentElement.clientWidth
}
},
@@ -177,6 +185,13 @@
if ( typeof( localStorage ) != 'undefined' ) {
localStorage.setItem( "activetab", this.currentTab );
}
+
+ if ( this.screenWidth >= 753 ) {
+ this.showMenu = true;
+ return;
+ }
+
+ this.showMenu = false;
},
fetchSettingValues() {
@@ -418,13 +433,36 @@
if ( ! this.errors.includes( field ) ) {
this.errors.push( field );
- // If flat or percentage commission is set. Remove the required field.
- if ( 'flat' === value['commission_type'] || 'percentage' === value['commission_type'] ) {
+ if ( 'flat' === value['commission_type'] || 'percentage' === value['commission_type'] || 'combine' === value['commission_type'] || 'fixed' === value['commission_type'] ) {
+ this.errors = this.arrayRemove( this.errors, 'commission_category_based_values' );
+ }
+
+ if ( 'category_based' === value['commission_type'] ) {
this.errors = this.arrayRemove( this.errors, 'admin_percentage' );
this.errors = this.arrayRemove( this.errors, 'additional_fee' );
}
}
}
+
+ if ( field in value && 'category_based' === value['commission_type'] ) {
+ let alreadyAdded = ! this.errors.includes( field );
+
+ // Validate the commission_category_based_values
+ if (
+ 'commission_category_based_values' in value &&
+ typeof value['commission_category_based_values'] === 'object' &&
+ value?.commission_category_based_values?.all &&
+ value?.commission_category_based_values?.all?.flat &&
+ String( value?.commission_category_based_values?.all?.flat ).length > 0 &&
+ value?.commission_category_based_values?.all?.percentage &&
+ String( value?.commission_category_based_values?.all?.percentage ).length > 0 &&
+ alreadyAdded
+ ) {
+ this.errors = this.arrayRemove( this.errors, 'commission_category_based_values' );
+ } else {
+ this.errors.push( 'commission_category_based_values' );
+ }
+ }
} );
} );
@@ -554,6 +592,10 @@
this.$refs.backToTop.style.transform = window.scrollY > ( document.body.scrollHeight - 800 ) ? 'scale(1)' : 'scale(0)';
}
},
+
+ updateDocumentWidth() {
+ this.screenWidth = window.document.documentElement.clientWidth;
+ }
},
created() {
@@ -609,7 +651,14 @@
this.$root.$on('setting-submit-status', ( status ) => {
this.disableSubmit = status;
} );
+
+ this.updateDocumentWidth();
+ window.addEventListener('resize', this.updateDocumentWidth);
},
+
+ beforeDestroy() {
+ window.removeEventListener('resize', this.updateDocumentWidth);
+ }
};
@@ -1070,7 +1119,7 @@
}
.metabox-holder {
- width: 40%;
+ width: 100%;
.settings-header {
display: block;
@@ -1103,7 +1152,7 @@
@media only screen and (max-width: 768px) {
.dokan-settings-wrap {
.nav-tab-wrapper {
- width: 35% !important;
+ width: 35%;
.nav-tab {
.nav-content {
@@ -1119,7 +1168,7 @@
}
.metabox-holder {
- width: 65%;
+ width: 100%;
.settings-header {
.settings-content {
diff --git a/src/admin/pages/VendorCapabilities.vue b/src/admin/pages/VendorCapabilities.vue
index fba37edd52..cc6138a4cf 100644
--- a/src/admin/pages/VendorCapabilities.vue
+++ b/src/admin/pages/VendorCapabilities.vue
@@ -1,7 +1,6 @@
-
{{ __( 'Vendor Capabilities', 'dokan-lite' ) }}
@@ -153,9 +152,6 @@ export default {
backgroundImage: `url(${dokan.urls.assetsUrl}/images/dokan-vendor-capabilities-banner-bg.svg)`,
};
},
- bannerImage() {
- return `${dokan.urls.assetsUrl}/images/dokan-vendor-capabilities-banner.svg`;
- }
},
}
@@ -259,6 +255,7 @@ export default {
}
}
+
.vendor-capabilities-banner {
display: flex;
align-items: center;
@@ -268,15 +265,26 @@ export default {
background-position: center;
background-repeat: no-repeat;
background-size: cover;
- margin-bottom: 16px;
+ margin: 20px 0;
.content {
margin: 30px;
.title {
- font-size: 26px;
- font-weight: bold;
- color: #FF0000;
+ font-size: 51px;
+ font-style: normal;
+ font-weight: 700;
+ line-height: normal;
+ background: linear-gradient(90deg, #FFF 34.5%, #D68FFF 100%);
+ background-clip: text !important;
+ -webkit-background-clip: text;
+ -webkit-text-fill-color: transparent;
+ }
+ p{
+ color: #FFFFFF;
+ max-width: 512px;
+ width: 100%;
+ font-size: 16px;
}
}
}
diff --git a/src/admin/pages/VendorPaymentFields.vue b/src/admin/pages/VendorPaymentFields.vue
index b5ff6267ff..56224b0f71 100644
--- a/src/admin/pages/VendorPaymentFields.vue
+++ b/src/admin/pages/VendorPaymentFields.vue
@@ -65,30 +65,6 @@
-
-
-
-
- {{ __( 'Admin Commission Type', 'dokan-lite' ) }}
-
-
-
-
-
-
-
- {{ __( 'Admin Commission', 'dokan-lite' ) }}
-
-
-
-
@@ -152,24 +128,6 @@ export default {
enabled: false,
trusted: false,
featured: false,
- commissionTypes: [
- {
- name: 'flat',
- label: this.__( 'Flat', 'dokan-lite' )
- },
- {
- name: 'percentage',
- label: this.__( 'Percentage', 'dokan-lite' )
- },
- {
- name: 'combine',
- label: this.__( 'Combine', 'dokan-lite' )
- }
- ],
- selectedCommissionType: {
- name: 'flat',
- label: this.__( 'Flat', 'dokan-lite' )
- },
getBankFields: dokan.hooks.applyFilters( 'getVendorBankFields', [] ),
getPyamentFields: dokan.hooks.applyFilters( 'AfterPyamentFields', [] ),
afterFeaturedCheckbox: dokan.hooks.applyFilters( 'afterFeaturedCheckbox', [] ),
@@ -191,15 +149,6 @@ export default {
this.featured = true;
this.vendorInfo.featured = true
}
-
- const commissionType = this.vendorInfo.admin_commission_type;
-
- if ( commissionType ) {
- const { name, label } = _.findWhere( this.commissionTypes, { name: commissionType } );
-
- this.selectedCommissionType.name = name;
- this.selectedCommissionType.label = label;
- }
},
methods: {
@@ -223,14 +172,6 @@ export default {
getId() {
return this.$route.params.id;
},
-
- saveCommissionType( {name} ) {
- if ( ! name ) {
- this.vendorInfo.admin_commission_type = 'flat';
- }
-
- this.vendorInfo.admin_commission_type = name;
- }
}
};
@@ -260,11 +201,5 @@ export default {
margin-top: 5px;
margin-bottom: 5px;
}
-
- .combine-commission-field {
- .dokan-form-input.percent_fee, .dokan-form-input.fixed_fee {
- width: 40%;
- }
- }
}
diff --git a/src/admin/pages/VendorSingle.vue b/src/admin/pages/VendorSingle.vue
new file mode 100644
index 0000000000..fb78b5d75d
--- /dev/null
+++ b/src/admin/pages/VendorSingle.vue
@@ -0,0 +1,1677 @@
+
+
+
+
+
+
+
+
+ {{store}}
+
+
+
+
+
+ {{ __( 'To', 'dokan' ) }}
+
+
+
+
+ {{ __( 'Reply-To', 'dokan' ) }}
+
+
+
+
+ {{ __( 'Subject', 'dokan' ) }}
+
+
+
+
+ {{ __( 'Message', 'dokan' ) }}
+
+
+
+
+
+ {{ __( 'Send Email', 'dokan' ) }}
+
+
+
+
+
+
+
+
+
+
+
+
{{ __( 'Products', 'dokan' ) }}
+
+
+
+ {{ stats.products.total }}
+ {{ __( 'Total Products', 'dokan' ) }}
+
+
+ {{ stats.products.sold }}
+ {{ __( 'Items Sold', 'dokan' ) }}
+
+
+ {{ stats.products.visitor }}
+ {{ __( 'Store Visitors', 'dokan' ) }}
+
+
+
+
+
+
{{ __( 'Revenue', 'dokan' ) }}
+
+
+
+ {{ stats.revenue.orders }}
+ {{ __( 'Orders Processed', 'dokan' ) }}
+
+
+
+
+
+ {{ __( 'Gross Sales', 'dokan' ) }}
+
+
+
+
+
+ {{ __( 'Total Earning', 'dokan' ) }}
+
+
+
+
+
+
{{ __( 'Others', 'dokan' ) }}
+
+
+
+
+ {{ __( 'Admin Commission', 'dokan' ) }}
+
+
+
+
+
+ {{ __( 'Current Balance', 'dokan' ) }}
+
+
+ {{ stats.others.reviews }}
+ {{ __( 'Reviews', 'dokan' ) }}
+
+
+
+
+
+
+
+ {{ __( 'Registered Since', 'dokan' ) }}
+
+ {{ moment(store.registered).format('MMM D, YYYY') }}
+ ({{ moment(store.registered).toNow(true) }})
+
+
+
+ {{ __( 'Social Profiles', 'dokan' ) }}
+
+
+
+
+ {{ __( 'Payment Methods', 'dokan' ) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ custom_withdraw_method }}
+
+
+
+
+ {{ __( 'Product Publishing', 'dokan' ) }}
+
+ {{ __( 'Direct', 'dokan' ) }}
+ {{ __( 'Requires Review', 'dokan' ) }}
+
+
+
+
+
+
+
+
+
+ {{ __( 'Cancel', 'dokan' ) }}
+ {{ saveBtn }}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/admin/pages/Vendors.vue b/src/admin/pages/Vendors.vue
index 2c83b04280..6610a91136 100644
--- a/src/admin/pages/Vendors.vue
+++ b/src/admin/pages/Vendors.vue
@@ -53,8 +53,7 @@
- {{ data.row.store_name ? data.row.store_name : __( '(no name)', 'dokan-lite' ) }}
- {{ data.row.store_name ? data.row.store_name : __( '(no name)', 'dokan-lite' ) }}
+ {{ data.row.store_name ? data.row.store_name : __( '(no name)', 'dokan-lite' ) }}
@@ -76,8 +75,7 @@
- {{ action.label }}
- {{ action.label }}
+ {{ action.label }}
{{ action.label }}
{{ action.label }}
{{ action.label }}
diff --git a/src/admin/router/index.js b/src/admin/router/index.js
index f518f2afca..397c0d004e 100644
--- a/src/admin/router/index.js
+++ b/src/admin/router/index.js
@@ -5,6 +5,7 @@ import Help from 'admin/pages/Help.vue'
import ChangeLog from 'admin/pages/ChangeLog.vue'
import Settings from 'admin/pages/Settings.vue'
import Vendors from 'admin/pages/Vendors.vue'
+import VendorSingle from 'admin/pages/VendorSingle.vue'
import DummyData from 'admin/pages/DummyData.vue'
import VendorCapabilities from "admin/pages/VendorCapabilities.vue"
import ProModules from "admin/pages/ProModules.vue"
@@ -28,11 +29,8 @@ dokan_add_route(ProModules)
dokan_add_route(DummyData)
dokan_add_route(ReverseWithdrawal)
dokan_add_route(ReverseWithdrawalTransactions)
-
-// if dokan pro not installed or dokan pro is greater than 2.9.14 register the `vendors` route.
-if ( ! dokan.hasPro || VersionCompare( dokan.proVersion, '2.9.14', '>' ) ) {
- dokan_add_route(Vendors)
-}
+dokan_add_route(Vendors)
+dokan_add_route(VendorSingle)
/**
* Parse the route array and bind required components
diff --git a/src/utils/Bootstrap.js b/src/utils/Bootstrap.js
index d1ad7e55d7..ea9de7940b 100644
--- a/src/utils/Bootstrap.js
+++ b/src/utils/Bootstrap.js
@@ -51,6 +51,8 @@ import VendorSocialFields from "admin/pages/VendorSocialFields.vue";
import VendorPaymentFields from "admin/pages/VendorPaymentFields.vue";
import AdminNotice from "../admin/components/AdminNotice.vue";
import CardFunFact from "../admin/components/CardFunFact.vue";
+import CombineInput from 'admin/components/CombineInput.vue';
+import CategoryBasedCommission from "admin/components/Commission/CategoryBasedCommission.vue";
import StoreCategory from 'admin/components/StoreCategory.vue';
import "vue-multiselect/dist/vue-multiselect.min.css"
@@ -124,6 +126,8 @@ window.dokan.libs['AdminNotice'] = AdminNotice;
window.dokan.libs['CardFunFact'] = CardFunFact;
window.dokan.libs['StoreCategory'] = StoreCategory;
window.dokan.libs['papaparse'] = parse;
+window.dokan.libs['CombineInput'] = CombineInput;
+window.dokan.libs['CategoryBasedCommission'] = CategoryBasedCommission;
window.dokan.libs['Vuedraggable'] = Vuedraggable;
window.dokan.libs['ContentLoading'] = {
diff --git a/tailwind.config.js b/tailwind.config.js
index 7be35c31a7..5931c823ad 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -1,4 +1,5 @@
/** @type {import('tailwindcss').Config} */
+const defaultTheme = require('tailwindcss/defaultTheme')
module.exports = {
corePlugins: {
preflight: false,
@@ -7,7 +8,12 @@ module.exports = {
"./src/**/*.{html,js,jsx,ts,tsx,vue}"
],
theme: {
- extend: {},
+ extend: {
+ screens: {
+ ...defaultTheme.screens,
+ 'd-xs': '360px',
+ }
+ },
},
plugins: [],
}
diff --git a/templates/admin-setup-wizard/step-commission.php b/templates/admin-setup-wizard/step-commission.php
new file mode 100644
index 0000000000..d026b47b11
--- /dev/null
+++ b/templates/admin-setup-wizard/step-commission.php
@@ -0,0 +1,16 @@
+
+
+
diff --git a/templates/admin-setup-wizard/step-selling.php b/templates/admin-setup-wizard/step-selling.php
index a48af6f2b5..55bfe6bfab 100644
--- a/templates/admin-setup-wizard/step-selling.php
+++ b/templates/admin-setup-wizard/step-selling.php
@@ -14,27 +14,6 @@
-