Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions includes/Commission/Settings/OrderItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function get(): Setting {
$commission_type = $this->order_item->get_meta( '_dokan_commission_type', true ) ?? '';
$commission_source = $this->order_item->get_meta( '_dokan_commission_source', true ) ?? '';
$additional_flat = $this->order_item->get_meta( '_dokan_additional_fee', true ) ?? '';
$commission_meta = $this->order_item->get_meta( 'dokan_commission_meta', true );
$commission_meta = $this->order_item->get_meta( '_dokan_commission_meta', true );

// if dokan_commission_meta is exists the we don't need to map the flat amount because after 3.14.0 this maping is not needed.
if ( $commission_type === Flat::SOURCE && ! is_array( $commission_meta ) ) {
Expand Down Expand Up @@ -89,7 +89,7 @@ public function save( array $setting ): Setting {
$this->order_item->update_meta_data( '_dokan_commission_rate', $settings->get_percentage() );
$this->order_item->update_meta_data( '_dokan_commission_type', $settings->get_type() );
$this->order_item->update_meta_data( '_dokan_additional_fee', $settings->get_flat() );
$this->order_item->update_meta_data( 'dokan_commission_meta', $settings->get_meta_data() );
$this->order_item->update_meta_data( '_dokan_commission_meta', $settings->get_meta_data() );

$this->order_item->save_meta_data();
$this->order_item->save();
Expand Down
2 changes: 1 addition & 1 deletion tests/pw/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ export const helpers = {

lineItems.forEach((item: any) => {
item.meta_data.forEach((meta: any) => {
if (meta.key === 'dokan_commission_meta') {
if (meta.key === '_dokan_commission_meta') {
totalAdminCommission += Number(meta.value.admin_commission);
totalVendorEarning += Number(meta.value.vendor_earning);
}
Expand Down
Loading