-
Notifications
You must be signed in to change notification settings - Fork 43
Development guide
Marijus Dilys edited this page Jun 17, 2025
·
2 revisions
Always extend AbstractMollieController instead of ModuleFrontController for AJAX controllers:
// Correct way
class YourAjaxController extends AbstractMollieController
{
// Your controller code
}
// Incorrect way
class YourAjaxController extends ModuleFrontController
{
// Will return HTTP 500 instead of 200 on ajaxRender()
}- Default PrestaShop controllers return HTTP 500 for
ajaxRender()responses -
AbstractMollieControllerensures proper HTTP 200 status - Provides built-in error handling and logging
- Formats JSON responses correctly
class MollieCustomAjaxModuleFrontController extends AbstractMollieController
{
public function postProcess()
{
try {
$result = ['success' => true];
$this->ajaxRender(json_encode($result)); // By default 200 HTTP Status
} catch (\Throwable $e) {
$this->ajaxRender('Error processing request');
}
}
}Remember: Using AbstractMollieController is crucial for maintaining consistent and reliable AJAX functionality across the module.
For further questions or concerns please raise an issue or contact us via [email protected]