Discount Ninja
Search
K
Comment on page

discountNinjaContext object

Documentation regarding the context object provided by Discount Ninja.
This page is under construction
This object is used by Discount Ninja widgets and components. It is not part of the Public API and third-party developers should therefore not rely on it. The information provided here is for information only.
The discountNinjaContext JavaScript object is available in the global scope.

Properties available on all pages

DesignMode (boolean)
Shop (string)
RootRoute
CartRoute
Cart
CollectionProducts ([CollectionProduct])
CartProducts ([CartProduct])
ProductVariants ([ProductVariant])
Promotion

Properties configured in the settings of the app

Settings
  • MoneyFormatting
    • ProductPage (MoneyFormattingForPage)
    • Collection (MoneyFormattingForPage)
    • DrawerCartProduct (MoneyFormattingForPage)
    • DrawerCartLine (MoneyFormattingForPage)
    • DrawerCartTotal (MoneyFormattingForPage)
    • CartProduct (MoneyFormattingForPage)
    • CartLine (MoneyFormattingForPage)
    • CartTotal (MoneyFormattingForPage)
The MoneyFormattingForPage type specifies the following properties:
  • IncludeCurrency (boolean)
  • UseCurrencySymbol (boolean)
  • IncludeTrailingZeros (boolean)
  • Precision (number)
  • ZeroIsFree (boolean)
  • CentsSuperscript (boolean)

Properties used for authentication with APIs

Status (string)
Signature (string)

Properties used for localization

Country
  • ISOCode
  • Name
ShopCurrency
PresentmentCurrency
PresentmentCurrencyMoney
MoneyFormat
Locale
Labels
  • From
  • Here
  • Free
  • Soldout
  • UnitPriceSeparator
  • Accessibility
    • Price
    • DiscountedPrice
    • OriginalPrice
    • MSRP
    • UnitPrice
    • UnitPer
    • CompliancePrice
    • UnitPriceSeparator

Properties available when logged in

Customer
  • Id
  • NumberOfOrders
  • Email
  • Tags
  • FirstName
  • LastName

Properties available when on a product page

Product

Properties used for advanced settings

These settings are configured in the app
Flags