Skip to content

Instantly share code, notes, and snippets.

@webmarked
Last active November 21, 2024 22:48
Show Gist options
  • Select an option

  • Save webmarked/7c2cbc34ee7de6023f8d6bc9bf836086 to your computer and use it in GitHub Desktop.

Select an option

Save webmarked/7c2cbc34ee7de6023f8d6bc9bf836086 to your computer and use it in GitHub Desktop.
// This code subscribes to all wishlist button click events
// generated by the app and refreshes all wishlist buttons on the page
// whenever a wishlist button is clicked.
// Add this code to your theme's JS file.
var SWCallbackExpressWishlistProductItemAdded =
SWCallbackExpressWishlistProductItemRemoved =
SWCallbackExpressWishlistCollectionItemAdded =
SWCallbackExpressWishlistCollectionItemRemoved =
SWCallbackCustomerWishlistProductItemAdded =
SWCallbackCustomerWishlistProductItemRemoved =
SWCallbackCustomerWishlistCollectionItemAdded =
SWCallbackCustomerWishlistCollectionItemRemoved = function() {
if (typeof ReloadSmartWishlist !== "undefined" && $.isFunction(ReloadSmartWishlist)) {
ReloadSmartWishlist();
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment