Advently Documentation for version 1.0.0 Open the demo store

Getting started

Advently adds an advent calendar to your WooCommerce store. Each day one door opens and gives the shopper a coupon made just for them, a gift idea from your shop, or both. This guide covers everything from installation to reading the results.

Requirements

WordPress6.6 or newer
WooCommerce8.0 or newer (tested up to 11.2), classic or block cart and checkout, HPOS or posts storage
PHP7.4 or newer
Who can set it upUsers who can manage WooCommerce (administrators and shop managers)

Installation

  1. In WordPress, go to Plugins → Add New → Upload Plugin and choose advently.zip from your download.
  2. Click Install Now, then Activate. WooCommerce must already be active.
  3. Open WooCommerce → Advently. The setup starts by itself the first time.

The three-step setup

The setup's design step with four themes shown as small calendars
The last step of the setup: choose a design.
  1. Dates. Pick Advent (December 1–24), the 12 days of Christmas (December 13–24), a New Year countdown (December 25–31), or your own start date and number of doors (1 to 31). Doors open at midnight in your store's time zone (Settings → General).
  2. Unlocking. Choose how shoppers open doors (see unlock modes) and what happens when someone misses a day.
  3. Design. Choose one of four themes and an accent colour.

When you click Create my calendar, every door is filled with ready-made offers: percentages, fixed amounts, free shipping, a free gift (your cheapest simple product in stock), gift ideas from your best sellers, a bigger offer halfway and on the last day, and free shipping in the last days before Christmas. Change any of them afterwards in the Doors tab.

Putting the calendar on a page

There are three ways, and they show the same calendar:

The page you choose (or the newest published page that holds the block or the shortcode) is used for the View calendar link in the admin, the {calendar_url} link in emails and the optional badge.

Tip: the calendar is at most 880 pixels wide, so it fits on one screen even in a wide or full-width block. To change that, set --adv-max-width in your theme's CSS, for example .advently { --adv-max-width: 1000px; }.

Doors

The Doors tab: a grid of door cards on the left, the selected door's preview and settings on the right
Every door at a glance. The selected door's card preview stays at the top of its settings.

Each card shows the door's day, what is behind it and a warning when something is missing, for example a free-gift door without a product. The coloured edge tells you the door type: green for a coupon, gold for a message, red for both. Click a card to edit that door. The arrows at the top of the panel move to the previous and next door.

Behind this door

TypeWhat the shopper gets
CouponA coupon card with the code, Copy and Apply to cart.
MessageA title, text, an optional image and an optional product with a button.
BothThe coupon card with the message below it.

Coupon settings

SettingWhat it does
DiscountPercentage off the order, a fixed amount off the order, free shipping, or a free product. A free product is added to the cart at no cost when the shopper applies the coupon.
Coupon works for12 hours to 7 days after the door is opened, or until the calendar ends.
Minimum orderThe cart total the coupon needs. 0 means no minimum.
Only these products / categoriesLimits the discount to those products or categories.
Can't be combined with other couponsWooCommerce's "individual use" option.

Free shipping coupons need a shipping method that allows free shipping by coupon (WooCommerce → Settings → Shipping → your zone → Free shipping → "A valid free shipping coupon").

Message settings

Title, text (line breaks are kept; simple HTML such as links and bold is allowed), an image from the media library and a link to a product. A linked product appears on the card with its picture, name and price, followed by your button text ("Shop now" if you leave it empty).

Copy a door to other doors

Under the door's title, Copy to other doors… copies everything, only the coupon or only the message. Pick doors one by one, or use All, Weekends or The doors after this one. Copied changes wait for Save calendar.

Saving: nothing is stored until you click Save calendar (or press Ctrl/⌘ + S). The page asks before you leave with unsaved changes.

Design

The Design tab with theme choices on the left and a live calendar preview on the right
Changes show in the preview right away. Switch it between desktop and phone width.
OptionChoices
ThemeClassic Red, Snowy Night, Minimal, Gold. Choosing a theme also sets an accent colour that suits it.
Accent colourThe buttons on the opened door (and the numbers in Minimal). Button text turns white or black automatically to stay readable.
Door cornersRounded or square.
Door numbersClassic (serif), Modern (sans-serif) or Handwritten. System fonts only: nothing is loaded from outside your site.
Shuffle the doorsMixes the numbers like a real advent calendar. The order is the same every day.
Falling snowA light snowfall behind the doors. It pauses when the calendar is off screen and is never shown to visitors who turn off motion.
Background imageOptional; darkened slightly so the doors stay readable.
"Today's door is open" linkOff by default. A small button in a corner of every page while the calendar runs, leading to the calendar page. Not shown on the calendar page, cart or checkout. Shoppers can hide it for the day.

Settings

The Settings tab: dates, calendar page and unlock modes

Dates

First day and number of doors. Changing the start date begins a fresh calendar: shoppers can open every door again and Results show the new dates only. Coupons already handed out keep working until they expire.

Opening the doors

ModeHow it worksCoupons
Email first (default)The shopper enters an email address once; the calendar remembers them on that device.One per shopper and door, single use, limited to that email address, also emailed.
Customers with an accountOnly logged-in customers can open doors; others see a Log in button.One per customer and door, single use, limited to the account's email address.
AnyoneNo sign-up.One shared code per door. Easiest, but codes can be passed around.

If a shopper misses a day, that door can still be opened with its coupon (default), opened without the coupon, or stay closed.

Offers opt-in. In email mode, a checkbox under the email box lets shoppers agree to receive your offers. It is optional: coupons are sent either way. Leave its text empty to use the default, which names your shop.

Coupon codes

The prefix (letters and numbers, up to 8) starts every code, for example XMAS-07-K3F9QD. Codes avoid look-alike characters (0/O, 1/I).

