Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi
I am trying to implement wishlist functionality through customer metafields. Can anyone help me on how to update the customer metafield when a product is added to or removed from wishlist in liquid store through ajax call.
I implemented in a different way earlier where product data is stored in local storage but the drawback here is it doesnt store data for the registered uers when they log out and then log in. So to save logged in users wishlist I need help on updating metafields with product data.
Thanks
Khasim
There is no way to update metafields through ajax API but admin apis because it requires write_products scopes
You could create a custom app in Admin, and check Admin API integration scopes: write_products and read_products to manage product metafields.
Then, you could use the given access token to make a Shopify API call to update product metafields. But, access token is too dangerous to be exposed to the storefront, you should hide the real logic behind the app proxy. In general, you must develop a simple server for that 😫
B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.
B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.
B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.
BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now
If possible can you provide any reference which I can follow to implement this?
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024