You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue : Product attributes (Variant) showing price in truncated format ie single digit for any variant price above 999, eg the price $1000 will be shown as $1.
The issue is with the number format php function which adds the comma ',' in the number format for any price exceeding 1000. The number formatted price is multiplied with 1 , which results in truncating all digits after ',' and cart shows wrong price.
To fix the issue updated the above code in file includes\modules\variants\pull_down_menu.php
updated new code
$price_formatted = ((float)$val['price_modifier'] != 0.00) ? $price_ind . $lC_Currencies->format($val['price_modifier'], $lC_Currencies->getCode()) : null;
removed the number_format function so the digit is passed instead of formatted characters.
issue tested and verified.
---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/34429090-variant-showing-single-digit-price-in-dropdown?utm_campaign=plugin&utm_content=tracker%2F40949&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F40949&utm_medium=issues&utm_source=github).
The text was updated successfully, but these errors were encountered:
Issue : Product attributes (Variant) showing price in truncated format ie single digit for any variant price above 999, eg the price $1000 will be shown as $1.
The issue is with the number format php function which adds the comma ',' in the number format for any price exceeding 1000. The number formatted price is multiplied with 1 , which results in truncating all digits after ',' and cart shows wrong price.
$price_formatted = ((float)$val['price_modifier'] != 0.00) ? $price_ind . $lC_Currencies->format(number_format($val['price_modifier'], DECIMAL_PLACES), $lC_Currencies->getCode()) : null;
To fix the issue updated the above code in file includes\modules\variants\pull_down_menu.php
updated new code
$price_formatted = ((float)$val['price_modifier'] != 0.00) ? $price_ind . $lC_Currencies->format($val['price_modifier'], $lC_Currencies->getCode()) : null;
removed the number_format function so the digit is passed instead of formatted characters.
issue tested and verified.
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/34429090-variant-showing-single-digit-price-in-dropdown?utm_campaign=plugin&utm_content=tracker%2F40949&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F40949&utm_medium=issues&utm_source=github).The text was updated successfully, but these errors were encountered: