Render the Shared Wishlist UI Container
Render the default wishlist shared UI in a container of your choice, in your custom page.
swat.ui.renderSharedWishlistInContainer
Create a page on the storefront with required HTML element and use the API to initialize the UI render within a SwymCallback. The URL to this page can be the shared wishlist landing page for the storefront. This URL will be passed a hkey
or lid
in the query parameter which will need to be passed to the API.
Definition
swat.ui.renderSharedWishlistInContainer(containerElement, sharedHkey, queryParams)
<!-- Include html in the body -->
<div id="swym-shared-wishlist-render-container"></div>
window.SwymCallbacks = window.SwymCallbacks || [];
window.SwymCallbacks.push(function(swat) {
var queryParams = swat.utils.getEncodedAsObject(window.location.search);
var sharedHkey = queryParams["hkey"] || queryParams["lid"];
var sharedWishlistContainerElement = document.querySelector("#swym-shared-wishlist-render-container");
swat.ui.renderSharedWishlistInContainer(sharedWishlistContainerElement, sharedHkey, queryParams);
});
Argument | Type | Description |
---|---|---|
wishlistContainerElement | DOMElement | Target element to render User interface into |
sharedHkey | String | Shared hashkey to a list, usually a list id |
queryParams | Object | Query string as object |
We are working on Improving this API
If you find any information lacking - kindly contact [email protected]
Updated over 1 year ago