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-17442945 BOPIS Shop the Store PLP and PDP SteelThread #2226

Open
wants to merge 16 commits into
base: feature-bopis
Choose a base branch
from

Conversation

hajinsuha1
Copy link
Collaborator

@hajinsuha1 hajinsuha1 commented Jan 28, 2025

Description

PLP: Adds a checkbox refinement to filter products by store availability
PDP: Adds text on store availability

This PR is a SteelThread for updating the PLP and PDP with base functionality of "Shop the Store" to verify the Shopper API's didn't require any changes. We have separate stories for finalizing the design for the PLP and PDP.

W-17442945
Figma PDP "BOPIS"
Figma PLP "BOPIS"

PLP

Before

Screenshot 2025-01-30 at 3 17 38 PM

After

Screenshot 2025-01-30 at 3 17 13 PM

PDP

Before

Screenshot 2025-01-30 at 3 17 59 PM

After

Screenshot 2025-01-30 at 3 18 12 PM

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

  • Update ProductView to include a StoreAvailabilityText that displays whether the item is in stock at the selected store
  • Add a useSelectStore custom hook for handling setting and getting store info from local storage
  • Update ProductDetail to pass the inventoryId of the selected store in the parameters of useProduct
  • Update ProductList to include a StoreAvailabilityRefinement that allows users to filter products by store

How to Test-Drive This PR

For this work, i've updated zzrf_001 and added a new inventory inventory_m_store_store12 and assigned it to the San Mateo Retail Store in BM.

Latest changes have been deployed to https://cloud-jinsu-env3.mobify-storefront-staging.com/

No Store Selected

  • Navigate to https://cloud-jinsu-env3.mobify-storefront-staging.com/
  • Click on a product category and verify there is a new Shop by Availability accordian panel with a checkbox item with the text Select Store
  • Click on a product and verify there is text under the quanity that displays In Stock at Select Store

Store with no inventoryId Selected

PLP

PDP

  • Navigate to any product
  • Verify under quanitity "Out of Stock at Palo Alto Retail Store" is displayed

Store with inventoryId Selected

PLP

  • Navigate to https://cloud-jinsu-env3.mobify-storefront-staging.com/global/en-GB/category/womens
  • Open the Store Locator modal, select United States for the country and enter 94086 for the postal code.
  • Select San Mateo Retail Store
  • Open the Developer Console
  • Under "Shop by Availability" select "San Mateo Retail Store"
  • Verify only 3 products are now displayed
  • Verify a /product-search API call is made with the query param: ?refine: ilids=inventory_m_store_store12
  • Uncheck "San Mateo Retail Store"
  • Verify all the products are displayed and a /product-search API call is made without the query param: ?refine: ilids=inventory_m_store_store12

PDP

Other Tests

  • Verify the store name re-renders immediately on the PDP and PLP when the selection changes via the modal

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)

Comment on lines 31 to 42
export const StoreLocatorContext = createContext()
export const StoreLocatorProvider = ({children}) => {
const storeLocator = useStoreLocator()

return (
<StoreLocatorContext.Provider value={storeLocator}>{children}</StoreLocatorContext.Provider>
)
}

StoreLocatorProvider.propTypes = {
children: PropTypes.node.isRequired
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

would it be preferred to move this to the contexts/index.js?

StoreLocatorProvider.propTypes = {
children: PropTypes.node.isRequired
}

export const useStoreLocator = () => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

any preference on leaving this code here or moving it to a separate file in hooks/use-store-locator?

Copy link
Collaborator

@jeremy-jung1 jeremy-jung1 Feb 4, 2025

Choose a reason for hiding this comment

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

Sounds good. That would make file changes to the store locator modal more easy

/>
)}

<Link>{selectedStore.name}</Link>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it's possible to create a store with no name. Should we throw an error in that case?

Copy link
Collaborator

@jeremy-jung1 jeremy-jung1 Feb 4, 2025

Choose a reason for hiding this comment

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

If a store is created with no name, that should be a concern on the BM/store creation side and not an error that the shoppers' UX should have to deal with. I think it would be fine to keep it simple and just display what the API gives.

@hajinsuha1 hajinsuha1 marked this pull request as ready for review January 30, 2025 21:59
@hajinsuha1 hajinsuha1 requested a review from a team as a code owner January 30, 2025 21:59
@jeremy-jung1
Copy link
Collaborator

jeremy-jung1 commented Feb 4, 2025

I'm seeing the DNT notification pop up again and again. Can you try doing npm run build on commerce-sdk-react and deploying the site again?

I don't see this issue locally but just making sure

@hajinsuha1
Copy link
Collaborator Author

I'm seeing the DNT notification pop up again and again. Can you try doing npm run build on commerce-sdk-react and deploying the site again?

I don't see this issue locally but just making sure

@jeremy-jung1 thanks for catching that! I've redeployed the site and it looks like the DNT pop up is working now

Copy link
Collaborator

@jeremy-jung1 jeremy-jung1 left a comment

Choose a reason for hiding this comment

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

LGTM. Test drive works for me too

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.

2 participants