Skip to content

Magento\Tax\Pricing\Adjustment ignores rounding configuration #108

@HirokazuNishi

Description

@HirokazuNishi

Precondition

Install Magento2.3.4 and sample data.
Install CommunityEngineering/CurrencyPrecision.
Set JPY for base currency and display currency.
Set "floor" for rounding method.
Set "show both price" for catalog price display configuration on tax configuration.
Set 10% for product tax.
Check both data-price-amount attribute value on product listing or detail page .

Expected result

  • Product prices displayed on both product list page and detail page aren rounded as expected.

correct-rounding

Actual result

  • Product prices aren't rounded on php level. JS rounds them, but it reflects Magento configuration.

incorrect-rounding

Issue Reason

Magento\Tax\Pricing\Adjustment has 2 important methods. extractAdjustment and applyAdjustment. These methods call getTaxPrice and try to calculate product price, but 9th argument is always "false". For JPY and other integer currencies need "true" for rounding fraction.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions