Zum Inhalt springen

Selling a pre-order

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

This walkthrough follows one pre-order product from setup to the order that lands in your fulfilment queue, and notes exactly what the code does at each step.

Edit the product and open Product data → General:

  1. Tick Pre-order.
  2. Give the product a price, a priceless pre-order is not made purchasable.
  3. Save.

That is the whole per-product setup: one checkbox. There is no release-date field or per-product label here. Set the product’s stock status to Out of stock when you want it to behave as a reservation rather than a normal in-stock sale; while the pre-order flag is set, an out-of-stock status no longer blocks purchase.

On the single-product page, with the global toggle on:

  • The add-to-cart button reads your Default button text (for example Pre-order now) instead of “Add to cart”.
  • A reservation stub renders in the product summary (priority 25 on woocommerce_single_product_summary): a paper claim-ticket reading “Reserved as a pre-order, Not in stock yet, your order holds a place in line and ships when it arrives.” It carries role="note".

The stub sets the expectation up front: a shopper who knows they are reserving an unshipped item does not open a “where’s my order?” ticket. A small footer script “punches” the stub when it appears and again when the cart form is submitted, purely visual, and skipped for users who prefer reduced motion.

When the product (or a variation of it) is added to the cart, Preorder marks the cart item with an internal flag and surfaces it as a Pre-order: Yes row on the line, via woocommerce_get_item_data. The row appears in both the classic cart and the Cart/Checkout Blocks, so the shopper sees right up to payment that this line is a reservation. No release date is shown, the plugin does not track one.

At checkout, woocommerce_checkout_create_order_line_item copies the flag onto the order line item as order item meta: a Pre-order: Yes entry. Open the order under WooCommerce → Orders and the pre-order lines are identifiable, so fulfilment can hold them until stock arrives instead of shipping immediately.

Because the data lives on the order item, it survives under HPOS (Custom Order Tables) and is readable by any export or packing-slip tooling that reads order item meta.

Two ways to wind a pre-order down:

  • Pause everything, turn off Enable pre-orders under WooCommerce → Pre-orders. Preorder stops registering its storefront hooks, so every flagged product reverts to normal behaviour at once. Turn it back on later without re-flagging anything.
  • End one product, when stock arrives, set the product back to In stock (and untick Pre-order if you want the label and stub gone). It returns to normal stock-managed selling. Order lines already placed keep their Pre-order: Yes meta for fulfilment.

The cart and order flag is set against whichever product or variation is added to the cart, so a purchased variation of a pre-order product is still flagged on the order line. The relabeled button and the reservation stub are driven by the single-product hooks, which read the main product object, confirm your theme’s variable-product template renders them as you expect before relying on it.

The stub is server-rendered in PHP and sits in the normal document flow, so it adds no Cumulative Layout Shift. The only asset pair (one stylesheet, one tiny vanilla script) is enqueued only on a single pre-order product page, not site-wide. The script has no dependencies and loads deferred in the footer. The stub uses role="note", decorative parts are marked aria-hidden, the animation is suppressed under prefers-reduced-motion: reduce, and a dark-scheme variant ships under prefers-color-scheme: dark.