-
Notifications
You must be signed in to change notification settings - Fork 219
Products with no price break the product selector #2578
Comments
Probably related to this. |
I couldn't find yet why this error is only occurring in my server but not in local. Basically, the Server is PHP 7.4 while local is 7.3. Doing this change fixes the issue: -wc_format_decimal( $amount ) * ( 10 ** $decimals ),
+floatval( wc_format_decimal( $amount ) ) * ( 10 ** $decimals ), |
|
@nerrad I don't think we can use |
Hmm, I saw this code doc for
|
Yeah, I'm a bit confused by that I tested it locally, but the tests are also quite handy to see how it works: https://github.com/woocommerce/woocommerce/blob/master/tests/legacy/unit-tests/formatting/functions.php#L297. |
Similarly to #2551, I'm only able to reproduce this issue in a specific server, but not in local.
To Reproduce
Hand-Picked Products
block or aFeatured Product
block. I guess all blocks which have a product selector will have this issue.The response is not a valid JSON response.
' error message:The API response is:
My guess is that we need to return early in:
https://github.com/woocommerce/woocommerce-gutenberg-products-block/blob/master/src/StoreApi/Schemas/AbstractSchema.php#L240
if
$amount
is not a number.The text was updated successfully, but these errors were encountered: