Setup guide · 5 minutes

Setting up Demfilz Returns and Warranty Claims

Install, set your periods and return instructions, link the returns page and work your first claim. This guide covers every setting, what customers and guests see, working a claim through to a refund or a replacement, the emails, privacy, the developer hooks and what to check when something looks wrong.

1. Install and activate

Upload demfilz-returns-and-warranty-claims-for-woocommerce.zip under Plugins → Add New Plugin → Upload Plugin and activate it. WooCommerce must be installed and active. Activation creates the plugin's tables, a private folder for photos and a published Returns and warranty page holding the [drwc_returns] shortcode. My Account gains a Returns tab after Orders.

2. The rules

Everything is under WooCommerce → Returns → Settings.

SettingWhat it does
ClaimsLets customers lodge claims. Off hides the buttons and the form; existing claims stay and staff can still work them.
Claim typesReturns, warranty claims, or both. With both, customers choose one when they start.
Order statusesOrders with these statuses can be claimed. Completed by default.
Return periodDays, counted from when the order was completed (or paid, or placed, if it never was). 0 means no time limit.
Warranty periodMonths, the store default. Each product can set its own (section 3). 0 means no time limit.
After the periodDo not accept claims, or Accept them and mark them "Late" for review. Your obligations under the consumer law that applies to your store may last longer than the periods you set, so accepting late claims for review is the safer choice.
Return reasons, Warranty reasonsThe reasons customers pick from, one per line, separately for each type.
Customers can ask forWhich of refund, replacement and repair are offered. What the customer asks for is a request; you decide the outcome.
PhotosOff, optional, required for warranty claims, or required for every claim, with the number of photos (1 to 10) and the size of each (1 to 20 MB). JPEG, PNG and WebP.
Return instructionsWhere to send the item and how to pack it. Shown on the claim page once you approve it, and in the email that tells the customer it was approved.
GuestsLets customers without an account look up an order on the returns page (section 5).
Returns pageThe page with the [drwc_returns] shortcode. Links in emails to customers without an account point here.
My AccountAdds the Returns tab. Off, logged in customers use the returns page instead.
Policy pageA page linked from the claim form, for example your returns policy.
Claim number prefixFor new claims, RW- by default, giving RW-1001, RW-1002 and so on.
RefundsWhether "Put the items back in stock" is ticked by default on the refund form.
UninstallDelete every claim, photo and setting when the plugin is deleted. Off by default.

3. Warranty length per product

On the General tab of a product, Warranty is one of: Store default, Set a length (with the months beside it), No time limit, or No warranty claims. Variations follow their product. A product with no warranty claims can still be returned inside the return period.

4. What customers see

WhereWhat
My Account → OrdersA Return button on each order that has something claimable.
View orderA Returns and warranty section with any claims on the order and a Request a return or warranty claim button.
My Account → ReturnsTheir claims with number, order, type, date and status, and the recent orders they can still claim on.
The claim formReturn or warranty first (when both are open), then each item with a quantity, the reason, the details (required for warranty claims), what they would like you to do, photos and your policy link. Items that cannot be claimed are listed with the reason: the period ended, no warranty, or already refunded or in another claim.
The claim pageThe status, the return instructions once approved, the items, reason, details and photos, the message thread with a reply box and photos, and Withdraw this claim while it is still pending review.

A customer can claim what they ordered, less what has been refunded, less what is in their other claims that are not declined, cancelled or refunded.

5. Customers without an account

On the returns page a guest enters the order number and the email address used at checkout. If they match an order that can be claimed, the Return link email goes to the address on the order with a link that works for 48 hours. The page shows the same message whether or not anything matched, so it cannot be used to find out whether an order exists, and lookups are limited to 10 per visitor in 15 minutes. The claim then gets its own link (in every email about it) that opens the claim page without logging in.

6. Working a claim

WhereWhat
WooCommerce → ReturnsEvery claim with claim number, order, customer, type, items, status and dates. Filter by status (Open is pending, approved and item received together), search by claim number, order number, name or email, and change the status of several at once. The menu shows how many wait for review. Late claims carry a Late flag.
The claim screenThe items against the order (claimed, ordered, refunded, line total), the reason, what the customer asked for, details and photos, and the whole thread.
MessagesWrite to the customer, or tick Private note for staff only. Choose a new status in the same step and the customer gets one email with both. Staff can attach photos.
Status boxChange the status, with or without emailing the customer.
Order screenA Returns and warranty box lists the order's claims, and Log a claim opens a form for a claim taken by phone or email (the periods do not apply).

Statuses: Pending review, Approved, Item received, Completed, Declined and Cancelled. Each change is added to the order notes.

7. Refunds and replacements

ActionWhat happens
Refund itemsCreates a WooCommerce refund for the claimed lines and their tax. The amount starts at the most that can be refunded: each line's share, less anything already refunded on that line, and never more than is left on the order. Lower it for a restocking fee and it is spread across the lines. Put the items back in stock restocks them. Refund the money through the payment method appears for gateways that support refunds; without it the refund is recorded and you pay the money back yourself. Mark the claim completed closes the claim. A second click, or a second window, cannot refund the claim twice.
Create replacement orderA new order for the claimed items at no charge, with the order's addresses, on hold, linked to the claim and the original order. Stock is reduced like any order. WooCommerce's new order, on hold and processing emails are not sent for it; the customer gets a claim update instead. The completed email still goes when you ship it.

A replacement order has created_via set to drwc_replacement and the meta _drwc_claim_id. Accounting sync plugins treat it like any order, so it reaches your books as a zero-value sale when they sync it.

8. The emails

Five standard WooCommerce emails under WooCommerce → Settings → Emails, each with an editable subject, heading and extra text, a preview, and templates you can copy to yourtheme/woocommerce/emails/:

EmailSent to and when
New return or warranty claimThe store (recipient editable), when a claim is lodged or logged.
Customer replied to a claimThe store, when the customer adds a message.
Claim receivedThe customer, when the claim is lodged.
Claim updatedThe customer, when you change the status or reply (one email for both), and when a replacement order is created.
Return linkThe order's billing address, after a matching lookup on the returns page.

9. Photos and privacy

Photos are saved in a folder under uploads with a random name, re-saved through WordPress's image editor (turned upright, at most 2000 pixels, without the location and device details cameras add) and shown only to store staff and the claim's owner. On Apache the folder also denies direct access. The WordPress privacy tools export a customer's claims, and erasing removes the name, email address, details, the customer's messages and the photos, keeping what was claimed and how it was resolved. Suggested privacy policy text is added under Settings → Privacy.

10. For developers

HookUse
drwc_claim_created, drwc_claim_status_changed, drwc_claim_message_addedActions on each claim event (the claim object is passed; the status change also passes the old and new status and who made it).
drwc_claim_refunded, drwc_replacement_createdActions after a refund or a replacement order, with the refund or the order.
drwc_reasons, drwc_resolutions, drwc_claimable_qty, drwc_order_eligibleFilters for the reason list, the resolutions offered, how many of a line can be claimed and whether an order can be claimed at all.
drwc_claim_number, drwc_lookup_order_id, drwc_replacement_order_statusFilters for the claim number, the order id for a typed order number (stores with custom order numbers) and the replacement order's status (on-hold by default).
drwc_account_endpoint, drwc_max_requests, drwc_limiter_ipFilters for the My Account slug, the lookup limit and the visitor address used for it (REMOTE_ADDR by default).

Claims live in four tables: {prefix}drwc_claims, {prefix}drwc_claim_items, {prefix}drwc_messages and {prefix}drwc_photos.

Troubleshooting

No Return button on an order: check the order's status is one of the chosen statuses, that the period has not ended (or that late claims are accepted), and that the items are not already refunded or in another claim.

The Returns tab is missing from My Account, or its pages show "not found": go to Settings → Permalinks and click Save once to refresh the endpoint, and check that the My Account setting is on.

A guest says the link never arrived: the link goes only to the email address on the order, and only when the order number and address match an order that can be claimed. Check your mail delivery; an SMTP plugin with a log helps.

"This page is out of date" when submitting: the page came from a cache older than its security token. Exclude My Account and the returns page from full page caching.

Photos do not upload: check the file type (JPEG, PNG or WebP), the size limit in the settings and your server's upload limit, and that the server has the GD or Imagick image library.

The refund amount is lower than expected: part of the line was refunded before, or the order has less left to refund. The amount is capped so the order's refunds never add up to more than was paid.

What happens if I deactivate or delete the plugin: deactivating removes the My Account tab and the buttons; claims, refunds and replacement orders are kept. Deleting the plugin keeps everything unless the Uninstall box is ticked.

Stuck, or want it customised?

We build and customise WooCommerce plugins for a living. If your store needs return shipping labels, store credit refunds, supplier claim-backs or custom rules, tell us what and we'll quote it.