Fix bulk sale price update (#37812)

This commit is contained in:
Barry Hughes 2023-04-21 11:43:30 -07:00 committed by GitHub
commit afe226d573
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Added numeric check for Regular price in bulk edits.

View File

@ -985,7 +985,7 @@ class WC_Admin_Post_Types {
break;
}
$regular_price = $product->get_regular_price();
if ( $is_percentage ) {
if ( $is_percentage && is_numeric( $regular_price ) ) {
$percent = $price / 100;
$new_price = max( 0, $regular_price - ( NumberUtil::round( $regular_price * $percent, wc_get_price_decimals() ) ) );
} else {