Skip to content

Commit 450de5d

Browse files
committed
Check COGS value != 0 instead of > 0 in post migration
1 parent 26fcbe9 commit 450de5d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugins/woocommerce/src/Internal/DataStores/Orders/OrdersTableDataStore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1690,7 +1690,7 @@ private function migrate_post_record( \WC_Abstract_Order &$order, \WC_Abstract_O
16901690
// This prevents overwriting valid COGS data with recalculated zero values during sync-on-read.
16911691
if ( 'cogs_total_value' === $key && $order->has_cogs() && $this->cogs_is_enabled() ) {
16921692
$hpos_cogs = $order->get_cogs_total_value( 'edit' );
1693-
if ( $hpos_cogs > 0 && 0.0 === (float) $value ) {
1693+
if ( 0.0 !== $hpos_cogs && 0.0 === (float) $value ) {
16941694
continue;
16951695
}
16961696
}

0 commit comments

Comments
 (0)