Jump to content

How to resend the payment email for order created on backend?


Recommended Posts

This is the email template that is used

 

Hi {firstname} {lastname},

A new command has been generated to you.

Go on {order_link} to finalize the payment.

{shop_name} - {shop_url}

{shop_url} powered by PrestaShop™

 

 

The {order_link} is defined as

'{order_link}' => Context::getContext()->link->getPageLink('order', false, (int)$cart->id_lang, 'step=3&recover_cart='.(int)$cart->id.'&token_cart='.md5(_COOKIE_KEY_.'recover_cart_'.(int)$cart->id)),

That results in something that looks like this.

https://www.domain.com/order?step=3&recover_cart=<cart_id>&token_cart=<md5_token_hash>

Replace <cart_id> with the actual cart id

 

<md5_token_hash> is going to be more complicated since this is an md5 hash of the following 2 things
1) cookie key
2) recover_cart_<cart_id>
 

So I have created a quick php script that will generate the token hash for you.  Just update the id_cart value accordingly.

Place this script in the root folder of your Prestashop store and execute it from a browser.

 

I would suggest removing the file when you are done.

<?php

require(dirname(__FILE__).'/config/config.inc.php');

//REMEMBER TO CHANGE THE id_cart value
$id_cart='2';

echo md5(_COOKIE_KEY_.'recover_cart_'.$id_cart);

?>

When it is all complete, the URL should look something like this...

https://www.domain.com/order?step=3&recover_cart=2&token_cart=as897as98d7a9sd87as9d
  • Like 3
Link to comment
Share on other sites

what i provided is a way to generate the link that you can manually send to the customer.  It will not send the email to them, you will have to do that yourself.

 

 

I like to know suppose if an buyer try to make the payment. If his payment fails, I have observed that buyer have to order same product again & then different order number will be generated. Is that possible whenever order payment fails, buyer will receive same mail stating that payment failed or awaiting payment & in the same email he will get option to of paynow to complete that pending payment.

 

Thanks

Link to comment
Share on other sites

  • 1 year later...

Hi all,

 

I can send the e-mail to customer, but when customer click on the link and enter with first time, the session is created, the customer is logged, but the page redirect to my account page.

 

Only if the customer clicking again with logged, it works.

 

Anyone know how can i fix this?

 

Thanks Bruno

Link to comment
Share on other sites

×
×
  • Create New...