Jump to content

Como inserto el nº de seguimiento en el email "pedido en transito"


Recommended Posts

En versiones anteriores tenía que modificar el fichero admin/tabs/AdminOrders.php, y añadir la línea '{expedicion}' => $order->shipping_number, pero en la 1.5.2 no está este fichero. Alguien me puede decir en donde puedo añadir el nº de expedicion en los emails para los clientes??? Gracias a todos

 

 

 

 

if ($shipping_number)

{

global $_LANGMAIL;

$customer = new Customer(intval($order->id_customer));

$carrier = new Carrier(intval($order->id_carrier));

if (!Validate::isLoadedObject($customer) OR !Validate::isLoadedObject($carrier))

die(Tools::displayError());

$templateVars = array(

'{followup}' => str_replace('@', $order->shipping_number, $carrier->url),

'{firstname}' => $customer->firstname,

'{lastname}' => $customer->lastname,

'{id_order}' => intval($order->id),

'{expedicion}' => $order->shipping_number

);

$subject = 'Package in transit';

Mail::Send(intval($order->id_lang), 'in_transit', ((is_array($_LANGMAIL) AND key_exists($subject, $_LANGMAIL)) ? $_LANGMAIL[$subject] : $subject), $templateVars, $customer->email, $customer->firstname.' '.$customer->lastname);

}

Link to comment
Share on other sites

Una pregunta, para hacer la prueba he copiado el texto que dicta Trasgu en mi código pero no se que hacer para que lo envíe por correo.

Por lo que entiendo, la variable $order->shipping_number esta declarada pero no se como hacerlo para que me salga en el mail cuando se envía.

Link to comment
Share on other sites

Tienes que tener activado el módulo MAILALERTS.

Si tienes instalado la versión 1.4.x tienes que buscar el fichero admin/tabs/AdminOrders.php y si tienes la versión 1.5.x ese fichero está en el directorio \controllers\admin.

Editas el fichero y buscas el lugar donde se declaran las variables y añades la línea

'{expedicion}' => $order->shipping_number

debajo de las otras variables en la parte de código de los emails Package in transit.

Luego vas a Rendimiento - Forzar compilación, pruebas a ver si te funciona y luego vuelve a ponerlo en Nunca compilar.

Saludos.

  • Like 1
Link to comment
Share on other sites

A ver, se que hay algo que me estoy dejando...

Efectivamente, tengo la 1.4 y he modificado el código tal como has dicho, quedando de la siguiente manera:

 

if ($shipping_number)

{

global $_LANGMAIL;

$customer = new Customer(intval($order->id_customer));

$carrier = new Carrier(intval($order->id_carrier));

if (!Validate::isLoadedObject($customer) OR !Validate::isLoadedObject($carrier))

die(Tools::displayError());

$templateVars = array(

'{followup}' => str_replace('@', $order->shipping_number, $carrier->url),

'{firstname}' => $customer->firstname,

'{lastname}' => $customer->lastname,

'{id_order}' => intval($order->id),

'{expedicion}' => $order->shipping_number

);

$subject = 'Package in transit';

Mail::Send(intval($order->id_lang), 'in_transit', ((is_array($_LANGMAIL) AND key_exists($subject, $_LANGMAIL)) ? $_LANGMAIL[$subject] : $subject), $templateVars, $customer->email, $customer->firstname.' '.$customer->lastname);

}

 

Si me baso en el código que hay arriba, es exactamente igual! Aunque creo que algo me estoy dejando... Tengo que modificar la plantilla "in_transit.html" para que se visualice la variable "shipphing_number" no?

Aquí estoy perdido, sorry! :unsure:

 

Edito: En el apartado de transportista, al final de la url, he puesto la "@"... Por si acaso...

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

Yo entiendo que tengo que hacer que se envíe así, no?

 

Mail::Send(intval($order->id_lang), 'in_transit', ((is_array($_LANGMAIL) AND key_exists($subject, $_LANGMAIL)) ? $_LANGMAIL[$subject] : $subject), $templateVars, $customer->email, $customer->firstname.' '.$customer->lastname);

 

Y al final de la línea, añadir la variable $order->shipping_number, no? La duda que tengo, es que no se como hacer que se visualice en el correo. Es decir, yo dejaría la línea anterior de la siguiente manera:

 

Mail::Send(intval($order->id_lang), 'in_transit', ((is_array($_LANGMAIL) AND key_exists($subject, $_LANGMAIL)) ? $_LANGMAIL[$subject] : $subject), $templateVars, $customer->email, $customer->firstname.' '.$customer->lastname, $order->shipping_name);

 

Estaría esto correcto? Y si lo está, como lo hago para mostrarlo en el correo que se envía al cliente??

Link to comment
Share on other sites

Ya estaba bien como lo hacías antes!

 

if ($shipping_number)
{
global $_LANGMAIL;
$customer = new Customer(intval($order->id_customer));
$carrier = new Carrier(intval($order->id_carrier));
if (!Validate::isLoadedObject($customer) OR !Validate::isLoadedObject($carrier))
die(Tools::displayError());
$templateVars = array(
'{followup}' => str_replace('@', $order->shipping_number, $carrier->url),
'{firstname}' => $customer->firstname,
'{lastname}' => $customer->lastname,
'{id_order}' => intval($order->id),
******* '{expedicion}' => $order->shipping_number *******
);
$subject = 'Package in transit';
Mail::Send(intval($order->id_lang), 'in_transit', ((is_array($_LANGMAIL) AND key_exists($subject, $_LANGMAIL)) ? $_LANGMAIL[$subject] : $subject), $templateVars, $customer->email, $customer->firstname.' '.$customer->lastname);
}

 

Y luego abre el fichero html y mira como están puestas las variables! Que estarán así: {expedicion}

 

PD: Los **** están puestos para marcar la línea importante, quítalos.

Edited by joseantgv (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 1 year later...

Hola a todos,


 


Cuando tengo el numero de envío para hacer seguimiento, lo ingreso en la ficha del pedido y se le envia el correo al cliente, pero esta fallando el {followup} por que no hala el enlace configurado en transportista para que el cliente haga seguimiento del pedido.


 


Adjunto imagen para ser mas especifico.


 


Agradezco a quien me pueda brindar ayuda.


 


IMAGEN


post-750964-0-61689200-1395258159.jpg


Link to comment
Share on other sites

Hola que tal... lo he solucionado... Simplemente active el modulo followup en la seccion modulos y luego elimine el transportista y lo volvi a crear un trasportista nuevo con las mismas caracteristicas del anterior.. 

 

y asi se soluciono...

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...