Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

variant showing single digit price in dropdown #712

Open
mattloaded opened this issue May 20, 2016 · 0 comments
Open

variant showing single digit price in dropdown #712

mattloaded opened this issue May 20, 2016 · 0 comments

Comments

@mattloaded
Copy link

mattloaded commented May 20, 2016

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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant