Overriding the normal platform success message
The platform will respond with a success message when certain actions on a website are completed. For example, when the contact form is submitted the platform will output a message:
Thank you for your enquiry - we will respond to you as soon as possible
There maybe times when you would like to change the normal platform message and the guidance below explains how this is done.
The platform message maybe outputted either directly on the page file that renders the success message, or alternatively it might be constructed in a macro.
You'll either be able to find the platform message in a shopwired.twig file contained within a macros folder in your theme, or alternatively it will be contained in a template twig view like page.twig.
The variable to output the platform message is {{ global.info_message|raw }}
Once you've located where the variable is placed in your theme you can follow the instructions to change the default platform message.
You'll first need to record the exact platform message that you'd like to change. To do this, perform the action on the website that outputs the message and record the exact wording of the message, e.g.
Thank you for your enquiry - we will respond to you as soon as possible
Where the {{ global.info_message|raw }} variable is located you'll need to surround this with an if statement, e.g.
{% if global.info_message %} <div id="{{ id|default('shopwired-info-message') }}"> {{ global.info_message|raw }} </div> {% endif %}
becomes...
{% if global.info_message %} <div id="{{ id|default('shopwired-info-message') }}"> {% if global.info_message == 'Thank you for your enquiry - we will respond to you as soon as possible' %} We've got your message and we'll get back to you {% else %} {{ global.info_message|raw }} {% endif %} </div> {% endif %}