Description
Preconditions and environment
- Magento version: 2.4.5
tax/calculation/price_includes_tax
must be set toExcluding Tax
so that prices in entered in adminhtml are without taxtax/display/type
must be set toIncluding Tax
so that prices are shown including tax in GraphQl- A product with a price of 10
- A tax rule which is applied for the store you use when testing
Steps to reproduce
- Execute the following query: (replace category_uid with your category or remove it)
query route {
products(sort: { price: ASC }, filter: { price: { from: 10, to: 15}, category_uid: { eq: "Mzk=" }}) {
items {
price_range {
minimum_price {
final_price {
value
}
}
}
}
}
}
Expected result
All products with a price including tax above 10 or more and 15 or less are included in the response.
Actual result
Products with a price including tax above 10 or more are only included if the price that is set in adminhtml is above 10, the tax is not taken into account when filtering.
The same goes for the "to" part of the filter. Products with a price greater than 15 including tax are included in the result.
Here you can see the results of the query when filtering for a price from 10 to 15:
{
"data": {
"products": {
"items": [
{
"price_range": {
"minimum_price": {
"final_price": {
"value": 13.52
}
}
}
},
{
"price_range": {
"minimum_price": {
"final_price": {
"value": 14.88
}
}
}
},
{
"price_range": {
"minimum_price": {
"final_price": {
"value": 15.898401
}
}
}
}
]
}
}
}
A product with a price of 15.89 is included because the price without tax is 13.35 (german tax rate of 19% is applied).
A product with a price of 10.79 is not included because the price without tax is 9.06 (also german tax rate).
The product is only included when setting the price filter range from 9 to 15, here is the result:
{
"data": {
"products": {
"items": [
{
"price_range": {
"minimum_price": {
"final_price": {
"value": 10.793301
}
}
}
},
{
"price_range": {
"minimum_price": {
"final_price": {
"value": 11.65
}
}
}
},
{
"price_range": {
"minimum_price": {
"final_price": {
"value": 11.65
}
}
}
},
{
"price_range": {
"minimum_price": {
"final_price": {
"value": 13.52
}
}
}
},
{
"price_range": {
"minimum_price": {
"final_price": {
"value": 14.88
}
}
}
},
{
"price_range": {
"minimum_price": {
"final_price": {
"value": 15.898401
}
}
}
}
]
}
}
}
Additional information
No response
Release note
No response
Triage and priority
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.