Fixed shipping flat price change to free shipping when shipping cost represented using decimal separators and thousands separators (#46857)

* Fixed shipping flat price change to free shipping when shipping cost represented using decimal separators and thousands separators

* added the changelog file

---------

Co-authored-by: Saiful Islam <anandacsebd@gmail.com>
This commit is contained in:
79mplus Admin 2024-05-24 17:59:56 +06:00 committed by GitHub
parent 86bc377977
commit 4d44a6e891
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 0 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Fixed shipping flat price change to free shipping when shipping cost represented using decimal separators and thousands separators.

View File

@ -108,6 +108,9 @@ class WC_Shipping_Flat_Rate extends WC_Shipping_Method {
// Remove whitespace from string.
$sum = preg_replace( '/\s+/', '', $sum );
// Removed thousand separator.
$sum = str_replace( wc_get_price_thousand_separator(), '', $sum );
// Remove locale from string.
$sum = str_replace( $decimals, '.', $sum );