Prestashop users sometimes experiences an error message "an error occurred while sending the message" while working with it.
Basically, this error happens when there is an issue with the theme.
Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to fix similar Prestashop errors.
In this context, we shall look into how to fix this Prestashop error.
Sometimes, in the process of sending a message from a Contact form with Prestashop, users receive a message as shown below:
An error occured while sending the message, please try again.
In fact, this error occurs due to a number of reasons that include the version of the theme, code in the contactform.tpl file etc.
It generally indicates that the theme that we use does not adapt to the latest version of Prestashop.
Try the following fixes to resolve this error.
Sometimes, it is possible that the latest version of the theme is available, but the site is still using an older one.
As this error is generally caused by the theme incompatible with the latest version of Prestashop, a popular solution is to upgrade the version of the theme.
In addition, we may also need to contact the theme developer if the upgrade doesn't fix the error.
Another solution, that can fix the error is to update the theme file that handles forms. In this case, our Engineers edit the "/THEME/modules/contactform/views/templates/widget/contactform.tpl", locate the button that is responsible for submitting the form and add the following code:
<input type = "text" name = "url" value = "" />
<input type = "hidden" name = "token" value = "{$ token}" />
Sometimes, you may find that the error persists even after going through all the above steps. We find that it just requires the cache to be cleared from the Prestashop admin panel, for the error to disappear.
i. First, log into Prestashop admin panel.
ii. Then, navigate to Advanced Parameters > Performance.
iii. Now, set Force compile to Yes, disable Cache and save changes.
iv. Finally, go to your front-office and refresh the store page.
This article covers methods to fix Prestashop error "an error occurred while sending the message".
This error happens when the theme that we use does not adapt to the latest version of Prestashop.
To resolve this error, you can try modifying the contact form file.
Add this before the submit button :
<style>
input[name=url] {
display: none !important;
}
</style>
<input type="text" name="url" value=""/>
<input type="hidden" name="token" value="{$token}" />