Skip to content
Steve Moorhouse edited this page Nov 27, 2026 · 2 revisions

Store pause: manual

Settings

Store > Configuration > Store pause (admin/store/settings/pause), permission Administer store. The top of the page says whether the store is OPEN or PAUSED now, and when it next changes.

Setting What it does
Pause the store Master switch. Nothing happens unless it is ticked.
Repeat every year The dates are one occurrence; each time it ends, they move forward a year. Needs a start and an end, and the whole thing (advance notice to end) must be under a year. Windows that cross New Year work.
Show the advance notice from Optional, needs a start. From this time until the start, the store is still open and the block shows the advance notice message.
Pause from (start) / Reopen at (end) The pause window, in the site's default time zone (shown on the form). Either can be empty: no start means "from now", no end means "until I untick the switch". The store reopens at the end time exactly.
Show the reopening message from Optional, needs an end, must fall inside the pause. From this time until the end, the reopening message replaces the banner. The store is still paused.
Advance notice message Shown by the Store pause notice block before the pause. Empty means no advance notice.
Banner message Shown by the block while the store is paused.
Reopening message Shown by the block from the reopening time. Empty means the banner carries on until the end.
Cart message Plain text. Shown in place of the Add to cart button, and as a message when someone tries to add to cart or open the cart or checkout.
Redirect the cart and checkout to Default <front>. Cannot be the cart or checkout.
Also close these pages Optional. Pages that redirect like the cart while paused, one path per line, * as a wildcard (as in block visibility). Matched by system path or alias, so a products listing and every product page can go: products and product-page/*. products does not match products/x; add products/* for that. The redirect target cannot be one of these.
Replace Add to cart and Buy it now buttons If unticked, the buttons stay, but adding to cart is still refused with the cart message.
Hide the shopping cart block Hides Ubercart's Shopping cart block.

Settings are stored in config (uc_store_pause.settings), so they can be deployed with configuration management.

Messages and tokens

The three block messages are formatted text and take any token. The module adds:

Token Gives
[store-pause:start] When the pause starts, e.g. "Saturday, 20 December, 2026 - 5:00pm". With a yearly repeat, the current or next occurrence. Chains to date formats: [store-pause:start:custom:l j F].
[store-pause:end] When the store reopens. Chains the same way.
[store-pause:countdown] A live countdown, e.g. "6 days 4 hours 12 minutes 5 seconds": to the start before the pause, to the end during it. Runs in the browser, so it is right even on cached pages. Use it in the block messages only; elsewhere it is plain text that does not tick.

Examples

Closed for Christmas, with a week's notice: start 20 December 17:00, end 3 January 09:00, advance notice from 13 December, reopening message from 1 January. Advance: "Last orders before Christmas in [store-pause:countdown]". Banner: "Closed for Christmas. Back on [store-pause:end:custom:l j F]". Reopening: "We're back in [store-pause:countdown]". Tick Repeat every year to have it happen every Christmas.

Tickets on sale January to June only: repeat every year, start 1 July 00:00, end 1 January 00:00 (the next year), advance notice from 15 June, reopening message from 1 December. Banner: "Ticket sales for next year open in January". Reopening: "Tickets go on sale in [store-pause:countdown]".

What is blocked, and what is not

Blocked for everyone without the bypass permission:

  • Adding to cart, by any route (hook_uc_add_to_cart()).
  • cart, cart/checkout, cart/checkout/review, and anything below them that the router serves with those pages (cart/checkout/x): redirected. The checkout and review forms also refuse to submit.
  • Any page listed under Also close these pages: redirected.

Never blocked:

  • cart/checkout/complete, and every payment gateway callback, IPN, webhook or return path. A customer who reached a hosted payment page before the pause started can finish paying.
  • Everything that is not part of the store: content, contact forms, webforms, user accounts.

Note: a customer already on the review page when the pause starts is redirected if they submit it. For on-site card payments that is the step that takes the payment, so no card is charged.

Items already in a customer's cart stay there. They can check out once the store reopens.

Bypass store pause

Users with Bypass store pause see the store as if it were open, with a warning message on product, cart and checkout pages. Use it to test the live store during a pause. The banner block still shows for them, as it does for customers.

Page caching

See the README. In short: the page cache is cleared when the store opens or closes, as seen by cron or the next uncached page, and whenever the settings are saved. Run cron often around the start and end times. If cron runs only once a day, say at 7pm, set each time just before it (6:55pm, not 7:05pm), so the change reaches cached pages within minutes rather than a day later. The settings page says this under When, with the time cron last ran.

For developers

  • uc_store_pause_is_active($time = NULL): TRUE if the pause is enabled and $time (default now) is in the window. Ignores the bypass permission.
  • uc_store_pause_applies($account = NULL): TRUE if the store is paused and the user cannot bypass it.
  • uc_store_pause_phase($time = NULL): open, notice, paused or reopening.
  • uc_store_pause_times($time = NULL): timestamps (notice, start, opening, end) of the current or next occurrence, with a yearly repeat applied.
  • uc_store_pause_next_change(): timestamp of the next opening or closing, or NULL.
  • uc_store_pause_path_is_blocked($path): TRUE for the redirected paths, including the extra pages.