Skip to content

special price & tier price are coming in base currency #26121

Closed
@mkum73

Description

@mkum73

In Graphql fetch data for special price & tier prices in products query. The values come always in base currency.

Preconditions (*)

  1. Magento based on '2.4-develop' branch

  2. Have a product created with name "Beginner's Yoga" (or refer to the same named product that becomes available with sample data) and set the following prices
    a. price: 6
    b. Advanced pricing > special price: 5
    c. Advanced Pricing > Catalog and Tier Price, for all websites and all groups, fixed type price,
    - for qty 2 price 4
    - for qty 3 price 3

  3. Add new store view with code "eur_view"

  4. Navigate to Store -> Settings -> Configuration -> General -> Currency Setup and allow EURO in Allowed Currencies and Save Configuration

  5. Change the Scope to the second Eur View and set Default Display Currency to Euro

  6. Ensure there are currency rates available (e.g. on frontend catalog if the store view is switched price would change from 6 to 4.24 -> indicating that the USD -> EUR rate is 1.415)

Steps to reproduce (*)

  1. Set header "Store = default" and execute this query
    query{ products(search: "Beginner's Yoga"){ total_count items { name price_range { minimum_price { regular_price { currency value } final_price { currency value } } } special_price price_tiers { final_price { currency value } quantity } sku } } }

  2. Prices now are expected in Default Store view in USD, response should look like
    { "name": "Beginner's Yoga", "price_range": { "minimum_price": { "regular_price": { "currency": "USD", "value": 6 }, "final_price": { "currency": "USD", "value": 5 } } }, "special_price": 5, "price_tiers": [ { "final_price": { "currency": "USD", "value": 4 }, "quantity": 2 }, { "final_price": { "currency": "USD", "value": 3 }, "quantity": 3 } ], "sku": "240-LV04" }

  3. Set header "Store = eur_view" and execute the query again

  4. Prices now are expected in Eur View in EUR currency, response should look like
    { "name": "Beginner's Yoga", "price_range": { "minimum_price": { "regular_price": { "currency": "EUR", "value": 4.24 }, "final_price": { "currency": "EUR", "value": 3.53 } } }, "special_price": 5, "price_tiers": [ { "final_price": { "currency": "EUR", "value": 4 }, "quantity": 2 }, { "final_price": { "currency": "EUR", "value": 3 }, "quantity": 3 } ], "sku": "240-LV04" }

Observe how the regular_price.minimum_price and regular_price.final_price have changed its value, but not the special_price or the values respectively for the price_tiers

Expected result (*)

  1. special_price should display values corrected by the USD->EUR rate (E.g. something like 3.53)
  2. price_tiers.final_price.value should display values corrected by the USD->EUR rate

Actual result (*)

  1. special_price still displays 5
  2. price_tiers.final_price.value is still displayed in USD and displays 4 for qty 2, and 3 for qty 3

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions