Methods

Basic shopping list methods will allow you to open or add products and recipes to the Whisk shopping list or open the Whisk add to basket screen.

Note: Basic methods do not send analytics, so you won't be able to get a dashboard. If you need tracking you can use event listeners. Also, you can use subscriptions for implementing basic tracking on your side.

whisk.shoppingList.viewList

viewList method opens the shopping list.

whisk.queue.push(function() {
  whisk.shoppingList.viewList({
    styles: {
      type: 'modal',
    },
  });
});

Supported list of parameters is under the Common Parameters section.

whisk.shoppingList.addProductsToList

addProductsToListmethod allows you to add products not bound to any recipe to a shopping list.

whisk.queue.push(function () {
  whisk.shoppingList.addProductsToList({
    products: ['Almonds', 'Salt', 'Milk'],
  });
});

addProductsToListmethod supports all Common Parameters, plus one extra required parameter:

whisk.shoppingList.addProductsToBasket

addProductsToBasketmethod allows you to add products to online checkout basket. Note: this does not add products to the shopping list.

whisk.queue.push(function() {
  whisk.shoppingList.addProductsToBasket({
    products: ['Almonds', 'Salt', 'Milk'],
    onlineCheckout: {
      defaultRetailer: 'GB:Tesco',
    },
  });
});

addProductsToBasketmethod supports all parameters from the addProductsToList method.

whisk.shoppingList.addRecipeToList

addRecipeToListmethod allows you to add a recipe to the shopping list.

whisk.queue.push(function() {
  whisk.shoppingList.addRecipeToList({
    recipeUrl: 'https://whisk.com/demo/calzone-roasted-peppers',
  });
});

addRecipeToList method supports all Common Parameters, plus one extra required parameter:

whisk.shoppingList.addRecipesToList

addRecipesToListmethod allows you to add multiple recipes to the shopping list.

whisk.queue.push(function() {
  whisk.shoppingList.addRecipesToList({
    recipes: [
      'https://whisk.com/demo/sponsored-retailer',
      'https://whisk.com/demo/sponsored-ingredient',
      { recipeUrl: 'https://whisk.com/demo/complementary-item-advert', scale: 2 },
    ],
  });
});

addRecipesToList method supports all Common Parameters, plus one extra required parameter:

RecipeSpec

whisk.shoppingList.addRecipeToBasket

addRecipeToBasketmethod allows you to add a recipe to an online checkout basket. Note: this does not add the recipe to the shopping list.

whisk.queue.push(function() {
  whisk.shoppingList.addRecipeToBasket({
    recipeUrl: 'https://whisk.com/demo/calzone-roasted-peppers',
    onlineCheckout: {
      defaultRetailer: 'GB:Tesco',
    },
  });
});

addRecipeToBasket method supports all parameters from the addRecipeToList method.

Common Parameters

onlineCheckout object

utm object

Last updated