Craft Commerce: Detecting & Styling Flash Messages? I'm styling my flash messages in Craft Commerce - I added if statements to detect the type of flash message. I noticed however that the message no longer displays but the styling does get picked up. Any ideas what I might need to do here?

{% if craft.session.getFlash('notice') %}
    &lt;div data-alert class="alert-box info radius"&gt;
      {{ craft.session.getFlash('notice') }}
      &lt;a href="#" class="close"&gt;&amp;times;&lt;/a&gt;
    &lt;/div&gt;
{% endif %}

{% if craft.session.getFlash('error') %}
    &lt;div data-alert class="alert-box alert radius"&gt;
      {{ craft.session.getFlash('error') }}
      &lt;a href="#" class="close"&gt;&amp;times;&lt;/a&gt;
    &lt;/div&gt;
{% endif %}
Getting a flash message also deletes it, so you should set it to a variable first, otherwise, when you try to access it a second time, it will be empty.

So you need to do something like this:

{% set flashNotice = craft.session.getFlash('notice') %}
{% if flashNotice %}
    &lt;div data-alert class="alert-box info radius"&gt;
      {{ flashNotice }}
      &lt;a href="#" class="close"&gt;&amp;times;&lt;/a&gt;
    &lt;/div&gt;
{% endif %}

{% set flashError = craft.session.getFlash('error') %}
{% if flashError %}
    &lt;div data-alert class="alert-box alert radius"&gt;
      {{ flashError }}
      &lt;a href="#" class="close"&gt;&amp;times;&lt;/a&gt;
    &lt;/div&gt;
{% endif %}