Skip to main content
With the $wsMaintenance module, you can check whether the shop is in maintenance mode. This way you can display a maintenance page to visitors or temporarily disable certain functions. In this section, you will learn how to query the maintenance mode in the frontend.

Module overview

Example / excerpt of $wsMaintenance
{{= $wsMaintenance | json }}
JSON output
{
  "isMaintenanceMode": "ƒ()"
}
Note: ƒ() denotes a function. Methods overview
MethodReturn typeDescription
isMaintenanceMode()boolChecks whether the shop is currently in maintenance mode.

Templates

The maintenance mode check can be used on any template. It is typically used to display a maintenance page or to disable certain functions.

Variables

No variables are available for $wsMaintenance.

Methods

$wsMaintenance.isMaintenanceMode()

Checks whether the shop is currently in maintenance mode. Signature
$wsMaintenance.isMaintenanceMode()
Return value
bool - true if maintenance mode is active, otherwise false.
Example that checks whether maintenance mode is active.
{{ if $wsMaintenance.isMaintenanceMode() }}
  // Maintenance mode is active
{{ /if }}

Actions

No actions are available for $wsMaintenance.

Examples

Check whether maintenance mode is active

This example checks whether maintenance mode is active and outputs a corresponding message.
{{ if $wsMaintenance.isMaintenanceMode() }}
    <p class="alert alert-danger">Shop is in maintenance mode.</p>
{{ /if }}