Merge branch 'develop' of git@gitlab.antadis.net:dev-antadis/bebeboutik.git into develop
@ -675,7 +675,7 @@ class AdminOrders extends AdminTab
|
||||
$this->_errors[] = Tools::displayError('An error occurred during deletion of the product.').' <span class="bold">'.$orderDetail->product_name.'</span>';
|
||||
Module::hookExec('cancelProduct', array('order' => $order, 'id_order_detail' => $id_order_detail));
|
||||
}
|
||||
|
||||
|
||||
if (!sizeof($this->_errors) AND $customizationList)
|
||||
foreach ($customizationList AS $id_customization => $id_order_detail)
|
||||
{
|
||||
@ -684,7 +684,7 @@ class AdminOrders extends AdminTab
|
||||
if (!$order->deleteCustomization($id_customization, $qtyCancelProduct, $orderDetail))
|
||||
$this->_errors[] = Tools::displayError('An error occurred during deletion of product customization.').' '.$id_customization;
|
||||
}
|
||||
|
||||
|
||||
// E-mail params
|
||||
if ((isset($_POST['generateCreditSlip']) OR isset($_POST['generateDiscount']) OR isset($_POST['generateDiscount2'])) AND !sizeof($this->_errors))
|
||||
{
|
||||
@ -2303,6 +2303,8 @@ class AdminOrders extends AdminTab
|
||||
<br />
|
||||
<fieldset style="width: 400px">
|
||||
<legend><img src="../img/admin/details.gif" /> '.$this->l('Order details').'</legend>
|
||||
<label>'.$this->l('Depuis l\'Appli :').' </label>
|
||||
<div style="margin: 2px 0 1em 50px;">'.($order->appli?'OUI':'NON').'</div>
|
||||
<label>'.$this->l('Original cart:').' </label>
|
||||
<div style="margin: 2px 0 1em 190px;"><a href="?tab=AdminCarts&id_cart='.$cart->id.'&viewcart&token='.Tools::getAdminToken('AdminCarts'.(int)(Tab::getIdFromClassName('AdminCarts')).(int)($cookie->id_employee)).'">'.$this->l('Cart #').sprintf('%06d', $cart->id).'</a></div>
|
||||
<label>'.$this->l('Payment mode:').' </label>
|
||||
|
@ -549,7 +549,7 @@ class PDFCore extends PDF_PageGroupCore
|
||||
'company' => trim($mr_point['MR_Selected_LgAdr1']),
|
||||
'vat_number' => '',
|
||||
'address1' => trim($address_lines[0]),
|
||||
'address2' => trim($address_lines[1]),
|
||||
'address2' => isset($address_lines[1]) ? trim($address_lines[1]) : '',
|
||||
'postcode' => trim($mr_point['MR_Selected_CP']),
|
||||
'city' => trim($mr_point['MR_Selected_Ville']),
|
||||
'Country:name' => trim($mr_point['MR_Selected_Pays']),
|
||||
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 7.6 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 7.2 KiB |
BIN
img/mails/bienvenue-FR_appli_15.jpg
Normal file
After Width: | Height: | Size: 8.0 KiB |
BIN
img/mails/bienvenue-FR_appli_17.jpg
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
img/mails/bienvenue-FR_phone_14.jpg
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
img/mails/bienvenue-FR_phone_16.jpg
Normal file
After Width: | Height: | Size: 14 KiB |
@ -22,14 +22,13 @@
|
||||
<tr>
|
||||
<td align="left"><img src="{shop_url}img/mails/bienvenue-ES_05.jpg" style="border:none;" /></td>
|
||||
<td width="406" align="center" style="font-size: 13px; color: #4d4b7d;">
|
||||
Hola {firstname},<br/><br/>
|
||||
Hola {firstname},<br/>
|
||||
Tu cuenta ha sido creada correctamente: ya eres miembro de Bebé Boutik, ¡el club de ventas privadas para mamás, bebés y niños de hasta 12 años!
|
||||
<br/>
|
||||
Aprovecha a partir de ahora de las mejores marcas ¡hasta -70%!
|
||||
<br/><br/>
|
||||
<a href="{shop_url}" style="text-transform: uppercase; color: #fff; text-decoration: none; background-color: #fb66a9; border-radius: 5px;padding: 3px 20px;">¡DESCUBRE!</a>
|
||||
</td>
|
||||
<td align="left"><img alt="grille" src="{shop_url}img/mails/bienvenue-ES_04.jpg" style="border:none;" /></td>
|
||||
<td align="left"><img src="{shop_url}img/mails/bienvenue-ES_04.jpg" style="border:none;" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"><img alt="4 buenas rezonas" src="{shop_url}img/mails/bienvenue-ES_08.jpg" style="border:none;" /></td>
|
||||
|
@ -8,7 +8,7 @@
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table style="font-family: tahoma,arial,sans-serif; font-size: 12px; color:#4d4b7d; width: 550px; border-collapse: collapse" border="0" cellpadding="0" cellspacing="0">
|
||||
<table style="font-family: tahoma,arial,sans-serif; font-size: 12px; color:#4d4b7d; width: 650px; border-collapse: collapse" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td align="left" colspan="3">
|
||||
<a href="{shop_url}" title="{shop_name}"><img alt="{shop_name}" src="{shop_url}img/mails/bienvenue-FR_01.jpg" style="border:none;" ></a>
|
||||
@ -20,15 +20,17 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left"><img alt="grille" src="{shop_url}img/mails/bienvenue-FR_05.jpg" style="border:none;" /></td>
|
||||
<td width="406" align="center" style="font-size: 13px; color: #4d4b7d;">
|
||||
Bonjour {firstname},<br/><br/>
|
||||
Votre compte a bien été créé : vous êtes maintenant membre de Bébé Boutik, le site de ventes privées pour mamans, bébés et enfants jusqu'à 12 ans ! <br/><br/>
|
||||
Profitez dès maintenant des meilleures marques jusqu'à 70% !
|
||||
<td width="118" align="left" style="width:118px;"><img src="{shop_url}img/mails/bienvenue-FR_05.jpg" style="border:none;" /></td>
|
||||
<td align="center" style=" font-size: 13px; color: #4d4b7d; width: 403px;">
|
||||
<font face="Open-sans, sans-serif">
|
||||
Bonjour {firstname},<br/>
|
||||
Votre compte a bien été créé : vous êtes maintenant membre de Bébé Boutik, le site de ventes privées pour mamans, bébés et enfants jusqu'à 12 ans ! <br/>
|
||||
Profitez dès maintenant des meilleures marques jusqu'à -70% !
|
||||
<br/><br/>
|
||||
<a href="{shop_url}" style="text-transform: uppercase; color: #fff; text-decoration: none; background-color: #fb66a9; border-radius: 5px;padding: 3px 20px;">A toute suite</a>
|
||||
<a href="{shop_url}" style="text-transform: uppercase; color: #fff; text-decoration: none; background-color: #fb66a9; border-radius: 5px;padding: 3px 20px;">A tout de suite</a>
|
||||
</font>
|
||||
</td>
|
||||
<td align="left"><img alt="grille" src="{shop_url}img/mails/bienvenue-FR_04.jpg" style="border:none;" /></td>
|
||||
<td width="124" align="left" style="width:124px;"><img src="{shop_url}img/mails/bienvenue-FR_04.jpg" style="border:none;" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"><img alt="4 bonnes raisons" src="{shop_url}img/mails/bienvenue-FR_08.jpg" style="border:none;" /></td>
|
||||
@ -44,15 +46,21 @@
|
||||
<table>
|
||||
<tr align="center">
|
||||
<td width="25"> </td>
|
||||
<td><span>Jusqu'à <strong color="#fb66a9" style="color: #fb66a9">70%</strong> de réduction</span></td>
|
||||
<td><strong color="#fb66a9" style="color: #fb66a9">Retour gratuit</strong>: 14 jours pour changer d'avis !</td>
|
||||
<td>Paiement <strong color="#fb66a9" style="color: #fb66a9">100% sécurisé</strong> Paypal & CB</td>
|
||||
<td>Un Service Client <strong color="#fb66a9" style="color: #fb66a9">à votre écoute</strong></td>
|
||||
<td><font face="Open-sans, sans-serif"><span>Jusqu'à <strong color="#fb66a9" style="color: #fb66a9">-70%</strong> de réduction</span></font></td>
|
||||
<td><font face="Open-sans, sans-serif"><strong color="#fb66a9" style="color: #fb66a9">Retours gratuits </strong>: 14 jours pour changer d'avis !</font></td>
|
||||
<td><font face="Open-sans, sans-serif">Paiement <strong color="#fb66a9" style="color: #fb66a9">100% sécurisé </strong> Paypal & CB</font></td>
|
||||
<td><font face="Open-sans, sans-serif">Un <strong color="#fb66a9" style="color: #fb66a9">Service Client </strong> à votre écoute</font></td>
|
||||
<td width="25"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3"><img alt="L'appli Bébé Boutik" src="{shop_url}img/mails/bienvenue-FR_12.jpg" style="border:none;" /></td>
|
||||
</tr>
|
||||
@ -64,17 +72,17 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
<table cellpadding="0" cellspacing="0" style="border-collapse: collapse">
|
||||
<tr align="center">
|
||||
<td><img alt="smartphone 1" src="{shop_url}img/mails/bienvenue-FR_14.jpg" style="border:none;" /></td>
|
||||
<td><img src="{shop_url}img/mails/bienvenue-FR_phone_14.jpg" style="border:none;" /></td>
|
||||
<td>
|
||||
<a href="#appli1" style="text-decoration: none;" title="App Store"><img alt="App Store" src="{shop_url}img/mails/bienvenue-FR_15.jpg" style="border:none;" /></a>
|
||||
<a href="#appli1" style="text-decoration: none;" title="App Store"><img alt="App Store" src="{shop_url}img/mails/bienvenue-FR_appli_15.jpg" style="border:none;" /></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr align="center">
|
||||
<td><img alt="smartphone 2" src="{shop_url}img/mails/bienvenue-FR_16.jpg" style="border:none;" /></td>
|
||||
<td><img src="{shop_url}img/mails/bienvenue-FR_phone_16.jpg" style="border:none;" /></td>
|
||||
<td>
|
||||
<a href="#appli2" style="text-decoration: none;" title="App Store"><img alt="Google Play" src="{shop_url}img/mails/bienvenue-FR_17.jpg" style="border:none;" /></a>
|
||||
<a href="#appli2" style="text-decoration: none;" title="App Store"><img alt="Google Play" src="{shop_url}img/mails/bienvenue-FR_appli_17.jpg" style="border:none;" /></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -110,23 +110,25 @@ class AdminAntWp extends AdminTab
|
||||
if($line[0] != '') {
|
||||
$ean = trim($line[0]);
|
||||
$products[$ean] = array(
|
||||
'ean' => $ean,
|
||||
'supplier_ref' => trim($line[1]),
|
||||
'name_ha' => trim($line[2]),
|
||||
'quantity' => trim($line[3]),
|
||||
'ppc' => trim($line[4]),
|
||||
'prix_ha' => trim($line[5])
|
||||
'ean' => $ean,
|
||||
'supplier_ref' => trim($line[1]),
|
||||
'name_ha' => trim($line[2]),
|
||||
'quantity' => trim($line[3]),
|
||||
'ppc' => trim($line[4]),
|
||||
'prix_ha' => trim($line[5]),
|
||||
'name_attribute_ha' => trim($line[6])
|
||||
);
|
||||
$eans[] = $ean;
|
||||
} else {
|
||||
$ref = trim($line[1]);
|
||||
$products[$ref] = array(
|
||||
'ean' => trim($line[0]),
|
||||
'supplier_ref' => $ref,
|
||||
'name_ha' => trim($line[2]),
|
||||
'quantity' => trim($line[3]),
|
||||
'ppc' => trim($line[4]),
|
||||
'prix_ha' => trim($line[5])
|
||||
'ean' => trim($line[0]),
|
||||
'supplier_ref' => $ref,
|
||||
'name_ha' => trim($line[2]),
|
||||
'quantity' => trim($line[3]),
|
||||
'ppc' => trim($line[4]),
|
||||
'prix_ha' => trim($line[5]),
|
||||
'name_attribute_ha' => trim($line[6])
|
||||
);
|
||||
$refs[] = $ref;
|
||||
}
|
||||
@ -164,7 +166,8 @@ class AdminAntWp extends AdminTab
|
||||
|
||||
foreach (Db::getInstance()->executeS('
|
||||
SELECT p.`id_product`, p.`id_tax_rules_group`, p.`id_category_default`, at.`ean13`, p.`price`, p.`wholesale_price`,
|
||||
p.`reference`, p.`supplier_reference`, p.`weight`, p.`height`, p.`width`, p.`depth`, c.`position`, cu.`nc8`, cu.`id_country`
|
||||
p.`reference`, p.`supplier_reference`, p.`weight`, p.`height`, p.`width`, p.`depth`, c.`position`, cu.`nc8`, cu.`id_country`,
|
||||
al.`name` as attribute_name
|
||||
FROM
|
||||
`'._DB_PREFIX_.'product` p
|
||||
INNER JOIN (SELECT date_add, max(id_product) as maxid FROM `'._DB_PREFIX_.'product` GROUP BY `supplier_reference`) as b
|
||||
@ -175,6 +178,10 @@ class AdminAntWp extends AdminTab
|
||||
ON (cu.`id_product` = p.`id_product`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute` at
|
||||
ON (at.`id_product` = p.`id_product`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` ac
|
||||
ON (ac.`id_product_attribute` = at.`id_product_attribute`)
|
||||
LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al
|
||||
ON (al.`id_attribute` = ac.`id_attribute` AND al.`id_land` = 2)
|
||||
WHERE at.`ean13` IN ("'.implode('","',$eans).'")
|
||||
AND p.`id_product` IS NOT NULL
|
||||
ORDER BY c.`position`
|
||||
@ -280,7 +287,7 @@ class AdminAntWp extends AdminTab
|
||||
Avec les colonnes suivantes :<br>
|
||||
</p>
|
||||
<ul style="list-style:none;">
|
||||
<li style="font-size:13px;"><i>ean;ref_fournisseur;nom_produit_HA;quantite;PPC;prix_achat</i></li>
|
||||
<li style="font-size:13px;"><i>ean;ref_fournisseur;nom_produit_HA;quantite;PPC;prix_achat;taille_ha</i></li>
|
||||
</ul>
|
||||
<p>Les colonnes suivantes et la première ligne du fichier seront ignorées.</p>
|
||||
<p></p>'
|
||||
|
@ -23,31 +23,52 @@ class Privatesales_Family_Menu extends Module {
|
||||
public function hooktopMenu($params) {
|
||||
global $cookie, $smarty;
|
||||
|
||||
$id_lang = (int)$cookie->id_lang;
|
||||
|
||||
$filename = _PS_ROOT_DIR_.'/modules/privatesales_family_menu/menu_'.$id_lang.'.txt';
|
||||
$expire = time() -3600;
|
||||
|
||||
if(file_exists($filename) && filemtime($filename) > $expire) {
|
||||
$data = file_get_contents($filename);
|
||||
$menus = json_decode($data, TRUE);
|
||||
$id_lang = (int)$cookie->id_lang;
|
||||
/**
|
||||
* @Override cache file
|
||||
*/
|
||||
if (class_exists('CacheRedis')) {
|
||||
$tpl_cache_name = 'sale_privatesales_family_menu_'.(int) $cookie->id_lang.'.html';
|
||||
if (false === ($result = CacheRedis::getInstance()->get($tpl_cache_name, 'sale_privatesales_family_menu'))) {
|
||||
$menus = $this->getTree($cookie->id_lang);
|
||||
if (!$menus) {
|
||||
CacheRedis::getInstance()->set($tpl_cache_name, 'sale_privatesales_family_menu', '', CacheRedis::MEDIUM_TTL);
|
||||
return "";
|
||||
}
|
||||
$smarty->assign(array(
|
||||
'menus' => $menus
|
||||
));
|
||||
$result = $this->display(__FILE__, 'menu.tpl');
|
||||
CacheRedis::getInstance()->set($tpl_cache_name, 'sale_privatesales_family_menu', $result, CacheRedis::MEDIUM_TTL);
|
||||
}
|
||||
} else {
|
||||
$file = fopen($filename, 'w+');
|
||||
$menus = $this->getTree($cookie->id_lang);
|
||||
fwrite($file, json_encode($menus));
|
||||
fclose($file);
|
||||
}
|
||||
$filename = _PS_ROOT_DIR_.'/modules/privatesales_family_menu/menu_'.$id_lang.'.txt';
|
||||
$expire = time() -3600;
|
||||
|
||||
$smarty->assign(array(
|
||||
'menus' => $menus
|
||||
));
|
||||
return $this->display(__FILE__, 'menu.tpl');
|
||||
if(file_exists($filename) && filemtime($filename) > $expire) {
|
||||
$data = file_get_contents($filename);
|
||||
$menus = json_decode($data, TRUE);
|
||||
} else {
|
||||
$file = fopen($filename, 'w+');
|
||||
$menus = $this->getTree($cookie->id_lang);
|
||||
fwrite($file, json_encode($menus));
|
||||
fclose($file);
|
||||
}
|
||||
|
||||
$smarty->assign(array(
|
||||
'menus' => $menus
|
||||
));
|
||||
$result = $this->display(__FILE__, 'menu.tpl');
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function hookPrivateSales_update($params)
|
||||
{
|
||||
if (class_exists('CacheRedis')) {
|
||||
CacheRedis::getInstance()->clear('sale*');
|
||||
}
|
||||
$id_langs = array(2,3);
|
||||
|
||||
foreach ($id_langs as $key => $id_lang) {
|
||||
$filename = _PS_ROOT_DIR_.'/modules/privatesales_family_menu/menu_'.$id_lang.'.txt';
|
||||
|
||||
@ -125,8 +146,7 @@ class Privatesales_Family_Menu extends Module {
|
||||
WHERE p.`public` = 0
|
||||
AND pv.`version` = "'.pSql($site_version_front).'"
|
||||
AND p.`enabled` = 1
|
||||
AND p.`date_start` > NOW()
|
||||
AND p.`date_end` > NOW()
|
||||
AND CAST(p.`date_start` AS DATE) = CAST(DATE_ADD(NOW(), INTERVAL 1 DAY) AS DATE)
|
||||
AND pcf.`id_category_family` = '.(int)$child['id_category_family'].'
|
||||
GROUP BY p.`id_sale`
|
||||
ORDER BY p.`date_end` ASC
|
||||
|
@ -839,12 +839,12 @@ class Cart extends CartCore {
|
||||
|
||||
if (!$order_total)
|
||||
return Tools::displayError('Cannot add voucher if order is free.');
|
||||
|
||||
|
||||
// Only for API (application)
|
||||
if (!Tools::isApi() && $discountObj->appli == 1) {
|
||||
return Tools::displayError('This voucher is only valid on the application');
|
||||
}
|
||||
|
||||
|
||||
if (!$discountObj->active)
|
||||
return Tools::displayError('This voucher has already been used or is disabled.');
|
||||
if (!$discountObj->quantity)
|
||||
@ -1086,6 +1086,32 @@ class Cart extends CartCore {
|
||||
'free_ship' => $total_free_ship);
|
||||
}
|
||||
|
||||
public static function getMaxIdOrdered($id_customer) {
|
||||
return Db::getInstance()->getValue('
|
||||
SELECT MAX(c.`id_cart`)
|
||||
FROM '._DB_PREFIX_.'cart c
|
||||
LEFT JOIN '._DB_PREFIX_.'orders o ON (c.`id_cart` = o.`id_cart`)
|
||||
WHERE o.`valid` = 1
|
||||
AND c.`id_customer` = '.(int)$id_customer.'
|
||||
');
|
||||
}
|
||||
|
||||
public static function lastNoneOrderedCart($id_customer)
|
||||
{
|
||||
if (($max_id_cart = self::getMaxIdOrdered($id_customer))) {
|
||||
$id_cart = Db::getInstance()->getValue('
|
||||
SELECT MIN(c.id_cart)
|
||||
FROM '._DB_PREFIX_.'cart c
|
||||
LEFT JOIN '._DB_PREFIX_.'orders o ON (c.`id_cart` = o.`id_cart`)
|
||||
WHERE (o.`valid` = 0 OR o.`valid` IS NULL)
|
||||
AND c.`id_customer` = '.(int)$id_customer.'
|
||||
AND c.`id_cart` > '.(int)$max_id_cart.'
|
||||
');
|
||||
return $id_cart ? $id_cart : false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function printVersion($value, $params)
|
||||
{
|
||||
$versions = array(
|
||||
|
@ -143,6 +143,12 @@ class FrontController extends FrontControllerCore {
|
||||
if (!isset($cart) OR !$cart->id)
|
||||
{
|
||||
$cart = new Cart();
|
||||
if ($cookie->id_customer) {
|
||||
if (($id_cart = Cart::lastNoneOrderedCart($cookie->id_customer))) {
|
||||
$cart = new Cart($id_cart);
|
||||
$cookie->id_cart = $id_cart;
|
||||
}
|
||||
}
|
||||
$cart->id_lang = (int)($cookie->id_lang);
|
||||
$cart->id_currency = (int)($cookie->id_currency);
|
||||
$cart->id_guest = (int)($cookie->id_guest);
|
||||
@ -167,6 +173,10 @@ class FrontController extends FrontControllerCore {
|
||||
$cart->id_address_delivery = 0;
|
||||
$cart->id_address_invoice = 0;
|
||||
}
|
||||
|
||||
if ($cookie->id_customer) {
|
||||
$cart->update();
|
||||
}
|
||||
}
|
||||
|
||||
if (!$cart->nbProducts())
|
||||
|
@ -1,5 +1,74 @@
|
||||
<?php
|
||||
class Order extends OrderCore {
|
||||
|
||||
/** @var boolean True if the order comes from app */
|
||||
public $appli = 0;
|
||||
|
||||
protected $fieldsValidate = array(
|
||||
'id_address_delivery' => 'isUnsignedId',
|
||||
'id_address_invoice' => 'isUnsignedId',
|
||||
'id_cart' => 'isUnsignedId',
|
||||
'id_currency' => 'isUnsignedId',
|
||||
'id_lang' => 'isUnsignedId',
|
||||
'id_customer' => 'isUnsignedId',
|
||||
'id_carrier' => 'isUnsignedId',
|
||||
'secure_key' => 'isMd5',
|
||||
'payment' => 'isGenericName',
|
||||
'recyclable' => 'isBool',
|
||||
'gift' => 'isBool',
|
||||
'gift_message' => 'isMessage',
|
||||
'total_discounts' => 'isPrice',
|
||||
'total_paid' => 'isPrice',
|
||||
'total_paid_real' => 'isPrice',
|
||||
'total_products' => 'isPrice',
|
||||
'total_products_wt' => 'isPrice',
|
||||
'total_shipping' => 'isPrice',
|
||||
'carrier_tax_rate' => 'isFloat',
|
||||
'total_wrapping' => 'isPrice',
|
||||
'shipping_number' => 'isUrl',
|
||||
'conversion_rate' => 'isFloat',
|
||||
'appli' => 'isBool'
|
||||
);
|
||||
|
||||
public function getFields()
|
||||
{
|
||||
ObjectModel::validateFields();
|
||||
|
||||
$fields['id_address_delivery'] = (int)($this->id_address_delivery);
|
||||
$fields['id_address_invoice'] = (int)($this->id_address_invoice);
|
||||
$fields['id_cart'] = (int)($this->id_cart);
|
||||
$fields['id_currency'] = (int)($this->id_currency);
|
||||
$fields['id_lang'] = (int)($this->id_lang);
|
||||
$fields['id_customer'] = (int)($this->id_customer);
|
||||
$fields['id_carrier'] = (int)($this->id_carrier);
|
||||
$fields['secure_key'] = pSQL($this->secure_key);
|
||||
$fields['payment'] = pSQL($this->payment);
|
||||
$fields['module'] = pSQL($this->module);
|
||||
$fields['conversion_rate'] = (float)($this->conversion_rate);
|
||||
$fields['recyclable'] = (int)($this->recyclable);
|
||||
$fields['gift'] = (int)($this->gift);
|
||||
$fields['gift_message'] = pSQL($this->gift_message);
|
||||
$fields['shipping_number'] = pSQL($this->shipping_number);
|
||||
$fields['total_discounts'] = (float)($this->total_discounts);
|
||||
$fields['total_paid'] = (float)($this->total_paid);
|
||||
$fields['total_paid_real'] = (float)($this->total_paid_real);
|
||||
$fields['total_products'] = (float)($this->total_products);
|
||||
$fields['total_products_wt'] = (float)($this->total_products_wt);
|
||||
$fields['total_shipping'] = (float)($this->total_shipping);
|
||||
$fields['carrier_tax_rate'] = (float)($this->carrier_tax_rate);
|
||||
$fields['total_wrapping'] = (float)($this->total_wrapping);
|
||||
$fields['invoice_number'] = (int)($this->invoice_number);
|
||||
$fields['delivery_number'] = (int)($this->delivery_number);
|
||||
$fields['invoice_date'] = pSQL($this->invoice_date);
|
||||
$fields['delivery_date'] = pSQL($this->delivery_date);
|
||||
$fields['valid'] = (int)($this->valid) ? 1 : 0;
|
||||
$fields['appli'] = (int)($this->appli) ? 1 : 0;
|
||||
$fields['date_add'] = pSQL($this->date_add);
|
||||
$fields['date_upd'] = pSQL($this->date_upd);
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
public function printMixedSale($value, $params) {
|
||||
return Db::getInstance()->getValue('
|
||||
SELECT COUNT(DISTINCT `id_sale`)
|
||||
|
@ -8,11 +8,20 @@
|
||||
// Does order already exists ?
|
||||
if (Validate::isLoadedObject($cart) AND $cart->OrderExists() == false)
|
||||
{
|
||||
if ($secure_key !== false AND $secure_key != $cart->secure_key)
|
||||
die(Tools::displayError());
|
||||
/* @Override
|
||||
* do not die and create Order in error state
|
||||
*/
|
||||
// die(Tools::displayError());
|
||||
|
||||
if ($secure_key !== false AND $secure_key != $cart->secure_key) {
|
||||
$id_order_state = Configuration::get('PS_OS_ERROR');
|
||||
$message = "Problème de sercure_key. A valider manuellement" . "\n\n" . $message;
|
||||
Logger::addLog('Invalid secure_key', 4, '0000001', 'Cart', intval($id_cart));
|
||||
}
|
||||
|
||||
// Copying data from cart
|
||||
$order = new Order();
|
||||
$order->appli = Tools::isApi()?1:0;
|
||||
$order->id_carrier = (int)($cart->id_carrier);
|
||||
$order->id_customer = (int)($cart->id_customer);
|
||||
$order->id_address_invoice = (int)($cart->id_address_invoice);
|
||||
|