Coupon email

Sent in your WooCommerce email design each time someone opens a door with a coupon in email mode. Leave a field empty to use the default text shown in grey. Send me a test email sends door 1's email to you, using the texts on screen even before you save.

PlaceholderBecomes
{coupon}The shopper's code
{discount}What it gives, e.g. "15% off"
{expiry}When the coupon ends
{door}The door number
{calendar_url}A link to the calendar page
{shop_url}A link to your shop

Start over and data

Run setup again refills every door with the ready-made offers (it asks first; Cancel puts back what you had). Delete Advently's data when the plugin is deleted removes the settings, subscribers and door history on uninstall. Coupons and orders are always kept.

Testing before December

Doors are locked by the server's clock, so before the calendar starts nobody, you included, can open them. Store managers get an owner preview instead:

The calendar page with the owner preview bar set to December 12
The preview bar above the calendar is shown only to store managers.

Results and exports

The Results tab with revenue, orders, opens, discount, average order and emails, and a chart per door
FigureWhere it comes from
Revenue from calendar couponsPaid orders (processing, completed) that used a calendar coupon, minus refunds.
Orders with a calendar couponThe same orders, and the share of handed-out coupons that were used (not shown in Anyone mode, where one code serves many orders).
Doors openedEvery door opened, and by how many people.
Discount givenWhat the calendar coupons took off those orders, stored on the order when it is paid.
Average orderRevenue divided by orders.
Emails collectedEveryone who entered an email, and how many agreed to receive offers.

The charts show opens and orders, and revenue, per door; Show the numbers as a table lists them. Download report (CSV) exports the per-door figures. The subscriber list can be searched, a subscriber can be deleted, and Download CSV exports everyone with the date they signed up and whether they agreed to offers.

Orders are linked to the calendar the first time their status changes, so classic checkout, block checkout and orders created in the admin are all counted. Results do not depend on WooCommerce Analytics.

What shoppers see

An opened door: a 5% coupon with Copy and Apply to cart, and a gift idea with a product below

Privacy and GDPR

Security

For developers

Shortcode and block

[advently title="…"] and the advently/calendar block (attribute title) render the same markup. Without a title, the calendar has an accessible name of its own.

Filters

FilterUse
advently_nowThe moment the calendar treats as now (a DateTimeImmutable in the site's time zone). Useful on staging sites. Return a DateTimeImmutable.
advently_client_ipThe visitor IP used for rate limiting. Cloudflare's CF-Connecting-IP is handled; use this for other proxies. Receives the IP and the server values it came from.
advently_admin_dataData handed to the admin app. Set readOnly to true and notice to a message to show a notice and stop the "unsaved changes" prompt (saving itself must be refused on the server).
// Show the calendar as if it were December 10 (staging only).
add_filter( 'advently_now', function ( $now ) {
	return new DateTimeImmutable( '2026-12-10 09:00', wp_timezone() );
} );

Styling

Everything is scoped under .advently (the calendar) and .advently-modal (the opened card). Themes are sets of CSS custom properties such as --adv-board, --adv-door-1 to --adv-door-4, --adv-ring, --adv-card and --adv-accent; override them in your theme to adjust a design.

REST endpoints

RoutePurpose
GET /wp-json/advently/v1/stateDoor statuses, opened doors and a fresh nonce for the visitor.
POST /advently/v1/subscribeEmail sign-up (email mode).
POST /advently/v1/doors/{n}/openOpens a door and returns its coupon and content.
POST /advently/v1/doors/{n}/applyPuts the visitor's own coupon for that door in the cart.
/advently/v1/admin/*Settings, report, subscribers, lookups; manage WooCommerce only.

Data

Settings live in the advently_calendar option. Two tables hold subscribers ({prefix}advently_subscribers) and door opens ({prefix}advently_opens). Coupons are ordinary WooCommerce coupons tagged with _advently_door and _advently_start; orders that used them carry _advently_start, _advently_doors and _advently_discount.

Translations

All texts use the advently text domain. The template is languages/advently.pot. Put translations in wp-content/languages/plugins/ as advently-{locale}.mo, and the admin's JSON files from wp i18n make-json next to them.

FAQ

Can shoppers see tomorrow's offer early?

No. Nothing about a door is in the page until the server says it is open.

Does it work with page caching plugins?

Yes. The calendar asks the server for today's state when it loads, so a cached page still shows the right doors. The REST requests it makes are not cached.

Can I run it for Black Friday or another season?

Yes: any start date, 1 to 31 doors.

Can I have more than one calendar?

One calendar per site in version 1.0. You can place it on more than one page.

What happens next year?

Change the start date to next year. Doors, design and texts stay; shoppers can open every door again.

Are coupons created for everyone in advance?

No. A coupon is created at the moment a shopper opens a door, so you never fill your coupon list with unused codes.

Troubleshooting

What you seeWhat to check
"Your session has expired. Please reload the page."A cached page carried an old security token for a long time. The calendar refreshes it once by itself; if a caching plugin caches the REST API, exclude /wp-json/advently/.
All doors are lockedThe calendar has not started yet in your store's time zone (Settings → General). Use the owner preview to test.
Coupon emails do not arriveUse Send me a test email. If it fails, your site cannot send email; an SMTP plugin usually fixes it.
Free shipping coupon does not remove shippingYour shipping zone needs a Free shipping method that accepts a valid free shipping coupon.
"View calendar" is missingNo published page holds the calendar. Settings → Calendar page → Create a new calendar page.
Results show no revenueOnly paid orders (processing or completed) count. Orders are linked when their status changes.

Changelog

1.0.0

Support

Questions or a problem? Contact us through the item's support page or at webkodingtheme.com/support. Please include your WordPress, WooCommerce and PHP versions and what you expected to happen.