medusa
medusa copied to clipboard
prices region in product list
Bug report
Describe the bug
Hey, im trying to get region information in store/products?expand=variants,variants.prices,variants.prices.region, but response only has prices in variants, also if i'm sending this: expand=variants, i still will get prices in the response
System information
Medusa version (including plugins):1.38 Node.js version:14 Database:postgres Operating system: Browser (if relevant):
Steps to reproduce the behavior
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected behavior
A clear and concise description of what you expected to happen
Screenshots
If applicable, add screenshots to help explain your problem
Code snippets
If applicable, add code samples to help explain your problem
Additional context
Add any other context about the problem here
Thanks for reporting - this happens because we are collecting the product prices separately from the products as seen here: https://github.com/medusajs/medusa/blob/master/packages/medusa/src/api/routes/store/products/list-products.ts#L223
The PricingService doesn't take the expand param into account so there is no option to collect more data when the prices are fetched this way through.
We can look into expanding the PricingService to send this information back as well!
Out of curiosity, what will you use the data for?
We wanted to get information to display the price without sending a request to create a cart or to get a list of regions. But that's not a problem.
Thanks for the answer