Linux 软件免费装

Right of Withdrawal flow for shop

开发者 teetb
peeterpaanike
更新时间 2026年9月10日 19:10
PHP版本: 8.0 及以上
WordPress版本: 7.1
版权: GPL-2.0-or-later
版权网址: 版权信息

标签

refund returns withdrawal consumer-rights eu-directive

下载

1.0.0 1.1.0

详情介绍:

Right of Withdrawal flow for shop implements the consumer right of withdrawal mandated by the European Union Consumer Rights Directive (2011/83/EU), giving customers a clean, server-validated way to exercise their 14-day cooling-off period. The plugin adds a "Withdraw from order" button in the customer's account, opens an accessible modal where customers can pick specific items, enter an IBAN and select a withdrawal reason, then notifies the shop via HTML email and tracks the refund through to completion. Key features Compliance reference Requirements

安装:

  1. Upload the plugin folder to /wp-content/plugins/.
  2. Activate the plugin through the Plugins menu in WordPress.
  3. Go to WooCommerce → Settings → Right of Withdrawal and configure the settings.
  4. Pick the terms-and-conditions page and customise the button appearance.
  5. For guest orders: create a page with the [rowfs_withdrawal_form] shortcode and select it under General → Withdrawal form page (guests).

升级注意事项:

1.1.0 Adds a Withdrawal column and filter to the orders list, sends emails from the WooCommerce sender address and adds withdrawal for guest orders via a secure emailed link. To enable guest withdrawal, create a page with the [rowfs_withdrawal_form] shortcode and select it in the plugin settings. 1.0.0 First public release.

常见问题:

Is the plugin HPOS compatible?

Yes. The plugin declares full compatibility with the WooCommerce Custom Order Tables (HPOS) and uses the WC_Order meta API throughout — never get_post_meta() on the order ID.

Does the refund amount account for coupon discounts?

Yes. The plugin reads WC_Order_Item::get_total() (the post-coupon line total) plus get_total_tax(), so a customer returning a coupon-discounted item gets the correct, post-discount refund.

How do I change the withdrawal period?

Default is the EU-mandated 14 days. You can change the number and the unit (days / months / years) in the settings, and choose whether the period starts from the order's payment date or completion date.

Does the email button log the customer in automatically?

No. The button in the order email is a regular link to the customer's "View order" page. If the customer is not signed in, WordPress / WooCommerce shows the standard login form and returns the customer to the same page after authentication. The plugin does not implement its own login flow. For guest orders the button opens the withdrawal form page via a signed link that authorises only the withdrawal form for that order — it never logs anyone in.

Where does the customer start a withdrawal request?

Registered customers: the "Withdraw from order" action button in My Account → Orders, or the same button in the order confirmation email — both open the modal on the customer's "View order" page. Guests (and anyone not signed in): the withdrawal form page with the [rowfs_withdrawal_form] shortcode, or the button in the order email of a guest order.

Can a customer submit more than one partial withdrawal for the same order?

Yes. The plugin tracks per-line cumulative withdrawn quantities — a customer can return 1 of 3 items today, then 1 more next week. Further submissions are blocked once every line has been fully accounted for.

Does it work for guest checkout (no customer account)?

Yes. Create a page, add the [rowfs_withdrawal_form] shortcode and select it under WooCommerce → Settings → Right of Withdrawal → General → Withdrawal form page (guests). The customer enters the order number and the email address used for the order; if they match an order that is still within the withdrawal period, a secure link is emailed to the billing address. The link opens the same withdrawal form as in My Account. Guest orders also get the link directly in the order confirmation email. The link is signed (HMAC over order ID, order key, billing email and expiry), is valid until the withdrawal period ends and only authorises the withdrawal form for that one order — it does not log anyone in. The lookup form always shows the same response, so it cannot be used to check whether an order or email exists, and it is rate-limited per IP.

Which countries' IBANs are accepted?

Any country that uses IBAN. The plugin validates the standard format (2-letter country code + 2 check digits + up to 30 alphanumeric characters) and runs the Mod-97 checksum (uses bcmod if available, falls back to pure PHP). Non-IBAN formats are rejected at submit time.

What happens when the admin clicks "Mark as refunded"?

If "Create WooCommerce refund automatically" is enabled (default), a WC_Order_Refund record is created with the exact line items and amount the customer requested; the order totals update accordingly, and stock is restocked if enabled. A confirmation email is then sent to the customer. Without auto-refund, only the order status and metadata are updated — no WC_Order_Refund is created.

How do I see which orders have a pending withdrawal request?

Go to WooCommerce → Orders. The Withdrawal column shows the state of every request (initiated / partial / refunded), and the All withdrawal states dropdown next to the other filters narrows the list to pending or processed requests. When requests are waiting, a notice at the top of the orders list links straight to them.

Which address are the plugin's emails sent from?

The sender name and address set in WooCommerce → Settings → Emails → Sender options — the same as your regular order emails. If an SMTP plugin forces its own "From" address, that setting takes precedence. The rowfs_email_headers filter lets you change the headers further.

Where can I find the plugin's settings?

WooCommerce → Settings → Right of Withdrawal. The tab has five sub-tabs: General (notifications, deadline, terms page), Refund behaviour (auto-refund, restock), Withdrawal button (label, colours), Modal appearance (colours, opacity, width) and Required fields in modal (reason, IBAN, contact email, terms checkbox).

Can I customise the list of withdrawal reasons shown to the customer?

Yes. The reasons are filterable. In a child-theme functions.php or a small custom plugin: add_filter('rowfs_withdrawal_reasons', function ($reasons) { $reasons['gift_unsuitable'] = __('Gift was unsuitable', 'your-textdomain'); unset($reasons['found_better_price']); return $reasons; });

更新日志:

1.1.0 1.0.0