Skip to content
Customer experience

Shortcodes and blocks

WPReturns has two shortcodes and two matching blocks: [ddwcwr_returns_portal] with the Returns portal block, and [ddwcwr_withdrawal_form] with the Withdrawal form block. The first pair shows the guest returns portal and the second shows the EU withdrawal function. Neither takes attributes, and both render on the server.

Available in: Free and Pro.

What it showsShortcodeBlock nameBlock title
Guest returns portal[ddwcwr_returns_portal]ddwcwr/returns-portalReturns portal
EU withdrawal function[ddwcwr_withdrawal_form]ddwcwr/withdrawal-formWithdrawal form

Both blocks sit in the WooCommerce category of the block inserter.

The My Account Returns page is a WooCommerce account endpoint. It needs no shortcode. See Returns in My Account.

  1. Open the page in the block editor.
  2. Select the + inserter and search for “Returns portal” or “Withdrawal form”.
  3. Insert the block and publish the page.
  4. Go to DevDiggers Plugins > WPReturns > Configuration and point the matching setting at this page.
Block or shortcodeSetting to update
Returns portalGuest returns portal page on the General tab
Withdrawal formWithdrawal page on the EU Withdrawal tab

Emails, the footer link, checkout notices and order buttons all link to the page saved there.

Use the shortcode in a classic page or builder

Section titled “Use the shortcode in a classic page or builder”

Paste the shortcode into a Shortcode block, a classic editor page or a page builder text widget:

[ddwcwr_returns_portal]
[ddwcwr_withdrawal_form]

Place each one only once per page. Each shortcode reads its own query parameters, such as ddwcwr-order and ddwcwr-key. Two copies on one page would show the same screen twice.

PageSlugContent
Returns (Returns & Exchanges when Pro creates it)returns[ddwcwr_returns_portal]
Withdraw from contractwithdrawal[ddwcwr_withdrawal_form]

If a page with the shortcode already exists, activation reuses it.

Plugin styles and scripts load only on My Account, on pages with a shortcode or block and on the two pages saved in settings.

Every customer screen sits inside a .ddwcwr-ui wrapper and inherits your theme’s fonts. Colors and corners come from CSS variables you can override in your theme:

.ddwcwr-ui {
--ddwcwr-accent: #0256ff;
--ddwcwr-accent-text: #ffffff;
--ddwcwr-card: #ffffff;
--ddwcwr-radius: 12px;
--ddwcwr-radius-sm: 8px;
}

In Pro, the Appearance tab sets the accent color, button text color, card color and corner style without code. See Appearance.

To change the markup itself, copy a template into your theme. See Template overrides.