Offers
Featured offer and offers carousel modules driven by campaign data.
Offers
Description
Offers modules surface marketing campaigns. There are two parts: a featured offer block that highlights a single campaign, and a carousel that shows the current active offers.
How to edit
- Manage the offer content on the campaign itself (see Offers & campaigns).
- In Marketing Settings, make sure the offers you want are in the offers list and marked as active — only active offers appear. The campaign's own schedule applies as well, so an active offer only shows while its campaign is live.
- Go to Elementor → Editor → Templates and search for
Offerto edit the surrounding content, such as the section title, description, and captions. - Save, then check a page that uses the template.
The offer cards themselves are generated from your campaign data, so edit the campaign rather than the card.
Variants
Sections
| Template | What it is |
|---|---|
CK – Offers – Featured | Title plus a single highlighted campaign card |
CK – Offers – Carousel | Title, description, and a carousel of active offers |
CK – Offers – Dynamic template component | The offer card used by the carousel |
Offer page templates
These are whole-page templates used for offer pages, chosen to suit the audience the page is for:
| Template | Used for |
|---|---|
CK – Offer – Customer Template | Existing customers |
CK – Offer – New Customer Template | New customers |
CK – Offer – Customer with preferred partners Template | Customers with preferred partners |
Featured offer
The section is made up of a title and a featured offer card.
The title is static content and can be edited in Elementor.
The featured offer card is generated from the campaign and uses:
- Campaign title and link, from the campaign post itself
- Campaign image — desktop and mobile versions are set separately on the campaign
- Campaign description and disclaimer
- Q Card / Q Mastercard product data, plus a customer type tag when the campaign's Customer Type Badge is turned on
Captions on the card are static content and can be edited in Elementor.
Badges
Where a card only shows the Q Mastercard badge, that badge is highlighted. To apply this, add the q-mastercard-badge class to the element and it will override the border, background, and text colour.
Offers carousel
The carousel is made up of:
- Title
- Description
- Carousel loader — a Dynamic Posts widget that fetches the offer data
- Carousel container — holds the offer slides
- Carousel script — builds the carousel (see below)
The offer cards are created by the Dynamic Posts widget using the CK – Offers – Dynamic template component template, then moved into the carousel container by the script.
Classes
Primary classes used by the offers components:
| Class | What it's for |
|---|---|
ck-offer-carousel | Main carousel wrapper |
offer-carousel-content-loader | Dynamic Posts loader that fetches the offers |
offers-swiper | Carousel container |
offer-carousel-interactions | Navigation and pagination area |
offers-pagination | Pagination dots |
q-mastercard-badge | Highlighted Q Mastercard badge |
Styling is done through a combination of the built-in page builder options as well as custom CSS where needed.
Script
This script moves the loaded offer cards into the carousel container and starts the carousel. It is compiled to JavaScript and added using the HTML editor template.
import Swiper from "swiper";
function moveContent() {
const cards = document.querySelectorAll(
".offer-carousel-content-loader .dce-posts-wrapper .dce-post-item",
);
const target = document.querySelector(".offers-swiper .swiper-wrapper");
if (target) {
cards.forEach((card) => {
target.appendChild(card);
card.classList.add("swiper-slide");
});
}
}
function createPagination() {
const paginationCount = document.querySelectorAll(
".offer-carousel-content-loader .dce-posts-wrapper .dce-post-item",
).length;
let paginationHtml = "";
for (let i = 0; i < paginationCount; i++) {
paginationHtml += `<span class="swiper-pagination-bullet"><div class="display-dot"></div></span>`;
}
const target = document.querySelector(".offer-carousel-interactions");
if (target) {
target.insertAdjacentHTML(
"beforeend",
`<div class="offers-pagination">
${paginationHtml}
</div>`,
);
}
}
function initailiseSwiper() {
const swiper = new Swiper(".offers-swiper", {
spaceBetween: 12,
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
pagination: {
el: ".offers-pagination",
clickable: true,
renderBullet: function (index: number, className: string) {
return (
'<span class="' + className + '"><div class="display-dot"></div></span>'
);
},
},
breakpoints: {
768: {
slidesPerView: 2,
},
1024: {
slidesPerView: "auto",
},
},
});
}
function waitForSwiper(method: () => void) {
if (typeof Swiper !== "undefined") {
method();
} else {
const checkInterval = setInterval(() => {
if (typeof Swiper !== "undefined") {
clearInterval(checkInterval);
method();
}
}, 100);
}
}
document.addEventListener("DOMContentLoaded", async () => {
waitForSwiper(() => {
createPagination();
moveContent();
initailiseSwiper();
});
});