Skip to main content
This section describes the available actions in the test mode area. With these actions, test mode can be activated, deactivated, and switched.

Actions overview

ActionDescription
TestModeOnActivates test mode.
TestModeOffDeactivates test mode.
TestModeChangeSwitches the active test mode.

Actions

TestModeOn

This action activates test mode. The user must provide the configured test mode password. Usage example
Can be used on the test mode page (testMode.htm), through which shop operators or testers can activate test mode with a password to see test-specific content.
Parameters
NameDescription
passwordThe password for activating test mode.
debugActivates extended debugging (value: “on”).
Error codes
Error codeDescription
missingPasswordParameter password is missing.
invalidPasswordThe specified password is incorrect.
Related modules, variables & methods Example showing how test mode is activated via a password form, optionally with debugging.
{{ var $cActionTestModeOn = $wsActions.create("TestModeOn") }}
<form method="post" action="{{= $wsViews.current.url() }}">
    <input type="hidden" name="wscsrf" value="{{= $myActionTestModeOn.csrf }}">
    <input type="hidden" name="wsact" value="{{= $myActionTestModeOn.id }}">
    <input type="hidden" name="wstarget" value="/">
    <input type="password" name="password">
    <input type="checkbox" name="debug" value="on"{{ if $wsTestMode.debug }} checked{{ /if }}>
    <button type="submit">Activate test mode.</button>
</form>

TestModeOff

This action deactivates test mode and the shop returns to normal live operation. Usage example
Can be used on the test mode page or in the shop header to deactivate test mode directly in the shop.
Related modules, variables & methods Example showing how test mode is deactivated via a button.
{{ var $myActionTestModeOff = $wsActions.create("TestModeOff") }}
<form method="post" action="{{= $wsViews.current.url() }}">
    <input type="hidden" name="wscsrf" value="{{= $myActionTestModeOff.csrf }}">
    <input type="hidden" name="wsact" value="{{= $myActionTestModeOff.id }}">
    <input type="hidden" name="wstarget" value="/">
    <button type="submit">Deactivate test mode.</button>
</form>

TestModeChange

This action switches the active test mode without completely deactivating it. This is useful when multiple test modes are configured. Usage example
Can be used on the test mode page when different test scenarios or configurations are available in parallel and you want to switch between them.
Parameters
NameDescription
debugActivates or deactivates extended debugging (value: “on”).
Error codes
Error codeDescription
invalidPasswordThe specified password is incorrect.
Related modules, variables & methods Example showing how the debug setting of the active test mode is changed.
{{ var $myActionTestModeChange = $wsActions.create("TestModeChange") }}
<form method="post" action="{{= $wsViews.current.url() }}">
    <input type="hidden" name="wscsrf" value="{{= $myActionTestModeChange.csrf }}">
    <input type="hidden" name="wsact" value="{{= $myActionTestModeChange.id }}">
    <input type="hidden" name="wstarget" value="/">
    <input type="checkbox" name="debug" value="on"{{ if $wsTestMode.debug }} checked{{ /if }}>
    <button type="submit">%%SaveSettings%%</button>
</form>