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

fix: adds new pricing field to product variants in order to correctly display prices #6159

Merged
merged 6 commits into from
Mar 27, 2020

Conversation

willopez
Copy link
Member

Resolves #6152
Impact: minor
Type: bugfix

NOTE test with PR: reactioncommerce/reaction-admin#246

Issue

Description of the issue this PR is solving, why it's happening, and how to reproduce it. This may differ from the original ticket as you now have more information at your disposal.

Solution

The price field on variants was not flexible enough to accommodate a variant having options with their own prices. A new field pricing has been added to the Product and ProductVariant types. This new field has a transformer that determines the correct value to return depending on whether a variant is a parent variant or not.

Breaking changes

None.

NOTE The field price has been deprecated in favor of pricing both on products and variants.

Testing

  1. Test with Admin PR: fix: correctly set and render prices for variants and options in product reaction-admin#246 and follow testing instructions there.

Copy link
Member

@mikemurray mikemurray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm seeing an issue where the data in the database is saved incorrectly for Variants with Options. The price min and max are being saved as objects instead of as floats. I'm also seeing incorrect values for the price ranges for the Product, and top-level Variant, likely due to this bug. Something may be wrong with the updateVariantPrices mutation or app events thereafter.

image

@willopez willopez dismissed mikemurray’s stale review March 27, 2020 17:25

creating new issue for remaining changes.

@willopez
Copy link
Member Author

Currency symbol issue: #6162

Copy link
Member

@mikemurray mikemurray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mikemurray mikemurray merged commit 75989b8 into trunk Mar 27, 2020
@mikemurray mikemurray deleted the refactor-use-consistent-pricing-field branch March 27, 2020 20:25
@kieckhafer kieckhafer mentioned this pull request Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GQL: Variant can be both a float or an object(price range)
2 participants