Skip to content

How to Show Pre-Order Details with a Shortcode

The shortcode prints the same block the product page shows. It is how you build a launch page that takes reservations without sending anyone to the shop.

Go to Configuration → Shortcodes.

The Shortcode Settings section

Default [ddwcpo_preorder_template_shortcode]. If you rename it here the old name stops working at once, so rename it before you use it anywhere or leave it alone.

Go to Pre-Order → Products. The ID is in the small line under each product name.

The products list showing IDs under the product names

On a page or post, add a Shortcode block and paste:

[ddwcpo_preorder_template_shortcode product_id="648"]

On a product page itself the attribute can be left off, and it uses that product:

[ddwcpo_preorder_template_shortcode]

The block the shortcode prints

You should get the release date, the countdown, your notice, the pre-order price, the stock line and the pre-order button, all working exactly as they do on the product page.

The shortcode prints nothing at all unless the product it names is currently taking pre-orders: pre-order settings present, Status Active, availability Not Available.

That is deliberate rather than a limitation. A landing page carrying this shortcode empties itself the moment the product releases, instead of showing a countdown to a date that has gone.

The usual two conditions apply as well: the licence has to be active and Enable pre-orders ticked, because the storefront half of the plugin does not load otherwise.

The countdown the block carries with it

A shape that works:

  1. Your own headline, images and copy about the product.
  2. The shortcode, so the date, the countdown and the button sit inside your layout.
  3. Whatever you would normally put below a buy button, such as delivery terms or a returns note.

Because the block empties on release, add a line above it that still makes sense afterwards, and the page keeps working as a plain product page once the reservation window closes.

Repeat the shortcode with different IDs.

[ddwcpo_preorder_template_shortcode product_id="648"]
[ddwcpo_preorder_template_shortcode product_id="31"]

Each renders its own block with its own countdown. Add your own headings between them: the block prints the date and the price, not the product name.

The same products as they appear in the shop grid

Anywhere shortcodes run, this runs: a sidebar widget, a footer, a block theme template part. In a theme file, do_shortcode() works too.

For a widget, always pass product_id. Outside a product page there is no product for it to fall back to, so a bare shortcode prints nothing.