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

W-14308527 Pricing display on cart, checkout, wishlist pages #1796

Merged

Conversation

alexvuong
Copy link
Collaborator

@alexvuong alexvuong commented May 22, 2024

Description

Pricing display on cart checkout wishlist pages due to product tile revampe

Types of Changes

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Breaking change (could cause existing functionality to not work as expected)
  • Other changes (non-breaking changes that does not fit any of the above)

Breaking changes include:

  • Removing a public function or component or prop
  • Adding a required argument to a function
  • Changing the data type of a function parameter or return value
  • Adding a new peer dependency to package.json

Changes

  • Use DisplayPrice component in item-variant component
  • Allow DisplayPrice to take quantity into account

How to Test-Drive This PR

  • Checkout code
  • Run retail app
  • Go to PDP, add a product
  • Confirm that pricing in AddToCart Modal is correct
  • Confirm that cart page is showing pricing correctly with strikethrough price
  • Add an item to wishlist
  • Confirm that pricing is displaying according to the quantity in wishlist page

Checklists

General

  • Changes are covered by test cases
  • CHANGELOG.md updated with a short description of changes (not required for documentation updates)

Accessibility Compliance

You must check off all items in one of the follow two lists:

  • There are no changes to UI

or...

Localization

  • Changes include a UI text update in the Retail React App (which requires translation)

@alexvuong alexvuong changed the title W-14308527 Pricing display on cart checkout wishlist W-14308527 Pricing display on cart, checkout, wishlist pages May 24, 2024
@alexvuong alexvuong marked this pull request as ready for review May 27, 2024 20:08
@alexvuong alexvuong requested a review from a team as a code owner May 27, 2024 20:08
@@ -84,31 +91,41 @@ test('should render product details page', async () => {
global.server.use(
// Use a single product (and not a product set)
rest.get('*/products/:productId', (req, res, ctx) => {
return res(ctx.json(productsResponse.data[0]))
return res(ctx.json(masterProduct))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We pushed history to be a master product, we should mock the data accordingly. the productsResponse.data[0] we used previously was a variant product, not a master one. Therefore, although the tests passed, but it caused a lot of react warning errors during the tests. This would fix these errors

@vmarta
Copy link
Contributor

vmarta commented May 28, 2024

For this particular product, I'm not seeing the strikethrough price, even though the API response contains the list price in there.

Arc 2024-05-28 at 11 00 54

@vmarta
Copy link
Contributor

vmarta commented May 28, 2024

In my previous screenshot, now we're showing the unit price, even when the quantity is 1. Originally we show the unit price only when the quantity is more than 1.

What is the supposed to be the correct behaviour?

@vmarta
Copy link
Contributor

vmarta commented May 28, 2024

Checkout is currently broken. Entering the Checkout page from Cart shows me this error:

Arc 2024-05-28 at 11 15 04

@alexvuong
Copy link
Collaborator Author

alexvuong commented May 28, 2024

For this particular product, I'm not seeing the strikethrough price, even though the API response contains the list price in there.

Arc 2024-05-28 at 11 00 54

@vmarta For the price here, we are using basket pricing instead of getProduct pricing since basket pricing may include different promotion/discount on basket level. For this particular product, it does not seem to return the list price of the products at all

IMO, we should either use basket pricing OR product pricing to display price (via getPriceData util), we should not attempt mix these data together since it is a complicated to understand that calculation for basket pricing and we may do it incorrectly. I don't think it is a big deal to miss the strikethrough price here since it is mostly informative, the price that shopper has to pay is correct.
image

@alexvuong
Copy link
Collaborator Author

In my previous screenshot, now we're showing the unit price, even when the quantity is 1. Originally we show the unit price only when the quantity is more than 1.

What is the supposed to be the correct behaviour?

Good catch, I've fixed it to match the original behavior.

@alexvuong
Copy link
Collaborator Author

Checkout is currently broken. Entering the Checkout page from Cart shows me this error:

Arc 2024-05-28 at 11 15 04

This is fixed. Thanks for catching that

@bendvc
Copy link
Collaborator

bendvc commented May 29, 2024

image

In the above picture am I supposed to see strike-through pricing as I did on the PDP and add-to-cart modal?

@alexvuong
Copy link
Collaborator Author

image In the above picture am I supposed to see strike-through pricing as I did on the PDP and add-to-cart modal?

Please see this comment #1796 (comment)

@alexvuong alexvuong merged commit 6d9f390 into v3/product-tile-revamp May 30, 2024
28 checks passed
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.

3 participants