Jump to content

Add order status to confirmation email


Recommended Posts

Hello Prestashop community .

 

I'm having a bit of trouble with a payment module I just installed for a Prestashop 1.5 store .

 

The problem I'm having is that if payment is denied by the bank , the order is placed normally (with an "Authorization denied ..." status ) but the confirmation email that the customer receives doesn't say anything about this .

 

I realise that I'm supposed to modify the mailalerts module in order to insert order status into the email , but I can't figure out how exactly .

 

 

If you could help me figure this out , or alternatively suggest a better solution , I would be very grateful .

 

Thanks in advance .

 

Please ... anyone ?

Edited by eugen01 (see edit history)
Link to comment
Share on other sites

Wow , I didn't think this would be much of a problem for experienced developers .

 

Does anyone know how I could at least stop the confirmation email from being sent if payment fails ?

 

Thank you .

 

P.S. : I'm sorry for replying to my own post .. but I am getting a bit desperate.

Link to comment
Share on other sites

In MailAlerts module find hookActionValidateOrder method and add order state variable initialization after $order variable has been initialized (after line 268).

$orders_status = $order->getCurrentState();

 

Then add this var to initialization of $template_vars array, something like this:

'{orders_status}' => $order_status,

and you will be able to use this template variable in ./modules/mailalerts/mails/en/new_order.html

Link to comment
Share on other sites

  • 2 years later...

Hi, i have a similar situation, i want to add the "$orders_status" in the order confirmation.

i already did this in ...themes/default-bootstrap/mails/es/order_conf.html, but in the email confirmation the client receive is not working, it just shows the code.

 

The mailalert module by dafeault have in the var list the variable i´m trying to use:

'{order_status}' => $order_state->name,

 

Im trying to do this because the payment system even if the payment wasnt sucessful sends anyway the order confirmation, so we need to check in that send email the current order status without to enter the PS order dashboard.

for example: Order Status: Waiting for payment, or Payment Sucessful etc.

 

I really appreciate any advice to solve this

post-711003-0-20558100-1470864573_thumb.png

post-711003-0-69538100-1470864575_thumb.png

Edited by gongorajorge (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...