Template overrides
WPReturns builds every customer screen from PHP templates you can override in your theme. Copy a file from the plugin’s templates/front/ folder to yourtheme/wpreturns/front/ and edit the copy. WooCommerce’s template loader then picks your copy, and plugin updates leave it alone.
Available in: Free and Pro. The extended warranty template exists only in Pro.
Override a template
Section titled “Override a template”- Find the template in the plugin that runs your store. With Pro active that is
wp-content/plugins/wpreturns-pro/templates/front/. With only the free plugin it iswp-content/plugins/wpreturns/templates/front/. - Create the folder
wpreturns/front/inside your child theme. - Copy the file there with the same name.
- Edit the copy.
wp-content/themes/your-child-theme/└── wpreturns/ └── front/ └── request-view.phpUse a child theme. A parent theme update would delete your copies.
Templates you can override
Section titled “Templates you can override”| Template | Screen | Main variables |
|---|---|---|
account-requests.php | My Account > Returns: tiles, Your requests and Start a return | $requests, $orders |
order-panel.php | The Returns, exchanges & warranty panel under an order | $order, $requests, $links, $guest |
portal-lookup.php | Guest portal: order number and billing email form | $account_url |
portal-order.php | Guest portal: order summary card | $order, $order_data, $items |
request-form.php | The request form with items, resolution, note and uploads | $order, $order_data, $type, $items, $reasons, $conditions, $resolutions, $exchange, $configuration, $posted, $note, $back_url, $token_fields, $bonus, $fees |
request-view.php | The customer’s request page | $request, $order, $items, $messages, $access_key, $label_url, $configuration, $back_url |
withdrawal-form.php | Withdrawal start screen, model form and statement | $step, $prefill, $items, $orders, $configuration |
withdrawal-done.php | Withdrawal received screen | $request, $items |
product-policy.php | Policy, final-sale and warranty lines on product pages | $lines, $policy_url |
extended-warranty.php | Extended warranty dropdown on product pages (Pro) | $options |
Each template documents its variables in the header comment.
Keep the forms working
Section titled “Keep the forms working”Forms post back to the same page and WPReturns reads fixed field names. When you change a form, keep:
- the
nameof every input, select and textarea - the hidden
ddwcwr_actionfield and thewp_nonce_field()call - the hidden token fields in
request-form.php($token_fields). Guests lose access without them. - the honeypot field (
ddwcwr_website) inportal-lookup.phpandwithdrawal-form.php.
Other templates
Section titled “Other templates”| File | How to change it |
|---|---|
Email template (templates/emails/request.php and emails/plain/request.php) | Edit the text in WooCommerce > Settings > Emails. To change the markup, copy it to yourtheme/woocommerce/emails/request.php, the usual WooCommerce email path. |
Packing slip (templates/common/return-slip.php, Pro) | Loaded directly from the plugin. It cannot be overridden from the theme. |
| Admin screens | Use hooks such as ddwcwr_requests_list_columns |
After plugin updates
Section titled “After plugin updates”Template files carry a @version line in the header. When an update changes a template, compare it with your copy and bring over the changes. A stale copy can miss new fields or fixes.
For color and corner changes you rarely need an override. Use the CSS variables on .ddwcwr-ui. See Shortcodes and blocks.