Lors de l'ajout du n° de suivi en BO:
CODEif(Mail::sendCore(
(int)$order->id_lang,
'in_transit',
Mail::l('Package in transit',
(int)$order->id_lang),
$templateVars,
$customer->email,
$customer->firstname.' '.$customer->lastname,
null, null, null, null,
_PS_MAIL_DIR_, true, (int)$order->id_shop
)) {
Lors du changement de statut, si le statut est "Expédié":
CODE $topic = /* Mail::sendCore(1, 'in_transit',*/Mail::l('Package in transit', (int)$order->id_lang)/*)*/;
$data['{followup}'] = '';
if($order->id_carrier) {
$carrier = new Carrier($order->id_carrier, $order->id_lang);
$orderCarrier = new OrderCarrier($order->getIdOrderCarrier());
$shipping_number = (
$orderCarrier->tracking_number ?
$orderCarrier->tracking_number :
$order->shipping_number
);
if(trim($shipping_number)) {
// If carrier url require postcode
$addressDelivery = new Address((int)$order->id_address_delivery);
$carrier->url = str_replace('$', $addressDelivery->postcode, $carrier->url);
$data['{followup}'] = str_replace('@', $shipping_number, $carrier->url);
}
}
else {
// Don't remove these comments: they are used for translations
$topic = /* Mail::sendCore(1, 'shipped',*/Mail::l('Your order has been shipped', (int)$order->id_lang)/*)*/;
$result['template'] = 'shipped';
}
La différence se fait si la commande a un transporteur et un n° de suivi.
On pourrait inverser les 2 si vous voulez.