Events

Discount Ninja publishes events that you can hook in to. This allows you to add logic after:

  • Promotions have been loaded
  • The cart has been processed

Promotions loaded

Event: limoniApps:discountNinja:PromotionsLoaded
Timing:
this event is triggered by the app after promotions have been loaded and processed by the app
Parameters
:

  • e: event
  • promotions: an array of objects representing the offers loaded by the app 

Usage

$(document).on("limoniApps:discountNinja:PromotionsLoaded", function(e, promotions) { [... your logic here ...] });

Cart updated

Event: limoniApps:discountNinja:CartUpdated
Timing:
this event is triggered by the app after an update to the cart has been processed
Parameters:

  • e: event
  • cart: an object representing the cart with discounts applied

Usage:

$(document).on("limoniApps:discountNinja:CartUpdated", function(e, cart) { [... your logic here ...] });
Did this answer your question?