RFC: product sort in collection page #173
Replies: 3 comments 2 replies
-
Hi @ahmed-adly-khalil I love the idea. I think we'll need to validate the exact UX on our end. We are in the process of validating and building a search page, and a component like this would possibly be useful there as well. With regards to the implementation details, it will need to use |
Beta Was this translation helpful? Give feedback.
-
🎉
Sounds good, just be sure to use the sort keys from the storefront API (I noticed the ones you linked are for the Admin API, which includes different sort keys)
Definitely interested to see how this takes shape for you. In the past, I encountered difficulties building headless components that require drop down menus. For example, we wanted to build a Currency Selector into Hydrogen, but has difficulties building that headless, so we ended up just providing utilities via the I recommend taking a look at What are headless components? and How to build headless components before diving in too deep!
👍 |
Beta Was this translation helpful? Give feedback.
-
I went ahead and created the initial draft PR, appreciate your feedback guys Shopify/hydrogen#224 |
Beta Was this translation helpful? Give feedback.
-
Hello everyone 👋
I'm working to implement a hydrogen component for product sort similar to what we have in liquid themes as below:
This post is to get some validation on the component design, so appreciate any/all feedback
My proposed design is as follows:
QUERY
object in the collection pageProductSort
component folder under hydrogen components which contains:ProductSort.client.tsx
-> client side implementation for the sort dropdown which will use append asory-key
param to the page URLsortKey
that reads the URL param usinguseParams
with a default value ofUPDATED_AT
My assumption is that this approach won't trigger a full page refresh and won't need to use something like
setServerState
to notify the collection page of the change in URL, will need to validate thiscan I get some feedback if this approach is in line with the hydrogen design direction?
Beta Was this translation helpful? Give feedback.
All reactions