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

currencyCode in the request query parameter is ignored #3232

Open
mito4ek opened this issue Nov 25, 2024 · 2 comments
Open

currencyCode in the request query parameter is ignored #3232

mito4ek opened this issue Nov 25, 2024 · 2 comments
Labels
type: bug 🐛 Something isn't working

Comments

@mito4ek
Copy link

mito4ek commented Nov 25, 2024

Describe the bug
I'm trying to fetch the data with currencyCode in the URL but have no success, only default currency is returned

It is stated in the documentation that: The default strategy is to return the price in the currency of the current session request context, which is determined firstly by any ?currencyCode=XXX query parameter on the request, and secondly by the defaultCurrencyCode of the Channel.

To Reproduce
Steps to reproduce the behavior:

  1. Configure multiple currencies in the channel
  2. Add prices on the product variant in different currencies
  3. Open postman or any other HTTP client and execute the query
http://localhost:3000/shop-api?languageCode=en&currencyCode=EUR
query Search {
    search(input: { collectionId: "12" }) {
        totalItems
        items {
            productName
            price {
                ... on PriceRange {
                    min
                    max
                }
                ... on SinglePrice {
                    value
                }
            }
            currencyCode
            priceWithTax {
                ... on PriceRange {
                    min
                    max
                }
                ... on SinglePrice {
                    value
                }
            }
        }
    }
}

Result
{ "data": { "search": { "totalItems": 1, "items": [ { "productName": "standart test product 1", "price": { "value": 2500 }, "currencyCode": "USD", "priceWithTax": { "value": 2500 } } ] } } }

Expected behavior
to get the currencyCode in EUR and price configured in EUR in the admin panel

  • @vendure/core version: 3.0.5
  • nodejs - 20.16
  • postgres 17
@mito4ek mito4ek added the type: bug 🐛 Something isn't working label Nov 25, 2024
@oidt
Copy link
Contributor

oidt commented Nov 25, 2024

It is for search query: #2280

@mito4ek
Copy link
Author

mito4ek commented Nov 26, 2024

It is for search query: #2280

Thanks for the reply, will monitor that thread

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants