BrowseClient#getMarketingMessages(marketingMessageRequest, options);
In the Broadleaf framework, offer’s are able define marketing messages that can be displayed on the storefront. This portion of the SDK handles retrieving marketing messages.
Parameter | Type | Required? | Description |
---|---|---|---|
|
✅ |
The criteria which define which marketing messages to retrieve. |
|
|
❌ |
Options passed to the HTTP request call to customize the request configuration. |
This function returns a MarketingMessageResponse.
Parameter | Type | Required? | Description |
---|---|---|---|
|
✅ |
The criteria which define which marketing messages to retrieve. |
|
|
❌ |
Options passed to the HTTP request call to customize the request configuration. |
This function returns a list of MarketingMessage.
const lineItem = {
attributes,
discountable: true,
isSubscription: false,
lineNumber: '1', // this is the item's id
quantity: 1,
standardPrice: { amount: 10, currency: 'USD'}
}
const messages = await browseClient.getMarketingMessagesForItem({
item: lineItem,
locationType: 'EVERYWHERE',
locale: 'en-US',
codes: {
sharedCodes: ['FREESHIP']
}
});
console.log(messages);