← API Index · How to use components
cancel-form component #oo-cancelform
This component implements the consumer's right of withdrawal ("Widerruf"): any visitor — logged on or not — can withdraw from a specific order by submitting their name, the order number and an e-mail address. The shop sends a confirmation to the customer and a notification to the shop operator, and records the request for the back office.
- name, order number and a valid e-mail are required; a note is optional
- for logged-on customers, name and e-mail are pre-filled from the profile
- if a logged-on customer enters the number of one of their own orders that is still open and before its order stop, a "cancel now" shortcut is offered that cancels the order immediately instead of going through the withdrawal
- withdrawals for orders delivered more than two weeks ago are rejected ("too late"); submissions are rate limited
Since the form must be reachable for legal reasons, keep a link to its page in your
navigation (the standard shop always shows one). The profile component links here from the
last orders list (oo-revoke-page).
How components are mounted, how switch values are resolved and how debug output is enabled is described in the use-js-components skill.
<div id="oo-flash"></div>
<div id="oo-cancelform" data-oo-shop-page="shop.html"></div>
component switches
| Switch | Default | Description |
|---|---|---|
oo-shop-page |
– | Page hosting the shop component; target of the "back to shop" link shown after a successful submission or cancellation. |
Page parameter
| Parameter | Description |
|---|---|
?oid=<order id> |
Pre-fills the order number, e.g. when linking here from an order list. For a logged-on customer the direct cancel check runs right away. |
States
| State | Description |
|---|---|
| form | The withdrawal form (.oo-cancelform-widerruf), optionally with the direct cancel offer (.oo-cancelform-offer). |
| checking | Submission in progress (.oo-cancelform-checking). |
| done | Withdrawal submitted (.oo-cancelform-done). |
| cancelled | Order cancelled directly (.oo-cancelform-cancelled). |
Errors (invalid input, mail could not be sent, too late, unknown order / e-mail combination) are shown through the flash component — host one on the page.
debug options
Debug scope cancel-form (enable with data-oo-debug="true" on the element or debug:cancel-form:all+, see the skill):
| Term | Description |
|---|---|
cancel-form:all |
Currently no extra output beyond the framework's component logging. |