APIs for Deal of the Day
You can use the Salesforce B2C Commerce APIs to run a series of time-based promotions, such as "deal of the day" campaigns, by using methods that retrieve specific promotions within a campaign, based on time.
You can have multiple deal of the day campaigns at the same time (deal of the day, week, month, or year), where the storefront user will see the currently active deal, the number of missed deals, and the number of upcoming deals. Each deal is a promotion. All deals of the day are bundled in a campaign.
- Use the following methods from the
dw.campaign.PromotionMgr
class to retrieve promotions by the dates they are active. These methods differ from methods such asgetUpcomingPromotions()
in that they retrieve promotions assigned to a specific campaign and active within a specific date range, including past dates.-
getActivePromotionsForCampaign(Campaign campaign, Date from, Date to) : PromotionPlan
-
getActiveCustomerPromotionsForCampaign(Campaign campaign, Date from, Date to) : PromotionPlan
-
- Use the following method from the dw.campaign.PromotionPlan class to
sort promotions by start date.
-
getPromotions(int sortOrder) : Collection
-
- Use the following methods from the dw.campaign.Promotion class to
access start and end dates.
-
getStartTime() : Date
-
getEndTime(): Date
-