Withdrawal Button
Permalink General Information
Version 3.58 of German Market includes new features to comply with the legal requirements regarding the “cancellation button” in accordance with EU Directive 2023/2673.
You can find the settings under:
WooCommerce → German Market → General → Withdrawal
You can manage received withdrawals here:
WooCommerce → Withdrawals
After installing version 3.58, the “withdrawal button” will automatically appear in the footer of your WordPress site. This button takes your customers to a form they can use to submit their withdrawal directly to you.
Permalink "Withdrawal of Contract" page
German Market automatically creates the “Withdrawal of Contract” page. If this page was accidentally deleted, you can recreate it using the following setting:
WooCommerce → German Market → General → Required Pages → Reinstall Required Pages
If you create the page manually, you must insert the shortcode
there so that the withdrawal form is displayed.
Use the setting
WooCommerce → German Market → General → Withdrawal → Page Assignment → Withdrawal of Contract
to assign the correct page.
Permalink Settings
If you disable the “Show withdrawal button automatically in footer” setting, the withdrawal button will no longer appear automatically on your website. Instead, you can manually add the button wherever you like—for example, in the footer menu or as a separate link to the “Withdrawal of Contract” page. For more information, see the section on manually adding the withdrawal button.
If you want to use a different email address for notifications about new cancellation requests, you can enter it under the “Admin email” setting. This email address will also be displayed if an error occurs when the withdrawal form is submitted. In this case, the customer will be instructed to contact your support team via this address.
Using the “Required fields” setting, you can specify which information the customer must provide when submitting the withdrawal form.
If you enable the “Show comments fields” setting, an additional free-text field (textarea) will appear in the form. You can customize the label for this field using the “Label for comments fields” setting.
If you “Allow partial withdrawals“, logged-in users can indicate, after selecting their order, that they wish to cancel only part of it. If the customer enables this option, the items in the order will be displayed. They can then select which products—and, if applicable, in what quantities—they wish to cancel.
Guests have a text field available for entering an order number. If you enable the setting “Guests must provide a valid order number”, the system checks whether an order with the specified order number exists.
If you enable “Guests can provide an invoice number”, the “Order number” field is renamed to “Order or invoice number.” Guests can then also enter an invoice number generated by the “Invoice Number” add-on. The entry is first compared with existing order numbers. If no matching order number is found, the system then searches the invoice numbers.
With the setting “Product types for which withdrawal is not permitted”, you can exclude certain product types from partial returns. Customers will then be unable to select these products as part of a partial withdrawal.
The “Product categories for which withdrawal is not permitted” setting works similarly for product categories.
With the setting “Order status for which withdrawal is not permitted”, you can exclude certain orders from cancellation. By default, the statuses “Cancelled,” “Refunded,” “Failed,” and “Draft” are selected.
“Withdrawal period in days”: This setting allows you to specify the number of days within which a withdrawal is possible after the purchase. The calculation is based on the order completion date. If this date is more than the number of days defined here in the past, the order can no longer be withdrawn. Please note that the statutory withrawal period generally begins only upon the customer’s receipt of the goods. Therefore, take your usual delivery times into account when setting this value. If 0 is entered, the withdrawal period is not checked.
“Exclude old orders (in days)”: This setting is particularly useful if you do not set your orders to “Completed” status and therefore cannot check the withdrawal period based on the completion date. With this setting, you specify after how many days orders can no longer be withdrawn. The calculation is based on the order date. If this date is older than the number of days defined here, the order can no longer be withdrawn. If 0 is entered, no restriction based on the order date applies.
With the “Label for submit button” setting, you can customize the text of the button used to submit the form. It is recommended that you keep the label “Submit Withdrawal.”
You can use the text field for the “Success message” setting to customize the message that appears after the withdrawal form has been successfully submitted. We recommend including the date and time of submission in the message. You can use the placeholders [date] and [time] for this purpose.
With the “Show ‘Withdrawal of Contract’ in order actions of ‘My Account’ page” setting, a button titled “Withdraw contract” is also displayed to the customer in the order actions on their “My Account” page. Using this button, customers can directly initiate the withdrawal process for eligible orders.
Permalink Emails
After the form is submitted, the administration team receives an email notification that a new withdrawal request has been received.
In addition, an email titled “Withdrawal request received” is automatically sent to the email address provided by the customer.
As soon as a withdrawal request has been confirmed or rejected by an administrator, the customer automatically receives a corresponding notification via email.
You can customize the subject and content of all customer emails related to cancellations in the “Withrawal Button – Emails” settings under the menu
WooCommerce → German Market → General → Withdrawal
Permalink Management of withdrawals
You can manage all received return requests centrally in the
WooCommerce → Withdrawals
menu.
In this menu, you’ll find an overview of all received withdrawal requests, including their current status. You can also approve or deny withrawals there.
The “Order” column displays the order number, provided the information from the form could be automatically assigned to a WooCommerce order. If automatic assignment was not possible, you can link the order manually.
The “Email” column shows you whether the email address provided by the customer matches the email address on the order. If they match, a checkmark appears; otherwise, an exclamation mark appears.
In the “Comments” column, a small icon appears if the comment field in the form was filled out. Clicking on it allows you to read the message left.
The “Status” column informs you whether the withdrawal request is still “Pending” or has already been “Approved“ or “Denied“.
In the “Actions” column, you have up to three buttons available, depending on the status:
- You can delete the cancellation request by clicking the trash can icon.
- You can approve the request by clicking the checkmark icon.
- You can use the X icon to deny the request. Before denying it, you have the option to add an optional note. This will then be displayed to the customer in the withdrawal email.
All three actions can also be performed collectively using the bulk actions feature. However, when denying multiple requests at once, you cannot specify an individual reason for denying.
Permalink Manually integrate the withdrawal button
With the setting “Show withdrawal button automatically in footer”, you can have the withdrawal button automatically added to your website’s footer.
However, depending on your website’s theme and layout, the appearance may not match your expectations. In this case, you can disable the automatic integration and place the withdrawal button anywhere within your theme manually.
Since the withdrawal button is simply a link pointing to the withdrawal form page (“Withdrawal of Contract”), it can be integrated into your menus and pages just like any other page link with minimal effort.
Make sure that the withdrawal button remains clearly visible, easily accessible, and visually distinct from the rest of your website’s content.
Add to a Navigation Menu
The withdrawal button can easily be added as a menu item to existing navigation menus, such as your shop’s footer menu.
You can manage your menus in the WordPress admin area under Appearance → Menus. Select the desired menu and add a new menu item that links to the withdrawal form page. By default, this page is titled “Withdrawal of Contract”.
To increase the visibility of the link, it is recommended to visually highlight the menu item as a button. This can be achieved, for example, by adding CSS classes to the menu item.
To do so, first click the “Screen Options” button at the top of the page and enable the “CSS Classes” checkbox. Many themes provide their own CSS classes for styling buttons, such as button or btn. The available classes depend on the theme you are using.
You can also create your own CSS classes in your theme’s stylesheet and assign them to the menu item here.
Integration via Widgets
Many themes provide additional footer widget areas. You can edit these under Appearance → Widgets.
There, you can for example add the “Buttons” block and directly link it to your “Withdrawal of Contract” page.
Alternatively, you can insert the “Shortcode” block and output our button using the shortcode:
Integration on your pages
You can also embed the button on any page of your shop.
To do this, edit the desired page and add, for example, the “Buttons” block, which you can directly link to your “Withdrawal of Contract” page.
Alternatively, you can insert the “Shortcode” block and output our button using the shortcode:
Permalink After approval of a withdrawal request
After you have approved a withdrawal request, you should refund the corresponding order accordingly.
If a partial withdrawal has been approved, you can also refund individual items within the order, either partially or in full.
Further information on refunds and their correct processing can be found here:
https://marketpress.com/documentation/german-market/stornos/
Permalink
Custom adjustments – templates
If you want to customize the templates for the withdrawal form and the withdrawal emails individually, you can copy the template files into your child theme in a way that keeps them update-safe. This ensures that your changes remain intact even after plugin updates.
You can find the original templates here:
wp-content/plugins/woocommerce-german-market/inc/withdrawal-button/templates
Copy the desired files into the following folder in your child theme:
wp-content/themes/"your-child-theme"/woocommerce-german-market/withdrawal-button/
The following templates control the output of the withdrawal forms:
- form-guest.php
- form-order-items.php
- form-registered-user.php
The templates for controlling the withdrawal emails can be found in the subfolder “emails”.
Permalink Custom adjustments – code snippets
Through filters and hooks, you can adapt the behavior of the withdrawal button to your requirements. The following examples show common adjustments that you can store in your child theme.
If you have basic development knowledge, you can add the code snippet to your theme’s `functions.php` file (preferably at the very end). However, you should use a child theme so that your changes are not overwritten with each theme update. Alternatively, you can use a plugin such as “Code Snippets” (https://de.wordpress.org/plugins/code-snippets/).
It allows you to easily add code directly from the WordPress backend, independent of your theme.
Show invoice number instead of order number
If the “Invoice Number” setting is enabled, you can display the invoice number instead of the order number in the selection field for registered customers:
add_filter( 'german_market_withdrawal_button_order_option_name', function( $option_name, $order ) {
if ( isset( $order[ 'invoice_number' ] ) && ( ! empty( $order[ 'invoice_number' ] ) ) ) {
$option_name = sprintf(
_x( 'Rechnung %s ', 'woocommerce-german-market' ),
$order[ 'invoice_number' ],
);
}
return $option_name;
}, 10, 2 );
Show only eligible orders in the selection field
By default, all orders are displayed as selectable options for registered customers.
If you want to restrict the selection to only those orders for which a withdrawal is permitted, you can achieve this using the following code snippet:
add_filter( 'german_market_withdrawal_button_get_withdrawal_form_order_only_allowed', '__return_true' );