Repository navigation
EU Withdrawal Button v1.0.0
First release. Adds the withdrawal button EU distance-selling law requires from 19 June 2026 (Article 11a, Directive (EU) 2023/2673): a "Withdraw From Contract Here" button in every page's footer, a no-login withdrawal page with a Confirm Withdrawal step, an emailed acknowledgment of receipt with the date and time, and Customers > Withdrawals in the admin. Encapsulated plugin for Zen Cart 1.5.8 through 3.0.0, PHP 7.4 through 8.5; no template edits.
What's in it
- A "Withdraw From Contract Here" button in the footer of every page, with no template edits: inside the footer through
NOTIFY_FOOTER_AFTER_NAVSUPP(2.1.0+, ZCA Bootstrap 3.8.0), else just before</body>throughNOTIFY_FOOTER_ENDand moved up under the footer links. - The withdrawal page (
main_page=eu_withdrawal): name, order and email, an optional list of items, then a review screen with Confirm Withdrawal. No account needed; a logged-in customer's details and recent orders are filled in, and the button on an order's page opens the form for that order. One Page Checkout's guest placeholder is never treated as a customer. - The acknowledgment of receipt (Article 11a(4)) with the statement and its date and time in the Store Time Zone, and the store's notice, reply-to the customer. Both are sent after the statement is saved, so a mail failure loses nothing; a failure is recorded and can be resent.
- Order matching: a customer's own order by number, anyone else's by number and email. Unmatched statements are saved and flagged, never refused.
- The spam trap holds a statement: saved, the store told, but nothing emailed to the address given and nothing written to the order until staff send the acknowledgment.
- A matched order's history note is hidden from the customer; an optional customer-visible line and status change.
- Customers > Withdrawals: list, filters, search, detail, status, staff note, Send Acknowledgment. The staff note and search are registered with Zen Cart's admin request sanitizer, so quotes, ampersands and angle brackets arrive as typed.
- Show Withdrawal Button To: All Visitors, or Selected Countries (EU 27 + IS, LI, NO by default) by the order's country, the customer's default address or a server variable (Cloudflare's by default). Unknown shows the button; the page always answers.
- The two legal labels, verbatim from the directive, for English, Dutch, Finnish, French, German, Italian and Spanish, chosen by language code. Other text falls back to English for a store language with no translation.
- Preview Email definitions for both emails.
Verified: 14 harnesses on PHP 7.4-8.5, 29/29 mutations caught, phpstan and php-cs-fixer clean against Zen Cart 3.0.0's own configs, and live guest and logged-in withdrawals on a 2.2.2 store.
Install
Unzip, copy zc_plugins/EuWithdrawalButton/ into your store's zc_plugins/ folder, then Modules > Plugin Manager > EU Withdrawal Button > Install. Full steps are in docs/INSTALL.md and the readme inside the package.