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

[Hydrogen React] ProductPrice priceV2 deprecation. Hide compareAt, if less than regular #2461

Merged
merged 8 commits into from
Sep 3, 2024

Conversation

andershagbard
Copy link
Contributor

@andershagbard andershagbard commented Aug 22, 2024

WHY are these changes introduced?

  • priceV2 is deprecated
  • Component will show compareAt price, even if the compareAt price is less than the regular price. This doesn't feel right.

WHAT is this pull request doing?

  • Warn users not to use priceV2, but instead price. It will still work with priceV2, but log a warning.
  • Doesn't show compareAt price if compareAtPrice is less than regular price

HOW to test your changes?

Tests has been added, and some changed

Checklist

  • I've read the Contributing Guidelines
  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've added a changeset if this PR contains user-facing or noteworthy changes
  • I've added tests to cover my changes
  • I've added or updated the documentation

@andershagbard andershagbard changed the title Update ProductPrice component to use price, instead of pricev2 [Hydrogen React] ProductPrice priceV2 deprecation. Hide compareAt, if less than regular Aug 22, 2024
Copy link
Contributor

@wizardlyhel wizardlyhel left a comment

Choose a reason for hiding this comment

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

Couple minor code suggestions - Please add it to your PR and I can merge this for next release I've merged it

.changeset/lovely-phones-grab.md Outdated Show resolved Hide resolved
packages/hydrogen-react/src/ProductPrice.tsx Show resolved Hide resolved
@wizardlyhel wizardlyhel merged commit ca0c769 into Shopify:main Sep 3, 2024
6 of 7 checks passed
@andershagbard andershagbard deleted the patch-1 branch September 4, 2024 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants