December 14, 2018

cm-mini

Thinking Magento

Magento Enterprise - Full Page Cache & Messages / Notices

Just a quick one about Magento Enterprise Full Page Cache.

Recently I noticed that the Enterprise PageCache wasn't hole punching notifications to the customer, so it would just reload the page without displaying the notice. But if the customer went on to do something else, such as a search, then the notice would appear. "This product is not available in the requested quantities"

So taking a look at the theme, I had a quick look to check for the issue.

In the catalog/view.phtml on the product page, is the following to get the message block

<div id="messages_product_view"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>

and after checking through a more recent version of Enterprises theme files I notice a difference and updated it to the following

<div id="messages_product_view"><?php echo $this->getMessagesBlock()->setEscapeMessageFlag(true)->toHtml() ?></div>

Now messages are displayed to the customer without being cached.