Favorites Actions
fetchFavorites
Section titled “fetchFavorites”Retrieves favorites from the server.
import { fetchFavorites } from '@shopgate/engage/favorites';
dispatch(fetchFavorites());Parameters
Section titled “Parameters”ignoreCache(boolean): Indicates whether to ignore the cache.
toggleFavorites
Section titled “toggleFavorites”Contains the addFavorites and removeFavorites functions. addFavorites is deprecated starting from Engage Theme version 6.7.0 and has been replaced with the addFavorite action.
import { addFavorite, removeFavorites } from '@shopgate/engage/favorites';
const productId = '25';const withRelatives = false;
dispatch(addFavorite(productId));dispatch(removeFavorites(productId, withRelatives));Parameters
Section titled “Parameters”productId(string) required: The ID of the product to add or remove from favorites.withRelatives(boolean): Indicates whether relatives are also removed.

