Merge branch 'ticket/r14810-dropshipping-tracking'
This commit is contained in:
commit
d7cce43d8f
51
mails/en/in_transit_dropshipping_noinfo.html
Normal file
51
mails/en/in_transit_dropshipping_noinfo.html
Normal file
@ -0,0 +1,51 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Message de {shop_name}</title>
|
||||
</head>
|
||||
<body>
|
||||
<table style="font-family: tahoma,arial,sans-serif; font-size: 12px; color:#000000; width: 550px;">
|
||||
<tr>
|
||||
<td align="left">
|
||||
<a href="{shop_url}" title="{shop_name}"><img alt="{shop_name}" src="{shop_logo}" style="border:none;" ></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">Bonjour <strong>{firstname} {lastname}</strong>,</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">
|
||||
Vous avez passé commande récemment sur notre site Bébé Boutik.
|
||||
Nous vous informons que le/les produits de la marque {sale} pour votre commande n°{id_order} vient d'être envoyé directement de chez notre fournisseur.
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">
|
||||
Vous recevrez votre commande prochainement.
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">
|
||||
A très vite sur Bébé Boutik !
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">
|
||||
Cordialement,
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="center" style="font-size: 12px; border-top: 1px solid #cccccc; padding-top: 5px;">
|
||||
{shop_name} - <a href="{shop_url}" style="color: #e26ea2;">{shop_url}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
11
mails/en/in_transit_dropshipping_noinfo.txt
Normal file
11
mails/en/in_transit_dropshipping_noinfo.txt
Normal file
@ -0,0 +1,11 @@
|
||||
Bonjour {firstname} {lastname}
|
||||
|
||||
Vous avez passé commande récemment sur notre site Bébé Boutik. Nous vous informons que le/les produits de la marque {sale} pour votre commande n°{id_order} vient d'être envoyé directement de chez notre fournisseur.
|
||||
|
||||
Vous recevrez votre commande prochainement.
|
||||
|
||||
A très vite sur Bébé Boutik !
|
||||
|
||||
Cordialement,
|
||||
|
||||
{shop_name} - {shop_url}
|
44
mails/es/in_transit_dropshipping_noinfo.html
Normal file
44
mails/es/in_transit_dropshipping_noinfo.html
Normal file
@ -0,0 +1,44 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Message de {shop_name}</title>
|
||||
</head>
|
||||
<body>
|
||||
<table style="font-family: tahoma,arial,sans-serif; font-size: 12px; color:#000000; width: 550px;">
|
||||
<tr>
|
||||
<td align="left">
|
||||
<a href="{shop_url}" title="{shop_name}"><img alt="{shop_name}" src="{shop_logo}" style="border:none;" ></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">Buenos días <strong>{firstname} {lastname},</strong>,</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">
|
||||
Te informamos de que el/los producto(s) de la marca {sale} de tu pedido nº{id_order}, te los ha enviado directamente el proveedor a la dirección que nos has indicado.
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">
|
||||
Recibirás tu pedido en breve.
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">
|
||||
¡Hasta pronto! ¡Nos vemos en Bébé Boutik!
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="center" style="font-size: 12px; border-top: 1px solid #cccccc; padding-top: 5px;">
|
||||
{shop_name} - <a href="{shop_url}" style="color: #e26ea2;">{shop_url}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
11
mails/es/in_transit_dropshipping_noinfo.txt
Normal file
11
mails/es/in_transit_dropshipping_noinfo.txt
Normal file
@ -0,0 +1,11 @@
|
||||
Buenos días {firstname} {lastname},
|
||||
|
||||
Recientemente has pasado pedido en Bébé Boutik y te damos las gracias.
|
||||
|
||||
Te informamos de que el/los producto(s) de la marca {sale} de tu pedido nº{id_order}, te los ha enviado directamente el proveedor a la dirección que nos has indicado.
|
||||
|
||||
Recibirás tu pedido en breve.
|
||||
|
||||
¡Hasta pronto! ¡Nos vemos en Bébé Boutik!
|
||||
|
||||
{shop_name} - {shop_url}
|
@ -18,7 +18,8 @@
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">
|
||||
Vous avez passé commande récemment sur notre site Bébé Boutik. Nous vous informons que le/les produits de la marque {sale} pour votre commande n°{id_order} vient d'être envoyé directement de chez notre fournisseur par le transporteur {carrier}.
|
||||
Vous avez passé commande récemment sur notre site Bébé Boutik.
|
||||
Nous vous informons que le/les produits de la marque {sale} pour votre commande n°{id_order} vient d'être envoyé directement de chez notre fournisseur par le transporteur {carrier}.
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
@ -30,7 +31,7 @@
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">
|
||||
Vous pourrez consulter l'acheminnement de votre colis à l'adresse suivante : <a href="{followup}" style="color: #e26ea2;">{followup}</a>
|
||||
Vous pourrez consulter l'acheminement de votre colis à l'adresse suivante : <a href="{followup}" style="color: #e26ea2;">{followup}</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
|
@ -4,7 +4,7 @@ Vous avez passé commande récemment sur notre site Bébé Boutik. Nous vous inf
|
||||
|
||||
Voici votre numéro de suivi : {tracking_number}
|
||||
|
||||
Vous pourrez consulter l'acheminnement de votre colis à l'adresse suivante : {followup}
|
||||
Vous pourrez consulter l'acheminement de votre colis à l'adresse suivante : {followup}
|
||||
|
||||
A très vite sur Bébé Boutik !
|
||||
|
||||
|
51
mails/fr/in_transit_dropshipping_noinfo.html
Normal file
51
mails/fr/in_transit_dropshipping_noinfo.html
Normal file
@ -0,0 +1,51 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Message de {shop_name}</title>
|
||||
</head>
|
||||
<body>
|
||||
<table style="font-family: tahoma,arial,sans-serif; font-size: 12px; color:#000000; width: 550px;">
|
||||
<tr>
|
||||
<td align="left">
|
||||
<a href="{shop_url}" title="{shop_name}"><img alt="{shop_name}" src="{shop_logo}" style="border:none;" ></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">Bonjour <strong>{firstname} {lastname}</strong>,</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">
|
||||
Vous avez passé commande récemment sur notre site Bébé Boutik.
|
||||
Nous vous informons que le/les produits de la marque {sale} pour votre commande n°{id_order} vient d'être envoyé directement de chez notre fournisseur.
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">
|
||||
Vous recevrez votre commande prochainement.
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">
|
||||
A très vite sur Bébé Boutik !
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="left">
|
||||
Cordialement,
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr>
|
||||
<td align="center" style="font-size: 12px; border-top: 1px solid #cccccc; padding-top: 5px;">
|
||||
{shop_name} - <a href="{shop_url}" style="color: #e26ea2;">{shop_url}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
11
mails/fr/in_transit_dropshipping_noinfo.txt
Normal file
11
mails/fr/in_transit_dropshipping_noinfo.txt
Normal file
@ -0,0 +1,11 @@
|
||||
Bonjour {firstname} {lastname}
|
||||
|
||||
Vous avez passé commande récemment sur notre site Bébé Boutik. Nous vous informons que le/les produits de la marque {sale} pour votre commande n°{id_order} vient d'être envoyé directement de chez notre fournisseur.
|
||||
|
||||
Vous recevrez votre commande prochainement.
|
||||
|
||||
A très vite sur Bébé Boutik !
|
||||
|
||||
Cordialement,
|
||||
|
||||
{shop_name} - {shop_url}
|
@ -2,8 +2,9 @@
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
include_once(_PS_ROOT_DIR_.'/modules/privatesales/Sale.php');
|
||||
require_once(PS_ADMIN_DIR . '/helpers/HelperFormBootstrap.php');
|
||||
|
||||
require_once _PS_ROOT_DIR_.'/modules/privatesales/Sale.php';
|
||||
require_once PS_ADMIN_DIR .'/helpers/HelperFormBootstrap.php';
|
||||
|
||||
class AdminAntDropshippingtracking extends AdminTab
|
||||
{
|
||||
@ -20,10 +21,13 @@ class AdminAntDropshippingtracking extends AdminTab
|
||||
}
|
||||
}
|
||||
|
||||
public function _postProcess() {
|
||||
if(Tools::isSubmit('submitOrderTracking') && Tools::getValue('id_sale')){
|
||||
public function _postProcess()
|
||||
{
|
||||
$this->_html = '';
|
||||
|
||||
if ($id_sale = Tools::getValue('id_sale')) {
|
||||
// Selection des produits de la vente
|
||||
$errors = 0;
|
||||
$id_sale = (int)Tools::getValue('id_sale');
|
||||
$sale_names = array();
|
||||
foreach(Db::getInstance()->ExecuteS('
|
||||
SELECT c.`name`, c.`id_lang`
|
||||
@ -42,23 +46,95 @@ class AdminAntDropshippingtracking extends AdminTab
|
||||
$sale_products[(int)$row['id_product']] = (int)$row['id_product'];
|
||||
}
|
||||
|
||||
if(isset($_FILES['csvfile']) && $_FILES['csvfile']['name'] != '') {
|
||||
|
||||
$f = fopen($_FILES['csvfile']['tmp_name'], 'r');
|
||||
fgetcsv($f, 0, ';');
|
||||
$i = 1;
|
||||
$infosTrackingEnable = $infosTrackingDisable = 0;
|
||||
// Fichier avec infos tracking
|
||||
if (Tools::isSubmit('submitOrderTracking')) {
|
||||
$infosTrackingEnable = 1;
|
||||
}
|
||||
// Fichier sans infos de tracking
|
||||
if (Tools::isSubmit('submitOrderTrackingNull')) {
|
||||
$infosTrackingDisable = 1;
|
||||
}
|
||||
|
||||
// Gestion du fichier CSV
|
||||
$orders = array();
|
||||
while($line = fgetcsv($f, 0, ';')) {
|
||||
if (isset($_FILES['csvfile']) && $_FILES['csvfile']['name'] != '') {
|
||||
$cols = array(
|
||||
'id_order',
|
||||
'tracking_number',
|
||||
'carrier',
|
||||
'link',
|
||||
);
|
||||
$i = 0;
|
||||
$f = fopen($_FILES['csvfile']['tmp_name'], 'r');
|
||||
while ($data = fgetcsv($f, 0, ';')) {
|
||||
$i++;
|
||||
$orders[(int) $line[0]] = array(
|
||||
'id_order' => (int) $line[0],
|
||||
'tracking_number' => trim($line[1]),
|
||||
'carrier' => $line[2],
|
||||
'link' => trim($line[3]),
|
||||
if ($i == 1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Get Data
|
||||
$num = count($data);
|
||||
|
||||
// Check line integrity
|
||||
if ($num != count($cols)) {
|
||||
$orders = array();
|
||||
break;
|
||||
}
|
||||
|
||||
// Assign var
|
||||
$line = array();
|
||||
for ($c=0; $c<$num; $c++) {
|
||||
$name = $cols[$c];
|
||||
switch ($name) {
|
||||
case 'tracking_number':
|
||||
case 'link';
|
||||
$line[$name] = trim($data[$c]);
|
||||
break;
|
||||
default:
|
||||
$line[$name] = $data[$c];
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Vérification des données
|
||||
if ($infosTrackingDisable == 1) {
|
||||
if ($line['tracking_number'] != ''){
|
||||
$orders = array();
|
||||
break;
|
||||
}
|
||||
if ($line['link'] != ''){
|
||||
$orders = array();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($infosTrackingEnable == 1) {
|
||||
if ($line['tracking_number'] == ''){
|
||||
$orders = array();
|
||||
break;
|
||||
}
|
||||
if ($line['link'] == ''){
|
||||
$orders = array();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Assign orders
|
||||
$orders[(int) $line['id_order']] = array(
|
||||
'id_order' => (int)$line['id_order'],
|
||||
'tracking_number' => $line['tracking_number'],
|
||||
'carrier' => $line['carrier'],
|
||||
'link' => $line['link'],
|
||||
);
|
||||
}
|
||||
if(!empty($orders)) {
|
||||
}
|
||||
else {
|
||||
$this->_html .= HelperFormBootstrap::displayErrors($this->l('Fichier manquant !'));
|
||||
}
|
||||
|
||||
// Traitement des commandes
|
||||
if (count($orders) > 0) {
|
||||
foreach ($orders as $id_order => $o) {
|
||||
if ($id_order != 0) {
|
||||
$order = new Order((int)$id_order);
|
||||
@ -73,8 +149,9 @@ class AdminAntDropshippingtracking extends AdminTab
|
||||
}
|
||||
|
||||
$fully_sent = false;
|
||||
$products_sent = array();
|
||||
|
||||
// Calcul des produits déjà envoyés par LaPoste
|
||||
$products_sent = array();
|
||||
foreach (Db::getInstance()->ExecuteS('
|
||||
SELECT d.`id_order_detail`, IF(
|
||||
(d.`product_quantity` - IF(
|
||||
@ -92,6 +169,7 @@ class AdminAntDropshippingtracking extends AdminTab
|
||||
}
|
||||
}
|
||||
|
||||
// Calcul des produits déjà envoyé Exapaq
|
||||
foreach (Db::getInstance()->ExecuteS('
|
||||
SELECT d.`id_order_detail`, IF(
|
||||
(d.`product_quantity` - IF(
|
||||
@ -109,6 +187,7 @@ class AdminAntDropshippingtracking extends AdminTab
|
||||
}
|
||||
}
|
||||
|
||||
// Calcul des produits déjà envoyé MondialRelay
|
||||
foreach (Db::getInstance()->ExecuteS('
|
||||
SELECT d.`id_order_detail`, IF(
|
||||
(d.`product_quantity` - IF(
|
||||
@ -126,6 +205,7 @@ class AdminAntDropshippingtracking extends AdminTab
|
||||
}
|
||||
}
|
||||
|
||||
// Calcul des produits déjà envoyé Philea
|
||||
foreach (Db::getInstance()->ExecuteS('
|
||||
SELECT d.`id_order_detail`, IF(
|
||||
(d.`product_quantity` - IF(
|
||||
@ -143,6 +223,7 @@ class AdminAntDropshippingtracking extends AdminTab
|
||||
}
|
||||
}
|
||||
|
||||
// Calcul des produits déjà envoyé Dropshipping
|
||||
foreach (Db::getInstance()->ExecuteS('
|
||||
SELECT d.`id_order_detail`, IF(
|
||||
(d.`product_quantity` - IF(
|
||||
@ -159,13 +240,17 @@ class AdminAntDropshippingtracking extends AdminTab
|
||||
$products_sent[] = (int) $quantity_remain['id_order_detail'];
|
||||
}
|
||||
}
|
||||
|
||||
$remaining = array();
|
||||
$html_products_sent = '';
|
||||
foreach($order_details as $id_order_detail => $d) {
|
||||
// Calcul des produits restant
|
||||
if (!in_array($id_order_detail, $products_sent) && !in_array($d['product_id'], $sale_products)) {
|
||||
$remaining[] = (int)$id_order_detail;
|
||||
} elseif(!in_array($id_order_detail, $products_sent) && in_array((int)$d['product_id'],$sale_products)) {
|
||||
$html_products_sent .= '<br />'."\r\n".$d['quantity'] . 'x' . ' ' . $p['product_name'];
|
||||
}
|
||||
// Marquage envoi
|
||||
elseif (!in_array($id_order_detail, $products_sent) && in_array((int)$d['product_id'],$sale_products)) {
|
||||
|
||||
if ($infosTrackingEnable == 1) {
|
||||
Db::getInstance()->ExecuteS('
|
||||
INSERT INTO `'._DB_PREFIX_.'ant_dropshipping_parcel`
|
||||
VALUES (
|
||||
@ -178,6 +263,22 @@ class AdminAntDropshippingtracking extends AdminTab
|
||||
)
|
||||
');
|
||||
}
|
||||
|
||||
if ($infosTrackingDisable == 1) {
|
||||
// Supprimer tracking_number et link
|
||||
Db::getInstance()->ExecuteS('
|
||||
INSERT INTO `'._DB_PREFIX_.'ant_dropshipping_parcel`
|
||||
VALUES (
|
||||
'.(int) $id_order_detail.',
|
||||
'.(int) $d['quantity'].',
|
||||
"",
|
||||
"NOTRACKING",
|
||||
"",
|
||||
NOW()
|
||||
)
|
||||
');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (count($remaining) == 0) {
|
||||
@ -186,6 +287,27 @@ class AdminAntDropshippingtracking extends AdminTab
|
||||
$fully_sent = false;
|
||||
}
|
||||
|
||||
$history = new OrderHistory();
|
||||
$history->id_order = (int) $order->id;
|
||||
$history->changeIdOrderState(($fully_sent ? Configuration::get('PS_OS_SHIPPING') : 17), (int) $order->id);
|
||||
$history->id_employee = 0;
|
||||
$history->add();
|
||||
|
||||
// Send Mail with tracking info
|
||||
if ($infosTrackingEnable == 1) {
|
||||
Db::getInstance()->ExecuteS('
|
||||
INSERT INTO `'._DB_PREFIX_.'shipping_history`
|
||||
VALUES (
|
||||
'.(int) $order->id.',
|
||||
"'.pSQL($o['tracking_number']).'",
|
||||
NOW(),
|
||||
0,
|
||||
'.(int)$id_sale.'
|
||||
)
|
||||
');
|
||||
|
||||
global $_LANGMAIL;
|
||||
$subject = 'Package in transit';
|
||||
$customer = new Customer((int) $order->id_customer);
|
||||
$templateVars = array(
|
||||
'{followup}' => $o['link'],
|
||||
@ -195,35 +317,41 @@ class AdminAntDropshippingtracking extends AdminTab
|
||||
'{firstname}' => $customer->firstname,
|
||||
'{lastname}' => $customer->lastname,
|
||||
'{id_order}' => (int) $order->id,
|
||||
// '{product_list}' => !empty($html_products_sent)? $content_html.$html_products_sent: '',
|
||||
// '{product_list_txt}' => !empty($html_products_sent)? $content_txt.strip_tags($html_products_sent): '',
|
||||
);
|
||||
if (!Mail::Send(intval($order->id_lang), 'in_transit_dropshipping',
|
||||
((is_array($_LANGMAIL) && key_exists($subject, $_LANGMAIL)) ? $_LANGMAIL[$subject] : $subject),
|
||||
$templateVars, $customer->email, $customer->firstname.' '.$customer->lastname)) {
|
||||
$errors++;
|
||||
}
|
||||
}
|
||||
|
||||
$history = new OrderHistory();
|
||||
$history->id_order = (int) $order->id;
|
||||
$history->changeIdOrderState(($fully_sent? Configuration::get('PS_OS_SHIPPING'): 17), (int) $order->id);
|
||||
$history->id_employee = 0;
|
||||
$history->add();
|
||||
|
||||
Db::getInstance()->ExecuteS('
|
||||
INSERT INTO `'._DB_PREFIX_.'shipping_history`
|
||||
VALUES (
|
||||
'.(int) $order->id.',
|
||||
"'.pSQL($o['shipping_number']).'",
|
||||
NOW(),
|
||||
0,
|
||||
'.(int)$id_sale.'
|
||||
)
|
||||
');
|
||||
|
||||
global $_LANGMAIL;
|
||||
// Send Mail without tracking info
|
||||
if ($infosTrackingDisable == 1) {
|
||||
$subject = 'Package in transit';
|
||||
if(!Mail::Send(intval($order->id_lang), 'in_transit_dropshipping', ((is_array($_LANGMAIL) && key_exists($subject, $_LANGMAIL)) ? $_LANGMAIL[$subject] : $subject), $templateVars, $customer->email, $customer->firstname.' '.$customer->lastname)){
|
||||
$customer = new Customer((int) $order->id_customer);
|
||||
$templateVars = array(
|
||||
'{sale}' => $sale_names[(int)$order->id_lang],
|
||||
'{firstname}' => $customer->firstname,
|
||||
'{lastname}' => $customer->lastname,
|
||||
'{id_order}' => (int) $order->id,
|
||||
);
|
||||
if (!Mail::Send(intval($order->id_lang), 'in_transit_dropshipping_noinfo',
|
||||
((is_array($_LANGMAIL) && key_exists($subject, $_LANGMAIL)) ? $_LANGMAIL[$subject] : $subject),
|
||||
$templateVars, $customer->email, $customer->firstname.' '.$customer->lastname)) {
|
||||
$errors++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($errors == 0) {
|
||||
$this->_html .= HelperFormBootstrap::displaySuccess($this->l('Fichier importé avec succès !'));
|
||||
} else {
|
||||
$this->_html .= HelperFormBootstrap::displayErrors($this->l($errors.' mails n\'ont pas pu être envoyés'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Cookie
|
||||
if (!isset($_COOKIE['logistics_sales'])){
|
||||
setcookie('logistics_sales', $id_sale, 0, __PS_BASE_URI__);
|
||||
} else {
|
||||
@ -233,21 +361,15 @@ class AdminAntDropshippingtracking extends AdminTab
|
||||
}
|
||||
setcookie('logistics_sales', implode('-', $sales), 0, __PS_BASE_URI__);
|
||||
}
|
||||
if($errors==0){
|
||||
$this->_html .= HelperFormBootstrap::displaySuccess($this->l('Fichier importé avec succès !'));
|
||||
} else {
|
||||
$this->_html .= HelperFormBootstrap::displayErrors($this->l($errors.' mails n\'ont pas pu être envoyés'));
|
||||
}
|
||||
} else {
|
||||
else {
|
||||
$this->_html .= HelperFormBootstrap::displayErrors($this->l('Aucune commande trouvée, vérifier votre fichier'));
|
||||
}
|
||||
} else {
|
||||
$this->_html .= HelperFormBootstrap::displayErrors($this->l('Fichier manquant !'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function display() {
|
||||
public function display()
|
||||
{
|
||||
global $cookie, $currentIndex;
|
||||
$base_link = $currentIndex . '&token='.Tools::getAdminTokenLite('AdminAntDropshippingtracking');
|
||||
|
||||
@ -287,10 +409,12 @@ class AdminAntDropshippingtracking extends AdminTab
|
||||
</div>
|
||||
<div class="panel-content">
|
||||
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
|
||||
<div class="col-md-5 col-md-offset-4">';
|
||||
<div class="col-md-12">';
|
||||
$help = '<br>
|
||||
<p class="help-block">'.$this->l('Format: id_order;tracking_number;carrier;tracking_link').'</p>
|
||||
<p class="help-block">'.$this->l('The subsequent columns and the first line are ignored.').'</p>
|
||||
<p class="help-block">'.$this->l('With tracking infos, all columns must be set.').'</p>
|
||||
<p class="help-block">'.$this->l('Without tracking infos, use the same format but columns tracking_number, carrier and tracking_link must be empty.').'</p>
|
||||
';
|
||||
$input = array(
|
||||
'label' => $this->l('Sale: '),
|
||||
@ -313,13 +437,15 @@ class AdminAntDropshippingtracking extends AdminTab
|
||||
<div class="clearfix"></div>
|
||||
<div class="ln_solid"></div>
|
||||
<div class="form-group text-right">
|
||||
<button type="submit" class="btn btn-primary" name="submitOrderTracking">'.$this->l('Importer').'</button>
|
||||
<button type="submit" class="btn btn-primary" name="submitOrderTracking">'.$this->l('Importer avec tracking').'</button>
|
||||
<button type="submit" class="btn btn-primary" name="submitOrderTrackingNull">'.$this->l('Importer sans tracking').'</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
</div>
|
||||
';
|
||||
|
||||
$this->_html .= $helperForm->renderScript();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user