Back to Top

Display custom message block on order confirmation page in PrestaShop

Updated 11 February 2022

In this blog, we are going to learn how to show the custom message block in the order confirmation page at the front end in PrestaShop.

fblog

Sometimes we need to show some additional information on the order confirmation page at the front end. So, we can achieve this by following steps.

Step 1:

Register “paymentReturn” hook in your module. To do so call the following function in the main file of your module-

$this->registerHook(‘paymentReturn’);

Step 2:

Create a function in the main file of your module to handle the functioning and return Tpl file.

For example:

Start your headless eCommerce
now.
Find out More
public function hookPaymentReturn($params)
{
    $this->context->smarty->assign(array(
      ‘msg’ => $this->l(‘Thankyou for purchase. Your order is 
              confirmed’)
    ));
    return $this->fetch(
       'module:mymodule/views/templates/hook/custom_msg.tpl'
    );
}

Now create a tpl file on this path “/views/templates/hook” and write the
html text that you want to display on the block.

<div class=”alert alert-success”>{$msg}</div>
<p>{l s=’- Your order will be sent as soon as possible’ mod=’mymodule’}</p>

Note:

This is a basic example in which we just displayed a simple message. Here you can display any kind of information like order information, customer information, etc.

If any issue or doubt please feel free to mention it in the comment section. I would be happy to help.

Also, you can explore our PrestaShop Development Services & a large range of quality PrestaShop Modules.

For any doubt contact us at [email protected]

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Back to Top

Message Sent!

If you have more details or questions, you can reply to the received confirmation email.

Back to Home