Skip to content
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

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

Closed
mkum73 opened this issue May 7, 2019 · 8 comments · Fixed by #28890
Closed

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

mkum73 opened this issue May 7, 2019 · 8 comments · Fixed by #28890
Assignees
Labels
Component: CatalogGraphQl Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed PAP Partners acceleration program Project: GraphQL
Milestone

Comments

@mkum73
Copy link

mkum73 commented May 7, 2019

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
@TomashKhamlai
Copy link
Contributor

Accept my apologies. This issue will be delayed. The reason: there is already created tasks for improving that can be found by label "magento-core" (i.e magento/graphql-ce#566).

I strongly recommend to update the issue by adding:

  • Preconditions
  • Steps to reproduce
  • Expected and actual results

@mkum73
Copy link
Author

mkum73 commented May 9, 2019

/* Steps to reproduce */

  1. Run Graphql query
    {products(filter: {sku: {eq: "some sku"}}) {...}
  2. change currency

/* Expected and actual results */

  1. price is changed as per currency
  2. special price is still in base currency, it should be in changed currency
  3. Tier price is still in base currency, it should be in changed currency

@TomashKhamlai
Copy link
Contributor

@lenaorobei, it is reproducible with the latest 2.3-develop.

Steps to reproduce

  1. Go to Stores -> All Stores and create additional Store (second column) for the same website.
  2. Create the Store View for that Store
  3. Navigate to Store -> Settings -> Configuration -> General -> Currency Setup and allow EURO in Allowed Currencies and Save Configuration
  4. Change the Scope to the second Store View and set Default Display Currency to Euro
  5. Setup Currency Rates with Fixer or set manually

Run query products but set the proper header.

  1. Set Default Display Currency to Euro in the Global Scope

Run query products without headers

@pmclain pmclain self-assigned this Aug 27, 2019
pmclain referenced this issue in pmclain/graphql-ce Aug 27, 2019
@lenaorobei lenaorobei transferred this issue from magento/graphql-ce Dec 18, 2019
@m2-assistant
Copy link

m2-assistant bot commented Dec 18, 2019

Hi @mkum73. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

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:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

@mkum73 do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed label Dec 18, 2019
@magento-engcom-team magento-engcom-team added Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed and removed Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed labels Dec 18, 2019
@m2-assistant
Copy link

m2-assistant bot commented Dec 18, 2019

Hi @TomashKhamlai. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@sdzhepa
Copy link
Contributor

sdzhepa commented Dec 18, 2019

Hi @TomashKhamlai

Could you please help us with additional details about this issue?

  • Actual/Expected results
  • Example of query

@m2-assistant
Copy link

m2-assistant bot commented Jun 24, 2020

Hi @pmarjan. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

    1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
      DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
    1. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.
    1. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
    1. Verify that the issue is reproducible on 2.4-develop branch
      Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
      - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
      - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

@pmarjan pmarjan linked a pull request Jun 25, 2020 that will close this issue
4 tasks
pmarjan added a commit to pmarjan/magento2 that referenced this issue Jun 29, 2020
Adjust to take customer group (via setting customerGroupId) into consideration.
pmarjan added a commit to pmarjan/magento2 that referenced this issue Jun 30, 2020
Edits, Support by api-functional tests, Address static tests
pmarjan added a commit to pmarjan/magento2 that referenced this issue Jun 30, 2020
pmarjan added a commit to pmarjan/magento2 that referenced this issue Jul 11, 2020
Refactor to pass new optional parameter to @api class constructor
pmarjan added a commit to pmarjan/magento2 that referenced this issue Jul 12, 2020
pmarjan added a commit to pmarjan/magento2 that referenced this issue Jul 12, 2020
pmarjan added a commit to pmarjan/magento2 that referenced this issue Jul 13, 2020
pmarjan added a commit to pmarjan/magento2 that referenced this issue Jul 16, 2020
pmarjan added a commit to pmarjan/magento2 that referenced this issue Jul 17, 2020
pmarjan added a commit to pmarjan/magento2 that referenced this issue Jul 17, 2020
pmarjan added a commit to pmarjan/magento2 that referenced this issue Jul 17, 2020
@magento-engcom-team magento-engcom-team added the Fixed in 2.4.x The issue has been fixed in 2.4-develop branch label Jul 19, 2020
magento-engcom-team added a commit that referenced this issue Jul 19, 2020
…urrency #28890

 - Merge Pull Request #28890 from pmarjan/magento2:graphql-26121
 - Merged commits:
   1. 5c69aa1
   2. cce0a99
   3. 89b968a
   4. 75f71a4
   5. 4c5086a
   6. 9bd5def
   7. 7a526e9
   8. d99ff1b
   9. 831fb5b
   10. f83763e
   11. 20cd3d0
   12. 9d80fa3
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: CatalogGraphQl Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed PAP Partners acceleration program Project: GraphQL
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants