-
Notifications
You must be signed in to change notification settings - Fork 76
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
Improvement Request #13
Comments
@rorstuff In order to include more data on the wishlist we'll need to switch the localStorage array to hold objects instead of strings. An example of the object could be like this: {
handle: <product-handle>,
variantId: <variant-id>,
} Using objects slightly complicates the helper functions for getting, setting and updating the wishlist. I'll see if I can get a more full code example for you in the coming weeks. |
Thank you @dlerm. I have since built what I needed by storing data as serialized JSON in localStorage. If you would like to see the code, let me know and I will send it to you. |
Hi @dlerm, I'm joining this conversation about "Improvement". Thank you. Kind regards, |
For the record, this is not meant to be a fully robust solution for a wishlist in the Shopify ecosystem. This repo is meant to serve as a base set of functionality for handling client-side wishlists. Admittedly, client-side is much more limited than server-side(Shopify apps), but this project helps fill the gap for those looking to implement a simple wishlist without an app. With that:
|
@dlerm I'm okay with the other comments, I'll experiment new features and if I find interesting solutions I could share them with you in this git project. I'm currently working on wishlist item count to include on Wishlist link in the header menu. |
@rorstuff I would love to see the solution you came up with! I could easily pass variant-id as another data attribute. Folks implementing the wishlist would have to update that data attribute value on their own depending on how their product form works. |
Hi,
I have been working on a way to create a wishlist that stores each product with the variant ID in the user's local storage. A project that I'm working on requires that specific variants are saved to the wishlist, or in my case, a product list that is populated inside a form to be submitted for wholesale quotes.
This code has given me a jumpstart on the project and I'm hoping to have a version that stores the handle along with the variant ID so that the product card can be filtered to display the variant saved by the customer.
If you know of an easy way to implement this that would be great!
Thank you
The text was updated successfully, but these errors were encountered: