From 51805cd565f5d7bcf18bd18af89c44c7c636c81d Mon Sep 17 00:00:00 2001 From: Akshaya Rane Date: Wed, 19 Apr 2023 12:19:07 +0530 Subject: [PATCH] Added numberic check for Regular price --- .../woocommerce/includes/admin/class-wc-admin-post-types.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/woocommerce/includes/admin/class-wc-admin-post-types.php b/plugins/woocommerce/includes/admin/class-wc-admin-post-types.php index 817530fe0e2..62032fc7cc5 100644 --- a/plugins/woocommerce/includes/admin/class-wc-admin-post-types.php +++ b/plugins/woocommerce/includes/admin/class-wc-admin-post-types.php @@ -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 {