-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Hydrating an active order only applies prices to the variant of the first order line #2013
Comments
Hi Martijn, It took me a while to get round to this, but I just added your tests to the existing entity-hydrator.e2e-spec.ts suite and it passed. So I'm suspecting that this somehow got fixed between 1.9.2 -> 2.0.5? Have you run into this in the latest versions? In any case, I'll leave the e2e tests in the suite to ensure this does not regress. |
Thanks for looking into this. Unfortunately the issue still persists on my end. I've created a reproducable setup here: You can
❯ testing.spec.ts (4) 5162ms
❯ Hydration issue (4) 5162ms
✓ Create order with 3 items 302ms
✓ Variant of orderLine 1 has a price
× Variant of orderLine 2 has a price
× Variant of orderLine 3 has a price |
Thanks. This lead me to discover that I can reproduce the error when using postgres / sqlite - but it works with mysql, mariadb & sqljs! I'll look into how to fix... |
Strange 😞 I remember last time we had an issue that was DB specific, it was caused by the order in which arrays were returned... EDIT: nvm, I see it's already closed, nice! |
Describe the bug
When hydrating an active order with
applyProductVariantPrices=true
, only the variant of the first order line has pricing applied, the other will have price 0;To Reproduce
Steps to reproduce the behavior: (see e2e test below)
order.lines[0].productVariant.price
will be 155880, whileorder.lines[1].productVariant.price
will be 0.Adding the variants in a different order will result in the same issue: it's always only the first variant that will have pricing applied.
Expected behavior
I would expect all the variants to have the correct pricing.
Environment (please complete the following information):
Additional context
You should be able to just copy and paste the test case below.
Products.csv:
hydration-error.spec.ts
The text was updated successfully, but these errors were encountered: