Saltar al contenido principal

Blocks

ReturnDesk adds three blocks to the block editor, in the WooCommerce block category. All three are rendered on the server, so they always show your current settings, and the editor shows a preview.

BlockNameEdition
Return policythemesic/return-policyLite, Pro
Start a return buttonthemesic/start-return-buttonLite, Pro
Return portalthemesic/return-portalPro

The Return policy block and the Start a return button in the editor

Return policy​

Prints your return policy from your settings, so the page can never disagree with the plugin. It shows:

  • The return window, for example "Returns are accepted within 30 days of the day the order is completed." The text follows Return window (days) and Count the window from. With a window of 0 it says "Returns are not accepted."
  • A line about the EU 14-day right of withdrawal, when that setting is on.
  • "Items marked as final sale cannot be returned." when a final sale tag is set.
  • A restocking fee line (Pro), when a fee is set.
  • Who pays return shipping: "We pay for return shipping.", "Return shipping is paid by the customer." or "We pay for return shipping when the item is defective. Otherwise the customer pays." The Lite edition always shows the last one, the default, because the shipping payer is a Pro setting.
  • A list titled "How we resolve a return:" with the resolutions you allow. In Lite these are "Refund to the original payment method" and "Exchange for another size or colour"; in Pro the exchange reads "Exchange for another item" and store credit and warranty claims can be listed too.

Block settings, in the Policy panel: Show how returns are resolved (on by default) turns the resolutions list on or off. The block supports wide and full alignment, text and background colour, spacing and font size from your theme.

The policy block uses the store-wide settings. Window, non-returnable and final sale overrides on single products and categories are not part of it.

Start a return button​

A button that links to My Account > Returns, where the customer picks an order. Block settings, in the Button panel: Button text (default "Start a return"). The block supports left, center and right alignment, and margin.

Signed-out visitors are sent to the same address. My Account asks them to sign in. With the Pro edition active, signed-out visitors are sent to the guest portal instead. A theme or plugin can change the address with the tsre_start_return_url filter.

Return portal (Pro)​

The Return portal block in the editor

Places the guest portal on a page: a form asking for the order number and billing email, followed by the return wizard for signed-out customers. The editor shows a static preview of the form. Wide alignment is supported and only one portal can be placed on a page.

The block does the same as the [tsre_return_portal] shortcode. See Pro features for the setup, the page address and the protections.

Editing the output​

The blocks, the My Account pages, the guest portal and the emails are templates. To change one, copy it from wp-content/plugins/returndesk/templates/ into your theme under returndesk/, keeping the sub folder:

Plugin templateCopy to
templates/blocks/return-policy.phpyourtheme/returndesk/blocks/return-policy.php
templates/blocks/start-return-button.phpyourtheme/returndesk/blocks/start-return-button.php
templates/myaccount/wizard-items.phpyourtheme/returndesk/myaccount/wizard-items.php
templates/emails/customer-return-approved.phpyourtheme/returndesk/emails/customer-return-approved.php

The same pattern applies to every file under templates/ (blocks, myaccount, portal, emails and emails/plain). The front-end pages use a small stylesheet that loads only on the Returns pages and the portal.