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

Price list not applied #9625

Closed
lexvz14 opened this issue Oct 16, 2024 · 6 comments
Closed

Price list not applied #9625

lexvz14 opened this issue Oct 16, 2024 · 6 comments

Comments

@lexvz14
Copy link

lexvz14 commented Oct 16, 2024

Bug report

Describe the bug

Price lists do not seem to be applied to prices returned in API requests.

System information

Medusa version (including plugins): 2.0.0 RC #6
Node.js version: V20
Database: PostgreSQL
Operating system: N/A
Browser (if relevant): N/A

Steps to reproduce the behavior

  1. Create a price list
  2. Apply price list to customer group or date set that is applicable
  3. Create prices for price list
  4. Check API response

Expected behavior

API should return calculated_price based on price list.

Code snippets

As you can see by the boolean "is_calculated_price_price_list": false, no price list has been applied to the calculated price.

...
                    "calculated_price": {
                        "id": "pset_01J7KNCEDF5PE97KF0GGKCN1QG",
                        "is_calculated_price_price_list": false,
                        "is_calculated_price_tax_inclusive": false,
                        "calculated_amount": 14.99,
                        "raw_calculated_amount": {
                            "value": "14.99",
                            "precision": 20
                        },
                        "is_original_price_price_list": false,
                        "is_original_price_tax_inclusive": false,
                        "original_amount": 14.99,
                        "raw_original_amount": {
                            "value": "14.99",
                            "precision": 20
                        },
                        "currency_code": "eur",
                        "calculated_price": {
                            "id": "price_01J7KNCEDFCBWR8ERZVX7BXKR1",
                            "price_list_id": null,
                            "price_list_type": null,
                            "min_quantity": null,
                            "max_quantity": null
                        },
                        "original_price": {
                            "id": "price_01J7KNCEDFCBWR8ERZVX7BXKR1",
                            "price_list_id": null,
                            "price_list_type": null,
                            "min_quantity": null,
                            "max_quantity": null
                        }
                    }
 ...

Additional context

I've tried price lists without rules, with date rules, overrides, sale prices, but none seem to result in a calculated_price field based on something other than the original price. As you can see in the response, the original_price.id is equal to the calculated_price.id.

@olivermrbl
Copy link
Contributor

I was unable to reproduce your issue.

Here's what I did:

  • npx create-medusa-app@preview with Next.js application
  • Open storefront, see price of 10$ for a t-shirt
  • Create price list (starting today)
  • Add t-shirt with price of 5$ to price list
  • Refresh storefront, see price of 5$ for a t-shirt

Can you please provide the exact steps to reproduce the issue starting from a fresh project?

Closing until more information has been added.

@lexvz14
Copy link
Author

lexvz14 commented Oct 17, 2024

I tried with a fresh install. Date filters seem to work indeed, however, testing with a customer group did not in my case. To be sure; the steps to create a registered customer in a customer group:

  1. POST /auth/customer/emailpass/register
  2. With the token obtained in the previous request, call POST /store/customers with a matching email address
  3. From admin, create customer group 'test'
  4. From admin, add customer created in step two to 'test' customer group

I created a price list with the sample sweatshirt product, applying the 'test' customer group as a filter. Result: no price overrides returned in calculated_price field. If I remove the filter (e.g. price list is applied for all customers), I do see the adapted price.

Any thoughts on my steps?

@JohnGemstone
Copy link
Contributor

Hey @lexvz14 did you manage to find a solution to this, I seem to be experiencing the same behaviour.

@lexvz14
Copy link
Author

lexvz14 commented Nov 25, 2024

I did not @JohnGemstone.

@JohnGemstone
Copy link
Contributor

@lexvz14 good news, seems like today's latest update (v2.0.5) fixes this:
#10197

be sure to run migrations after the update

@olivermrbl
Copy link
Contributor

Yes, this was fixed in the latest releases.

Please make sure to update to v2.0.6, as v.2.0.5 was shipped with a bug around product images on the update and create operations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants