Skip to content
This repository has been archived by the owner on Mar 17, 2022. It is now read-only.

Commit

Permalink
Support number formatting for currency switcher Ajax call
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon007 committed Jun 18, 2017
1 parent 0a4006d commit 0cade76
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Hyyan/WPI/LocaleNumbers.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function getLocalizedDecimal($wooFormattedValue, $input)
$retval = $wooFormattedValue;

//don't touch values on admin screens, save as plain number using woo defaults
if (! is_admin()){
if ( (! is_admin()) || isset($_REQUEST['get_product_price_by_ajax']) ){
$a = new \NumberFormatter(pll_current_language('locale'), \NumberFormatter::DECIMAL);
if ($a){
$retval = $a->format($input, \NumberFormatter::TYPE_DOUBLE);
Expand All @@ -100,7 +100,7 @@ public function getLocaleDecimalSeparator($separator)
{
$retval = $separator;
//don't touch values on admin screens, save as plain number using woo defaults
if (! is_admin()){
if ( (! is_admin()) || isset($_REQUEST['get_product_price_by_ajax']) ){
$locale = pll_current_language('locale');
$a = new \NumberFormatter($locale, \NumberFormatter::DECIMAL);
if ($a){
Expand Down

0 comments on commit 0cade76

Please sign in to comment.