-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Cart Total is NaN in some circumstances #18027
Comments
Hi @rauberdaniel. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
where @rauberdaniel do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
@magento-engcom-team give me 2.2.5 instance |
Hi @rauberdaniel. Thank you for your request. I'm working on Magento 2.2.5 instance for you |
Hi @rauberdaniel, here is your Magento instance. |
Hi @rauberdaniel I'm not able to reproduce following steps your described. |
This only appears in conditions where floating point calculations are not accurate. I assume it has to do with taxes (7% in my case). I tried reproducing in the magento instance you offered me, but that instance does not update its index automatically (I assume no cronjob running) and therefore does not allow to create any products (refresh index on save doesn’t seem to work either and manual reindex is only possible using command line). |
@rauberdaniel I try several times but same result, tax 7% and do reindex, cron run cache clean, but not have an NaN |
@rauberdaniel And rest api result Any update ? |
Guess I need to set up a vanilla Magento 2.2.5 instance to reproduce this, as the one offered above is not working correctly. However, I don’t currently have time for that. Might also have to do something with tax and discount calculation (post or pre tax). Will let you know as soon as I had time for it. Thank you! |
@rauberdaniel ok somehow i'm get this result but not in grand total |
@rauberdaniel yes finally i'm reproduce this :) |
Great to hear, thank you very much for the help! This is a critical issue for us, as it prevents going past the payment method step in checkout, as no payment methods are available for a |
@rauberdaniel, thank you for your report. |
What can I do to reproduce this issue? I have tried as the OP mentioned and got 0.00 as the total |
Ok nevermind. I reproduced it. Seems to be a floating point precision error. We could round the floating point number to 2 digits, since that's the max precision Magento uses to display prices |
I am working on this |
* Escaped output of html attributes * MAGETWO-97466: Refreshing checkout page deletes shipping address on guest checkout * MAGETWO-96711: One page Checkout resets Customer data if Product Qty was changed * MAGETWO-72879: Update product from mini shopping cart doesn't reflect in the shopping cart * meassage icon alignment issue resolved * ENGCOM-3851: Static test fix. * ENGCOM-3893: Static test fix. * MAGETWO-96711: One page Checkout resets Customer data if Product Qty was changed * MAGETWO-97826: Skipped Randomly failing MFTF test AdminCheckingCreditMemoTotalsTest * MAGETWO-97825: Skipped Randomly failing test AdminCreateCreditMemoWhenCartRuleDeletedTest * Fixed-19800: Contact us : design improvement. * Fixed 19800 Contact us : design improvement * Fixed 19800 Contact us : design improvement * Fixed 19800 Contact us : design improvement * Fixed 19800 Contact us : design improvement * Fixed 19800 Contact us : design improvement * ENGCOM-3763: Static test fix. * Fixed-19791: Logo vertical misalignment. * Fixed-Checkbox-Alignement: Checkbox alignment issue. * MAGETWO-72879: Update product from mini shopping cart doesn't reflect in the shopping cart * MAGETWO-96711: One page Checkout resets Customer data if Product Qty was changed * MAGETWO-94348: The cart rule cannot affect the Bundle product with Fixed Price * magento#18362: Fixed static tests * Added constants to unit codes to make it easier to reuse it if necessary. * ENGCOM-3774: Static test fix. * MAGETWO-96815: There is no option to remove the Store Credit from the payment page of checkout * Fix negative credit memo bug caused by credit memo discount total calculator * ENGCOM-3720: Static test fix. * Added required error message. If any JSON error occurs user will be be shown error message if the app mode is not in Production. * Fixed Unused Local variable * Fixed unused local variable * Removed use of Class ObjectManager in Construct * Updated to show error message to all Env. * Update lib/internal/Magento/Framework/Serialize/Serializer/Json.php Co-Authored-By: vinogcs <[email protected]> * ENGCOM-3782: Static test fix. * Add useful debug info for which website has not been found * Add with code/with id text * MAGETWO-73598: CLONE - Quans: Orders API without key/value on ADDITIONAL_INFORMATION (only values) * MAGETWO-96815: There is no option to remove the Store Credit from the payment page of checkout * Issue fixed magento#19985 Send email confirmation popup close button area overlapping to content Issue fixed magento#19985 Send email confirmation popup close button area overlapping to content * Issue fixed magento#19985 Send email confirmation popup close button area overlapping Issue fixed magento#19985 Send email confirmation popup close button area overlapping * Order API resources updated. * 'wishlist-page-edit-remove-item-misalign' :: On wish list page edit, remove item misalign in 640 X 767 resolution * Order-view-invoices :: Order view invoices template not display proper on ipad * Updated CancelOrderItemObserver.php Fixed Issue magento#20121 Cancel order increases stock although "Set Items' Status to be In Stock When Order is Cancelled" is set to No * ENGCOM-3845: Static test fix. * MAGETWO-74604: Event clean_cache_by_tags didn't clean all tags pointed in getIdentity * MAGETWO-73598: CLONE - Quans: Orders API without key/value on ADDITIONAL_INFORMATION (only values) * MAGETWO-97899: [FT] [MFTF] AdminAvailabilityCreditMemoWithNoPaymentTest fails because of bad design * MAGETWO-94157: Issue with products with customizable options * MAGETWO-94348: The cart rule cannot affect the Bundle product with Fixed Price * MAGETWO-93832: Automate with MFTF Copy Single Update to Another Update * MAGETWO-73598: CLONE - Quans: Orders API without key/value on ADDITIONAL_INFORMATION (only values) * Static test fix. * MAGETWO-95276: Varnish "Connection reset by peer" error when large catalog is reindexed on schedule * MAGETWO-95176: Detaching category from product causes massive product url regeneration * MAGETWO-94348: The cart rule cannot affect the Bundle product with Fixed Price * MAGETWO-73625: Products change in one category will cause cache miss for other categories (Only reproducible by unassigning products from backend category page) * admin-order-info-issue2.2 * MAGETWO-94348: The cart rule cannot affect the Bundle product with Fixed Price * MAGETWO-94348: The cart rule cannot affect the Bundle product with Fixed Price * Fix static test. * MAGETWO-95176: Detaching category from product causes massive product url regeneration * magento#20376 Fix issue with file uploading if an upload field is disabled * magento#20461 Add translate component * (Fixes issue magento#18027) Round the total amount to 4 decimal places, to avoid floating point overflows * round the total amount only if it is float * round base total amount * cast formatted number to float * thousand separator removed from number format * use round instead of number_format to round the total amount * unnecessary comments removed * ENGCOM-3464: Static tests fixed. * fixed Negative order amount in dashboard - magento#18754 * Fix static test. * Update styles-old.less * update-button-issue-while-updating-billing-and-shipping-address * MAGETWO-95752: Unable to create Configurations for Configurable Products * issue fixed magento#20563 Go to shipping information, Update qty & Addresses and Enter a new address button Not aligned from left and right in 767px screen size issue fixed magento#20563 Go to shipping information, Update qty & Addresses and Enter a new address button Not aligned from left and right in 767px screen size * recent-order-product-title-misaligned * Fix static tests. * Fix static tests. * MAGETWO-94348: The cart rule cannot affect the Bundle product with Fixed Price * MAGETWO-95752: Unable to create Configurations for Configurable Products * MAGETWO-95752: Unable to create Configurations for Configurable Products * MAGETWO-95752: Unable to create Configurations for Configurable Products * MAGETWO-94114: Cannot refresh Captcha image in production mode * MQE-1420: Bump MFTF version in Magento - MFTF version bump + allure-codeception dependency update. * MQE-1420: Bump MFTF version in Magento - changing argument from its own attribute to part of the command * Fixed issue of Lifetime update syntax error * Fix static test.
Still experiencing this on 2.3.3; despite the existence of this line in Total.php: These were the values I was working with: Even though it showed isNaN on the order summary; it still let me check out and create the order. |
@AndyJAllen I confirm, in 2.3.3 still display NaN value in that case. |
Hi @jayankaghosh. Thank you for working on this issue.
|
Hi @engcom-Delta. Thank you for working on this issue.
|
HI @krzysztofkuzniar . I am not able to reproduce issue by steps from comment on 2.4-develop. Are you facing with this issue on branch 2.4-develop? |
@krzysztofkuzniar, we are closing this issue due to inactivity. If you'd like to update it, please reopen the issue. |
Preconditions
Steps to reproduce
Or in comment -> #18027 (comment)
Expected result
0,00 €
Actual result
NaN,N €
This issue might be a parsing issue in the frontend or a rounding issue in the backend, as the
/rest/default/V1/guests-cart/…/totals-information
returns a JSON response including"grand_total":1.4210854715202e-14
(which is basically 0). Either the Frontend has an issue parsing this value or the backend shouldn’t even return a value that hasn’t been rounded. In some cases this value can even be negative and would result in-NaN,N €
.The text was updated successfully, but these errors were encountered: