Frontend API
Methods to retrieve promotions applied to the cart.
Active promotions are automatically applied to carts. Retrieve the cart object attached to the current session to see what promotions have been applied.
The promotions field is a result set with a count and a results array, where each promotion includes details like name, description, date_start, and date_end.
Get promotions
await swell.cart.get()Methods to retrieve promotions applied to the cart.
Get promotions
Active promotions are automatically applied to carts. Retrieve the cart object attached to the current session to see what promotions have been applied.
The promotions field will include details like name, description, dateStart, and dateEnd.
Get promotions
query {
cart {
items {
id
quantity
price
discountTotal
origPrice
}
promotions {
results {
name
description
dateStart
dateEnd
}
}
}
}