Get WishList Items

GetWishListItems()

Fetches the wishlist from the currently cached copy, wishlist is updated on load and always kept up-to-date with your modification. This is faster for your SDK to use.

GetWishListItemsFromServer()

Fetches wishlist items from server everytime, Versus GetWishListItems() , which loads from currently cached items in browser.

Note: You will likely not need this one except in rare cases, because the cached items are always updated on page load and when items are modified.

Please refer to the example.
You can call these method(s) once the window.WishListHero_SDK object is initialized.

Request Examples

// Request Example 
var wishlistItems = window.WishListHero_SDK.GetWishListItems()
//Request Example from server
var wishlistItems = await window.WishListHero_SDK.GetWishListItemsFromServer()
                
Response Examples Examples

//Response Example
[
    {
        AddedOn: "2022-01-18T16:55:14.328Z"
        Price: 0.05
        ProductId: "6559924289691"
        ProductImage: "//cdn.shopify.com/s/files/1/0549/7936/2971/products/man-adjusts-blue-tuxedo-bowtie_925x_656f2a36-34a8-4db2-9701-c01e49e9e5c0_1024x.jpg?v=1614781481"
        ProductLink: "/products/blue-silk-tuxedo?variant=39325393289371"
        ProductName: "Blue Silk Tuxedo"
        ProductVariantId: "39325393289371"
        _id: "61e6f0f25d0920096448e3c1"
    },
    {
        AddedOn: "2022-01-18T16:19:31.617Z"
        Price: 2.29
        ProductId: "6559920586907"
        ProductImage: "//cdn.shopify.com/s/files/1/0549/7936/2971/products/5-panel-hat_4ee20a27-8d5a-490e-a2fc-1f9c3beb7bf5.jpg?v=1614781409"
        ProductLink: "https://revamp-apps.myshopify.com/products/5-panel-hat"
        ProductName: "5 Panel Camp Cap - Burnt Orange"
        ProductVariantId: "39325380968603"
        _id: "61e6e8935d0920096448e3be"
    }
]