API or Object to add product items to favorite list(Wish list) in Shopify

Dear all,

I am working on new store for our custome in shopify platform. As i am new to this shopify, please provide your tips. So that it could help me to resolve this issue.

I want to add user’s desired product items into t Wish list in their user account. So that, user could view that list directly and make an order.

In shopify, is there any API or Object to store user’s favorite items into their favorite list. So that, next time or in future, they could make an order from favorite list itself.

Thanks in advance.!

Regards,

Pon maheswaran K

Dear all,

Using Shopify’s customer admin API (Ex: “https://“+ACCESS_ID+”:“+ACCESS_PASSWD+”@famzon-dev-store.myshopify.com/admin/api/2020-07/customers/“+‘{{customer.id}}’+”.json”), user’s desired product(Product ID as “key” and product name as “value”) has been added to customer’s metafield.

Using following API, customer metadata has been retrieved.

https://"+ACCESS_ID+":"+ACCESS_PASSWD+"@famzon-dev-store.myshopify.com/admin/customers/"+customer_id+"/metafields.json

Form this out json, prod IDs has been extracted and put into Arraylist.

To display the product in favorite item list, used following API to get only favorite product details. For that API, we need to pass above retrieved product IDs are as input data(To retrieve only specific product details instead of all).

https://"+ACCESS_ID+":"+ACCESS_PASSWD+"@famzon-dev-store.myshopify.com/admin/api/2020-07/products.json?ids="+product_id

In the above API, “product_id” is a string appended with product IDs separated by comma(,) like follows.

“632910392,921728736”

By parsing response JSON data from above URL, we are populating product list manually by iterating product array(Response JSON) it and generating HTML tags with respecve data and appending into DIV to display as grid format.

Regards,

Pon maheswaran K

Hey Pon maheswaran,

I would love to implement a wishlist in my store dripnsmoke.com too. Is there any way you could explain your steps a bit easier for dummies?

Thanks a lot!

:warning: Smart solution using metafields but your shop’s API access password and ID are exposed in javascript documents and visible in the dev console:

With these anyone can access your admin api!!

I would suggest passing the ID’s through a form via ajax call instead!

https://shopify.dev/themes/customer-engagement/additional-customer-information