0

Due to the business logic and requirement, I need the order item price not to be rounded. Because if you are purchasing the product with high quantity, the loss could be numbered.

E.g: Product price: $48.9383 Qty: 10

The collect total process will give a result at below Cart Subtotal: $48.94

I see the roundPrice function they used in currency interface but I wonder how can I just skip the round step for only a few specific places and not touch or mess up other processes.

0

find below files and than override and try with round function.

vendor/magento/module-quote/Model/Quote/Address/Total/Grand.php

find total->setGrandTotal and apply php round function.

i hope its work for you.

  • Thanks, @Anas, I have resolved it by using an observer to listen to the process before the quote is submitted and calculate anything before it becomes an order. Core rewrite is the last choice I would ever make. – phucnguyen.sw Jul 30 '19 at 19:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.