Merge pull request #31012 from RatulHasan/fix/unsupported_operand_types

Fix/unsupported operand types
This commit is contained in:
Barry Hughes 2022-04-13 16:38:43 -07:00 committed by GitHub
commit a761cb8ebc
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: tweak
Avoid unsupported operand type errors from within `WC_Admin_Post_Types::set_new_price()`.

View File

@ -928,7 +928,7 @@ class WC_Admin_Post_Types {
return false;
}
$old_price = $product->{"get_{$price_type}_price"}();
$old_price = (float) $product->{"get_{$price_type}_price"}();
$price_changed = false;
$change_price = absint( $request_data[ "change_{$price_type}_price" ] );