Skip to main content

Coupons template

Description

The coupons template displays a user's awarded coupons in the Profile Widget. This template renders containers for available, buyable, redeemed, and expired coupons, but not the actual coupon content (for coupon rendering, see the coupon template section).

Control classes

ClassDescriptionRequired
mambo-ctrl-btn-availableMakes the mambo-ctrl-available element visible when clickedNo
mambo-ctrl-btn-buyMakes the mambo-ctrl-buyable element visible when clickedNo
mambo-ctrl-btn-usedMakes the mambo-ctrl-used element visible when clickedNo
mambo-ctrl-btn-expiredMakes the mambo-ctrl-expired element visible when clickedNo
mambo-ctrl-selectedApplied to the currently selected mambo-ctrl-btn-* elementNo
mambo-ctrl-availableContainer where available coupons are injectedYes
mambo-ctrl-buyableContainer where buyable coupons are injectedYes
mambo-ctrl-usedContainer where used coupons are injectedYes
mambo-ctrl-expiredContainer where expired coupons are injectedYes
mambo-ctrl-scrollEnables scrolling for coupon containers. Must be nested within the container elements and have an explicit height setNo

Template data

VariableDescriptionType
isLoadingFlag indicating whether user coupons are still loadingBoolean
availableArray of coupons awarded to the user that are still available for useArray
buyableArray of coupons that the user may exchange points forArray
redeemedArray of coupons awarded to the user that have been redeemedArray
expiredArray of coupons awarded to the user that have expiredArray

Implementation example

This example shows a basic coupons template with tabs for different coupon states:

JavaScript

Customisation options

Consider these enhancements:

  • Adding tab styling for better visual indication of selected coupon type
  • Implementing search or filter functionality for large coupon collections
  • Adding coupon sorting options (by date, value, etc.)
  • Creating animations for tab transitions