OCMLABS/MODULE-PRODUCT-MESSAGING · SUCCESS PAGE BLOCKS

Show product-specific CMS blocks on the Magento 2 checkout success page

  • Magento
  • Adobe Commerce
  • Hyvä

The checkout success page is the one moment you know the customer is still looking. A rule’s success-page action puts a CMS static block there, only for orders that contain a matching SKU: a warranty registration link, a manual download, a note that the battery ships separately.

Checkout success page with a "Register your 5-year warranty" block under the order confirmation

Set it up

  1. On the rule form, turn on Show Block on Success Page.
  2. Pick a block in Success Block. Only active CMS blocks are listed.
  3. Save the rule. The next matching order shows the block.

To build a block without leaving the rule, click + Create New Block. It opens the real CMS block editor, including Page Builder or the WYSIWYG editor, in a modal. Edit opens the selected block the same way. Both save through the standard CMS block save, so the result is an ordinary block in Content > Blocks, not a copy. The Success Block dropdown refreshes without a page reload, and a failed save, such as a duplicate identifier, reports the reason.

The block action is independent of the email action. A rule can show a block at checkout and email the customer on shipment, or do only one of the two.

How-to: product specific content on the checkout success page, 1:02

How blocks render

  • Several matches stack. If multiple rules match the order, all of their blocks render, in ascending rule ID order.
  • No match, no markup. A non-matching order renders nothing at all, not an empty wrapper.
  • Full CMS processing. {{widget}}, {{store url}}, and media URLs work as in any other CMS block. Content is not escaped; it is trusted admin content, the same as core block rendering.
  • Disabled or deleted blocks render as nothing, not an error.
  • Multi-address checkout is supported: the multishipping success page shows the blocks for the orders just placed.

Each matched block is wrapped in a bare <div class="ocmlabs-product-messaging-block"> with no styling, so the block’s own content controls the look.

Luma and Hyva

Output is server-rendered HTML from your CMS block. There is no JavaScript, RequireJS, or UI component involved, so it renders identically on Luma and Hyva with no compatibility module. On Hyva, put Tailwind classes in the block content as you would for any other block.

Evaluated live, not logged

Blocks are matched against the order each time the success page renders. There is no queue, no log, and no impression tracking. On the standard one-page checkout, Magento shows the success page only once per order: refreshing it, navigating away and back, or opening the URL directly redirects to the cart, so the blocks are not shown again. The multishipping success page keeps its order ids in the session, so a refresh there re-runs the match and shows the same blocks. That is by design: if the information needs a durable copy, give the same rule an email action.

Blocks appear on the checkout success page only, not on the customer’s order view page or inside order emails.

Turning it off

Stores > Configuration > OCM Labs > Product Messaging > Success Page > Enable Checkout Success-Page Blocks switches off every success-page block without affecting emails. The module-wide Enabled switch turns off both.

See also

In this module