Compare commits
75 Commits
ticket/r16
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
1d5578d66b | ||
|
922de8200a | ||
|
7699f86acd | ||
|
76b26ac6b4 | ||
|
6b863fe940 | ||
|
34e2bdc553 | ||
|
2207ae3cb8 | ||
|
893da877e8 | ||
|
efbcf6327f | ||
|
5a605ad905 | ||
|
e057c88351 | ||
|
93fe8b597a | ||
|
9803b2424c | ||
|
4691d8bb0f | ||
|
a4625499c0 | ||
|
b5053e443a | ||
|
34c962b75e | ||
|
588fa7e334 | ||
|
03cd386f70 | ||
|
6d0beefa1c | ||
|
2a3e8ebddd | ||
|
eea2e769d1 | ||
|
aca4357353 | ||
|
f2462e6bc3 | ||
|
d6dbc5f479 | ||
|
e54395e5d1 | ||
|
305234f74f | ||
|
1920a84634 | ||
|
37b955667f | ||
|
9115434424 | ||
|
2343304d25 | ||
|
ffe8c187e8 | ||
|
d1d0642f91 | ||
|
2985b1ed4f | ||
|
76eb16036b | ||
|
62139fe9fd | ||
|
ba7f3d2223 | ||
|
887c687dd1 | ||
|
9e386209d7 | ||
|
87387701c3 | ||
|
eed8873dc5 | ||
|
cab5635c8f | ||
|
fc107f5d6d | ||
|
490baf50f4 | ||
|
1d5eb5ec97 | ||
|
c86f90f0eb | ||
|
9edb325f22 | ||
|
0b835a3af5 | ||
|
c658d0ec75 | ||
|
e7551ef018 | ||
|
4a63488b51 | ||
|
2c870b56f4 | ||
|
bec5a21522 | ||
|
d7cce43d8f | ||
|
633c8e77e4 | ||
|
322c019c5c | ||
|
97f8d56b5e | ||
|
d931f7f081 | ||
|
7208390679 | ||
|
9e010d63d6 | ||
|
5a6ff9c962 | ||
|
197f4161d1 | ||
|
d307e50f7f | ||
|
a09de51ac2 | ||
|
2cdfbdb833 | ||
|
cf142b7071 | ||
|
013e705e94 | ||
|
e01ffd309f | ||
|
b0cafcbe70 | ||
|
d7ea10a2bb | ||
|
2c91058ece | ||
|
9cadd3e8af | ||
|
70afb97e26 | ||
|
8b15ef46a6 | ||
|
0b787dd69b |
@ -127,7 +127,7 @@ if (isset($_GET['ajaxDiscountCustomers']))
|
|||||||
$filter = Tools::getValue('filter');
|
$filter = Tools::getValue('filter');
|
||||||
|
|
||||||
$filterWithIdCustomer = false;
|
$filterWithIdCustomer = false;
|
||||||
if (strpos($filter, '_')) {
|
if (strpos($filter, '0_') === 0) {
|
||||||
$filterArray = explode('_', $filter);
|
$filterArray = explode('_', $filter);
|
||||||
$filter = $filterArray[1];
|
$filter = $filterArray[1];
|
||||||
$filterWithIdCustomer = true;
|
$filterWithIdCustomer = true;
|
||||||
|
@ -38,17 +38,21 @@ class AdminCustomerThreads extends AdminTab
|
|||||||
$this->view = true;
|
$this->view = true;
|
||||||
$this->delete = true;
|
$this->delete = true;
|
||||||
|
|
||||||
$this->_select = 'CONCAT(c.firstname," ",c.lastname) as customer, cl.name as contact, l.name as language, group_concat(message) as messages, (
|
$this->_select = '
|
||||||
SELECT IFNULL(CONCAT(LEFT(e.firstname, 1),". ",e.lastname), "--")
|
CONCAT(c.firstname, " ", c.lastname) as customer, cl.name as contact,
|
||||||
FROM '._DB_PREFIX_.'customer_message cm2 INNER JOIN '._DB_PREFIX_.'employee e ON e.id_employee = cm2.id_employee
|
l.name as language, group_concat(message) as messages,
|
||||||
WHERE cm2.id_employee > 0 AND cm2.`id_customer_thread` = a.`id_customer_thread`
|
(SELECT IFNULL(CONCAT(LEFT(e.firstname, 1), ". ", e.lastname), "--")
|
||||||
ORDER BY cm2.date_add DESC LIMIT 1) as employee';
|
FROM '._DB_PREFIX_.'customer_message cm2 INNER JOIN '._DB_PREFIX_.'employee e ON e.id_employee = cm2.id_employee
|
||||||
|
WHERE cm2.id_employee > 0 AND cm2.`id_customer_thread` = a.`id_customer_thread`
|
||||||
|
ORDER BY cm2.date_add DESC LIMIT 1
|
||||||
|
) as employee';
|
||||||
|
|
||||||
$this->_group = 'GROUP BY cm.id_customer_thread';
|
$this->_group = 'GROUP BY cm.id_customer_thread';
|
||||||
$this->_join = '
|
$this->_join = '
|
||||||
LEFT JOIN `'._DB_PREFIX_.'customer` c ON c.`id_customer` = a.`id_customer`
|
LEFT JOIN `'._DB_PREFIX_.'customer` c ON c.`id_customer` = a.`id_customer`
|
||||||
LEFT JOIN `'._DB_PREFIX_.'customer_message` cm ON cm.`id_customer_thread` = a.`id_customer_thread`
|
LEFT JOIN `'._DB_PREFIX_.'customer_message` cm ON cm.`id_customer_thread` = a.`id_customer_thread`
|
||||||
LEFT JOIN `'._DB_PREFIX_.'lang` l ON l.`id_lang` = a.`id_lang`
|
LEFT JOIN `'._DB_PREFIX_.'lang` l ON l.`id_lang` = a.`id_lang`
|
||||||
LEFT JOIN `'._DB_PREFIX_.'contact_lang` cl ON (cl.`id_contact` = a.`id_contact` AND cl.`id_lang` = '.(int)$cookie->id_lang.')';
|
LEFT JOIN `'._DB_PREFIX_.'contact_lang` cl ON (cl.`id_contact` = a.`id_contact` AND cl.`id_lang` = '.(int)$cookie->id_lang.')';
|
||||||
|
|
||||||
$contactArray = array();
|
$contactArray = array();
|
||||||
$contacts = Contact::getContacts($cookie->id_lang);
|
$contacts = Contact::getContacts($cookie->id_lang);
|
||||||
|
@ -381,10 +381,11 @@ class AdminDiscounts extends AdminTab
|
|||||||
function fillCustomersAjax()
|
function fillCustomersAjax()
|
||||||
{
|
{
|
||||||
var filterValue = \''.(($value = (int)($this->getFieldValue($obj, 'id_customer'))) ? '0_'.$value : (($value = (int)($this->getFieldValue($obj, 'id_group'))) ? '1_'.$value : '')).'\';
|
var filterValue = \''.(($value = (int)($this->getFieldValue($obj, 'id_customer'))) ? '0_'.$value : (($value = (int)($this->getFieldValue($obj, 'id_group'))) ? '1_'.$value : '')).'\';
|
||||||
if ($(\'#filter\').val())
|
if ($(\'#filter\').val()) {
|
||||||
filterValue = $(\'#filter\').val();
|
filterValue = $(\'#filter\').val();
|
||||||
|
}
|
||||||
$.getJSON("'.dirname($currentIndex).'/ajax.php",{ajaxDiscountCustomers:1,filter:filterValue},
|
$.ajaxSetup({ cache: false });
|
||||||
|
$.getJSON("'.dirname($currentIndex).'/ajax.php", {ajaxDiscountCustomers:1, filter:filterValue},
|
||||||
function(obj) {
|
function(obj) {
|
||||||
var groups_length = obj.groups.length;
|
var groups_length = obj.groups.length;
|
||||||
if (obj.groups.length == 0)
|
if (obj.groups.length == 0)
|
||||||
|
@ -79,7 +79,16 @@ class AdminImport extends AdminTab
|
|||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->entities = array_flip(array($this->l('Categories'), $this->l('Products'), $this->l('Combinations'), $this->l('Customers'), $this->l('Addresses'), $this->l('Manufacturers'), $this->l('Suppliers')));
|
$this->entities = array_flip(array(
|
||||||
|
$this->l('Categories'),
|
||||||
|
$this->l('Products'),
|
||||||
|
$this->l('Combinations'),
|
||||||
|
$this->l('Customers'),
|
||||||
|
$this->l('Addresses'),
|
||||||
|
$this->l('Manufacturers'),
|
||||||
|
$this->l('Suppliers'),
|
||||||
|
$this->l('Pack'),
|
||||||
|
));
|
||||||
|
|
||||||
switch ((int)(Tools::getValue('entity')))
|
switch ((int)(Tools::getValue('entity')))
|
||||||
{
|
{
|
||||||
@ -280,7 +289,19 @@ class AdminImport extends AdminTab
|
|||||||
'meta_keywords' => array('label' => $this->l('Meta-keywords')),
|
'meta_keywords' => array('label' => $this->l('Meta-keywords')),
|
||||||
'meta_description' => array('label' => $this->l('Meta-description')));
|
'meta_description' => array('label' => $this->l('Meta-description')));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case $this->entities[$this->l('Pack')]:
|
||||||
|
|
||||||
|
self::$required_fields = array('id_product_item', 'qty', 'id');
|
||||||
|
|
||||||
|
$this->available_fields = array(
|
||||||
|
'id_product_item' => array('label' => $this->l('ID Item')),
|
||||||
|
'qty' => array('label' => $this->l('Quantity Item')),
|
||||||
|
'id' => array('label' => $this->l('ID Pack')),
|
||||||
|
);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1292,6 +1313,51 @@ class AdminImport extends AdminTab
|
|||||||
}
|
}
|
||||||
$this->closeCsvFile($handle);
|
$this->closeCsvFile($handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function packImport()
|
||||||
|
{
|
||||||
|
$this->receiveTab();
|
||||||
|
$handle = $this->openCsvFile();
|
||||||
|
self::setLocale();
|
||||||
|
for ($current_line = 0; $line = fgetcsv($handle, MAX_LINE_SIZE, Tools::getValue('separator')); $current_line++)
|
||||||
|
{
|
||||||
|
if (Tools::getValue('convert')) {
|
||||||
|
$line = $this->utf8_encode_array($line);
|
||||||
|
}
|
||||||
|
$info = self::getMaskedRow($line);
|
||||||
|
|
||||||
|
self::setDefaultValues($info);
|
||||||
|
|
||||||
|
// Is product a pack
|
||||||
|
if (array_key_exists('id', $info) && (int)($info['id']) && Pack::isPack((int)($info['id']))) {
|
||||||
|
$pack = new Pack((int)($info['id']));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$pack = new Pack();
|
||||||
|
}
|
||||||
|
|
||||||
|
self::array_walk($info, array('AdminImport', 'fillInfo'), $pack);
|
||||||
|
if (($fieldError = $pack->validateFields(UNFRIENDLY_ERROR, true)) === true && is_numeric($info['qty']))
|
||||||
|
{
|
||||||
|
$res = false;
|
||||||
|
// Is product item in pack
|
||||||
|
if ($pack->isPacked($info['id_product_item'])) {
|
||||||
|
$res = $pack->updateItem($info['id'], $info['id_product_item'], $info['qty']);
|
||||||
|
}
|
||||||
|
// Insert
|
||||||
|
if (!$res) {
|
||||||
|
$res = $pack->addItem($info['id'], $info['id_product_item'], $info['qty']);
|
||||||
|
}
|
||||||
|
if (!$res) {
|
||||||
|
$this->_errors[] = mysql_error().' '.$info['id_product_item'].(isset($info['id']) ? ' (ID '.$info['id'].')' : '').' '.Tools::displayError('Cannot be saved');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$this->_errors[] = ($fieldError !== true ? $fieldError : '').($langFieldError !== true ? $langFieldError : '');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$this->closeCsvFile($handle);
|
||||||
|
}
|
||||||
|
|
||||||
public function display()
|
public function display()
|
||||||
{
|
{
|
||||||
@ -1824,6 +1890,9 @@ class AdminImport extends AdminTab
|
|||||||
case $this->entities[$this->l('Suppliers')]:
|
case $this->entities[$this->l('Suppliers')]:
|
||||||
$this->supplierImport();
|
$this->supplierImport();
|
||||||
break;
|
break;
|
||||||
|
case $this->entities[$this->l('Pack')]:
|
||||||
|
$this->packImport();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
$this->_errors[] = $this->l('no entity selected');
|
$this->_errors[] = $this->l('no entity selected');
|
||||||
}
|
}
|
||||||
|
@ -184,7 +184,7 @@ class OrderCore extends ObjectModel
|
|||||||
/* MySQL does not allow 'order' for a table name */
|
/* MySQL does not allow 'order' for a table name */
|
||||||
protected $table = 'orders';
|
protected $table = 'orders';
|
||||||
protected $identifier = 'id_order';
|
protected $identifier = 'id_order';
|
||||||
protected $_taxCalculationMethod = PS_TAX_EXC;
|
protected $_taxCalculationMethod = PS_TAX_EXC;
|
||||||
|
|
||||||
protected static $_historyCache = array();
|
protected static $_historyCache = array();
|
||||||
|
|
||||||
@ -449,9 +449,9 @@ class OrderCore extends ObjectModel
|
|||||||
if ($row['group_reduction'] > 0)
|
if ($row['group_reduction'] > 0)
|
||||||
{
|
{
|
||||||
if ($this->_taxCalculationMethod == PS_TAX_EXC)
|
if ($this->_taxCalculationMethod == PS_TAX_EXC)
|
||||||
$row['product_price'] = $row['product_price'] * $group_reduction;
|
$row['product_price'] = $row['product_price'] * $group_reduction;
|
||||||
else
|
else
|
||||||
$row['product_price_wt'] = Tools::ps_round($row['product_price_wt'] * $group_reduction , 2);
|
$row['product_price_wt'] = Tools::ps_round($row['product_price_wt'] * $group_reduction , 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($row['reduction_percent'] OR $row['reduction_amount'] OR $row['group_reduction']) AND $this->_taxCalculationMethod == PS_TAX_EXC)
|
if (($row['reduction_percent'] OR $row['reduction_amount'] OR $row['group_reduction']) AND $this->_taxCalculationMethod == PS_TAX_EXC)
|
||||||
@ -526,7 +526,7 @@ class OrderCore extends ObjectModel
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if order contains (only) virtual products
|
* Check if order contains (only) virtual products
|
||||||
*
|
*
|
||||||
* @param boolean $strict If false return true if there are at least one product virtual
|
* @param boolean $strict If false return true if there are at least one product virtual
|
||||||
* @return boolean true if is a virtual order or false
|
* @return boolean true if is a virtual order or false
|
||||||
*
|
*
|
||||||
@ -922,7 +922,7 @@ class OrderCore extends ObjectModel
|
|||||||
// I use mysql 4, I can't make sub query in FROM
|
// I use mysql 4, I can't make sub query in FROM
|
||||||
$number = Order::getLastInvoiceNumber() + 1;
|
$number = Order::getLastInvoiceNumber() + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
$number = '(SELECT `invoice_number`
|
$number = '(SELECT `invoice_number`
|
||||||
FROM (
|
FROM (
|
||||||
SELECT MAX(`invoice_number`) + 1 AS `invoice_number`
|
SELECT MAX(`invoice_number`) + 1 AS `invoice_number`
|
||||||
|
@ -174,18 +174,30 @@ class PackCore extends Product
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an item to the pack
|
* Add an item to the pack
|
||||||
*
|
* @param integer $id_product
|
||||||
* @param integer $id_product
|
* @param integer $id_item
|
||||||
* @param integer $id_item
|
* @param integer $qty
|
||||||
* @param integer $qty
|
* @return boolean true if everything was fine
|
||||||
* @return boolean true if everything was fine
|
*/
|
||||||
*/
|
|
||||||
public static function addItem($id_product, $id_item, $qty)
|
public static function addItem($id_product, $id_item, $qty)
|
||||||
{
|
{
|
||||||
Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'product SET cache_is_pack = 1 WHERE id_product = '.(int)($id_product).' LIMIT 1');
|
Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'product SET cache_is_pack = 1 WHERE id_product = '.(int)($id_product).' LIMIT 1');
|
||||||
return Db::getInstance()->AutoExecute(_DB_PREFIX_.'pack', array('id_product_pack' => (int)($id_product), 'id_product_item' => (int)($id_item), 'quantity' => (int)($qty)), 'INSERT');
|
return Db::getInstance()->AutoExecute(_DB_PREFIX_.'pack', array('id_product_pack' => (int)($id_product), 'id_product_item' => (int)($id_item), 'quantity' => (int)($qty)), 'INSERT');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update item and his pack association
|
||||||
|
* @param integer $id_product
|
||||||
|
* @param integer $id_item
|
||||||
|
* @param integer $qty
|
||||||
|
* @return boolean true if everything was fine
|
||||||
|
*/
|
||||||
|
public static function updateItem($id_product, $id_item, $qty)
|
||||||
|
{
|
||||||
|
return Db::getInstance()->AutoExecute(_DB_PREFIX_.'pack', array('quantity' => (int)($qty)),
|
||||||
|
'UPDATE', 'id_product_pack='.(int)($id_product).' AND id_product_item='.(int)($id_item));
|
||||||
|
}
|
||||||
|
|
||||||
public static function duplicate($id_product_old, $id_product_new)
|
public static function duplicate($id_product_old, $id_product_new)
|
||||||
{
|
{
|
||||||
|
@ -281,26 +281,26 @@ class TaxCore extends ObjectModel
|
|||||||
*/
|
*/
|
||||||
public static function getProductTaxRate($id_product, $id_address = NULL)
|
public static function getProductTaxRate($id_product, $id_address = NULL)
|
||||||
{
|
{
|
||||||
$id_country = (int)Country::getDefaultCountryId();
|
$id_country = (int)Country::getDefaultCountryId();
|
||||||
$id_state = 0;
|
$id_state = 0;
|
||||||
$id_county = 0;
|
$id_county = 0;
|
||||||
$rate = 0;
|
$rate = 0;
|
||||||
if (!empty($id_address))
|
if (!empty($id_address)) {
|
||||||
{
|
$address_infos = Address::getCountryAndState($id_address);
|
||||||
$address_infos = Address::getCountryAndState($id_address);
|
if ($address_infos['id_country']) {
|
||||||
if ($address_infos['id_country'])
|
$id_country = (int)($address_infos['id_country']);
|
||||||
{
|
$id_state = (int)$address_infos['id_state'];
|
||||||
$id_country = (int)($address_infos['id_country']);
|
$id_county = (int)County::getIdCountyByZipCode($address_infos['id_state'], $address_infos['postcode']);
|
||||||
$id_state = (int)$address_infos['id_state'];
|
|
||||||
$id_county = (int)County::getIdCountyByZipCode($address_infos['id_state'], $address_infos['postcode']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($address_infos['vat_number']) AND $address_infos['id_country'] != Configuration::get('VATNUMBER_COUNTRY') AND Configuration::get('VATNUMBER_MANAGEMENT'))
|
if (!empty($address_infos['vat_number']) AND $address_infos['id_country'] != Configuration::get('VATNUMBER_COUNTRY') AND Configuration::get('VATNUMBER_MANAGEMENT')) {
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($rate = Tax::getProductTaxRateViaRules((int)$id_product, (int)$id_country, (int)$id_state, (int)$id_county))
|
if ($rate = Tax::getProductTaxRateViaRules((int)$id_product, (int)$id_country, (int)$id_state, (int)$id_county)) {
|
||||||
return $rate;
|
return $rate;
|
||||||
|
}
|
||||||
|
|
||||||
return $rate;
|
return $rate;
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,9 @@ function __autoload($className)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (function_exists('MathCaptcha\mathcaptchaAutoload') && MathCaptcha\mathcaptchaAutoload($className)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
$className = str_replace(chr(0), '', $className);
|
$className = str_replace(chr(0), '', $className);
|
||||||
$classDir = dirname(__FILE__).'/../classes/';
|
$classDir = dirname(__FILE__).'/../classes/';
|
||||||
@ -42,24 +45,23 @@ function __autoload($className)
|
|||||||
$file_in_classes = file_exists($classDir.$className.'.php');
|
$file_in_classes = file_exists($classDir.$className.'.php');
|
||||||
|
|
||||||
// This is a Core class and its name is the same as its declared name
|
// This is a Core class and its name is the same as its declared name
|
||||||
if (substr($className, -4) == 'Core')
|
if (substr($className, -4) == 'Core') {
|
||||||
require_once($classDir.substr($className, 0, -4).'.php');
|
require_once($classDir.substr($className, 0, -4).'.php');
|
||||||
else
|
}
|
||||||
{
|
else {
|
||||||
if ($file_in_override && $file_in_classes)
|
if ($file_in_override && $file_in_classes) {
|
||||||
{
|
|
||||||
require_once($classDir.str_replace(chr(0), '', $className).'.php');
|
require_once($classDir.str_replace(chr(0), '', $className).'.php');
|
||||||
require_once($overrideDir.$className.'.php');
|
require_once($overrideDir.$className.'.php');
|
||||||
}
|
}
|
||||||
elseif (!$file_in_override && $file_in_classes)
|
elseif (!$file_in_override && $file_in_classes) {
|
||||||
{
|
|
||||||
require_once($classDir.str_replace(chr(0), '', $className).'.php');
|
require_once($classDir.str_replace(chr(0), '', $className).'.php');
|
||||||
$classInfos = new ReflectionClass($className.((interface_exists($className, false) or class_exists($className, false)) ? '' : 'Core'));
|
$classInfos = new ReflectionClass($className.((interface_exists($className, false) or class_exists($className, false)) ? '' : 'Core'));
|
||||||
if (!$classInfos->isInterface() && substr($classInfos->name, -4) == 'Core')
|
if (!$classInfos->isInterface() && substr($classInfos->name, -4) == 'Core')
|
||||||
eval(($classInfos->isAbstract() ? 'abstract ' : '').'class '.$className.' extends '.$className.'Core {}');
|
eval(($classInfos->isAbstract() ? 'abstract ' : '').'class '.$className.' extends '.$className.'Core {}');
|
||||||
}
|
}
|
||||||
elseif ($file_in_override && !$file_in_classes)
|
elseif ($file_in_override && !$file_in_classes) {
|
||||||
require_once($overrideDir.$className.'.php');
|
require_once($overrideDir.$className.'.php');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ class OrderDetailControllerCore extends FrontController
|
|||||||
'messages' => Message::getMessagesByOrderId((int)($order->id)),
|
'messages' => Message::getMessagesByOrderId((int)($order->id)),
|
||||||
'CUSTOMIZE_FILE' => _CUSTOMIZE_FILE_,
|
'CUSTOMIZE_FILE' => _CUSTOMIZE_FILE_,
|
||||||
'CUSTOMIZE_TEXTFIELD' => _CUSTOMIZE_TEXTFIELD_,
|
'CUSTOMIZE_TEXTFIELD' => _CUSTOMIZE_TEXTFIELD_,
|
||||||
'isRecyclable' => Configuration::get('PS_RECYCLABLE_PACK'),
|
'isRecyclable' => Configuration::get('PS_RECYCLABLE_PACK'),
|
||||||
'use_tax' => Configuration::get('PS_TAX'),
|
'use_tax' => Configuration::get('PS_TAX'),
|
||||||
'group_use_tax' => (Group::getPriceDisplayMethod($customer->id_default_group) == PS_TAX_INC),
|
'group_use_tax' => (Group::getPriceDisplayMethod($customer->id_default_group) == PS_TAX_INC),
|
||||||
'customizedDatas' => $customizedDatas));
|
'customizedDatas' => $customizedDatas));
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* 2007-2011 PrestaShop
|
* 2007-2011 PrestaShop
|
||||||
*
|
*
|
||||||
* NOTICE OF LICENSE
|
* NOTICE OF LICENSE
|
||||||
*
|
*
|
||||||
@ -35,71 +35,78 @@ class PasswordControllerCore extends FrontController
|
|||||||
{
|
{
|
||||||
parent::process();
|
parent::process();
|
||||||
|
|
||||||
if (Tools::isSubmit('email'))
|
// Check User Agent - no bot
|
||||||
{
|
$userAgent = $_SERVER['HTTP_USER_AGENT'];
|
||||||
if (!($email = Tools::getValue('email')) OR !Validate::isEmail($email))
|
if (strstr(strtolower($userAgent), 'bot')) {
|
||||||
$this->errors[] = Tools::displayError('Invalid e-mail address');
|
$this->errors[] = Tools::displayError("Who are you ?");
|
||||||
else
|
|
||||||
{
|
|
||||||
$customer = new Customer();
|
|
||||||
$customer->getByemail($email);
|
|
||||||
if (!Validate::isLoadedObject($customer))
|
|
||||||
$this->errors[] = Tools::displayError('There is no account registered to this e-mail address.');
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ((strtotime($customer->last_passwd_gen.'+'.(int)($min_time = Configuration::get('PS_PASSWD_TIME_FRONT')).' minutes') - time()) > 0)
|
|
||||||
$this->errors[] = Tools::displayError('You can regenerate your password only every').' '.(int)($min_time).' '.Tools::displayError('minute(s)');
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (Mail::Send((int)(self::$cookie->id_lang), 'password_query', Mail::l('Password query confirmation'),
|
|
||||||
array('{email}' => $customer->email,
|
|
||||||
'{lastname}' => $customer->lastname,
|
|
||||||
'{firstname}' => $customer->firstname,
|
|
||||||
'{url}' => self::$link->getPageLink('password.php', true).'?token='.$customer->secure_key.'&id_customer='.(int)$customer->id),
|
|
||||||
$customer->email,
|
|
||||||
$customer->firstname.' '.$customer->lastname))
|
|
||||||
self::$smarty->assign(array('confirmation' => 2, 'email' => $customer->email));
|
|
||||||
else
|
|
||||||
$this->errors[] = Tools::displayError('Error occurred when sending the e-mail.');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
elseif (($token = Tools::getValue('token')) && ($id_customer = (int)(Tools::getValue('id_customer'))))
|
|
||||||
{
|
if (empty($this->errors)) {
|
||||||
$email = Db::getInstance()->getValue('SELECT `email` FROM '._DB_PREFIX_.'customer c WHERE c.`secure_key` = \''.pSQL($token).'\' AND c.id_customer = '.(int)$id_customer);
|
if (Tools::isSubmit('email')) {
|
||||||
if ($email)
|
if (!($email = Tools::getValue('email')) OR !Validate::isEmail($email)) {
|
||||||
{
|
$this->errors[] = Tools::displayError('Invalid e-mail address');
|
||||||
$customer = new Customer();
|
}
|
||||||
$customer->getByemail($email);
|
else {
|
||||||
if ((strtotime($customer->last_passwd_gen.'+'.(int)($min_time = Configuration::get('PS_PASSWD_TIME_FRONT')).' minutes') - time()) > 0)
|
$customer = new Customer();
|
||||||
Tools::redirect('authentication.php?error_regen_pwd');
|
$customer->getByemail($email);
|
||||||
else
|
if (!Validate::isLoadedObject($customer)) {
|
||||||
{
|
$this->errors[] = Tools::displayError('There is no account registered to this e-mail address.');
|
||||||
$customer->passwd = Tools::encrypt($password = Tools::passwdGen((int)MIN_PASSWD_LENGTH,'RANDOM'));
|
}
|
||||||
$customer->last_passwd_gen = date('Y-m-d H:i:s', time());
|
else {
|
||||||
if ($customer->update())
|
if ((strtotime($customer->last_passwd_gen.'+'.(int)($min_time = Configuration::get('PS_PASSWD_TIME_FRONT')).' minutes') - time()) > 0) {
|
||||||
{
|
$this->errors[] = Tools::displayError('You can regenerate your password only every').' '.(int)($min_time).' '.Tools::displayError('minute(s)');
|
||||||
if (Mail::Send((int)(self::$cookie->id_lang), 'password', Mail::l('Your password'),
|
}
|
||||||
array('{email}' => $customer->email,
|
else {
|
||||||
'{lastname}' => $customer->lastname,
|
if (Mail::Send((int)(self::$cookie->id_lang), 'password_query', Mail::l('Password query confirmation'),
|
||||||
'{firstname}' => $customer->firstname,
|
array('{email}' => $customer->email,
|
||||||
'{passwd}' => $password),
|
'{lastname}' => $customer->lastname,
|
||||||
$customer->email,
|
'{firstname}' => $customer->firstname,
|
||||||
$customer->firstname.' '.$customer->lastname))
|
'{url}' => self::$link->getPageLink('password.php', true).'?token='.$customer->secure_key.'&id_customer='.(int)$customer->id),
|
||||||
self::$smarty->assign(array('confirmation' => 1, 'email' => $customer->email));
|
$customer->email,
|
||||||
else
|
$customer->firstname.' '.$customer->lastname))
|
||||||
$this->errors[] = Tools::displayError('Error occurred when sending the e-mail.');
|
self::$smarty->assign(array('confirmation' => 2, 'email' => $customer->email));
|
||||||
|
else
|
||||||
|
$this->errors[] = Tools::displayError('Error occurred when sending the e-mail.');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
$this->errors[] = Tools::displayError('An error occurred with your account and your new password cannot be sent to your e-mail. Please report your problem using the contact form.');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
elseif (($token = Tools::getValue('token')) && ($id_customer = (int)(Tools::getValue('id_customer')))) {
|
||||||
|
$email = Db::getInstance()->getValue('SELECT `email` FROM '._DB_PREFIX_.'customer c WHERE c.`secure_key` = \''.pSQL($token).'\' AND c.id_customer = '.(int)$id_customer);
|
||||||
|
if ($email) {
|
||||||
|
$customer = new Customer();
|
||||||
|
$customer->getByemail($email);
|
||||||
|
if ((strtotime($customer->last_passwd_gen.'+'.(int)($min_time = Configuration::get('PS_PASSWD_TIME_FRONT')).' minutes') - time()) > 0) {
|
||||||
|
Tools::redirect('authentication.php?error_regen_pwd');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$customer->passwd = Tools::encrypt($password = Tools::passwdGen((int)MIN_PASSWD_LENGTH,'RANDOM'));
|
||||||
|
$customer->last_passwd_gen = date('Y-m-d H:i:s', time());
|
||||||
|
if ($customer->update())
|
||||||
|
{
|
||||||
|
if (Mail::Send((int)(self::$cookie->id_lang), 'password', Mail::l('Your password'),
|
||||||
|
array('{email}' => $customer->email,
|
||||||
|
'{lastname}' => $customer->lastname,
|
||||||
|
'{firstname}' => $customer->firstname,
|
||||||
|
'{passwd}' => $password),
|
||||||
|
$customer->email,
|
||||||
|
$customer->firstname.' '.$customer->lastname))
|
||||||
|
self::$smarty->assign(array('confirmation' => 1, 'email' => $customer->email));
|
||||||
|
else
|
||||||
|
$this->errors[] = Tools::displayError('Error occurred when sending the e-mail.');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$this->errors[] = Tools::displayError('An error occurred with your account and your new password cannot be sent to your e-mail. Please report your problem using the contact form.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$this->errors[] = Tools::displayError('We cannot regenerate your password with the data you submitted');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif (($token = Tools::getValue('token')) || ($id_customer = Tools::getValue('id_customer'))) {
|
||||||
$this->errors[] = Tools::displayError('We cannot regenerate your password with the data you submitted');
|
$this->errors[] = Tools::displayError('We cannot regenerate your password with the data you submitted');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
elseif (($token = Tools::getValue('token')) || ($id_customer = Tools::getValue('id_customer')))
|
|
||||||
$this->errors[] = Tools::displayError('We cannot regenerate your password with the data you submitted');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function displayContent()
|
public function displayContent()
|
||||||
|
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}
|
@ -40,7 +40,7 @@
|
|||||||
<br /><br /><br />
|
<br /><br /><br />
|
||||||
El depósito del paquete debe hacerse en uno de los 4 500 Puntos de Recogida® de España.
|
El depósito del paquete debe hacerse en uno de los 4 500 Puntos de Recogida® de España.
|
||||||
<br />
|
<br />
|
||||||
Encuentre la lista de puntos de recogida cerca de su casa haciendo <a href="http://www.puntopack.es/buscar-el-punto-pack-más-cercano/" target="_blank" style="color: #5082f5; text-decoration: none;">click aquí</a>
|
Encuentre la lista de puntos de recogida cerca de su casa haciendo <a href="https://www.puntopack.es/buscar-el-punto-pack-mas-cercano/" target="_blank" style="color: #5082f5; text-decoration: none;">click aquí</a>
|
||||||
<br />
|
<br />
|
||||||
El comerciante le entregará un comprobante que deberá conservar para justificar el depósito en caso de ser necesario.
|
El comerciante le entregará un comprobante que deberá conservar para justificar el depósito en caso de ser necesario.
|
||||||
</td>
|
</td>
|
||||||
|
@ -24,7 +24,7 @@ Pegue la etiqueta proporcionada por Mondial Relay en una de las caras visibles d
|
|||||||
El depósito del paquete debe hacerse en uno de los 4 500 Puntos de Recogida de España.
|
El depósito del paquete debe hacerse en uno de los 4 500 Puntos de Recogida de España.
|
||||||
Encuentre la lista de puntos de recogida cerca de su casa haciendo click aquí:
|
Encuentre la lista de puntos de recogida cerca de su casa haciendo click aquí:
|
||||||
|
|
||||||
http://www.puntopack.es/buscar-el-punto-pack-más-cercano/
|
https://www.puntopack.es/buscar-el-punto-pack-mas-cercano/
|
||||||
|
|
||||||
El comerciante le entregará un comprobante que deberá conservar para justificar el depósito
|
El comerciante le entregará un comprobante que deberá conservar para justificar el depósito
|
||||||
en caso de ser necesario.
|
en caso de ser necesario.
|
||||||
|
@ -18,7 +18,8 @@
|
|||||||
<tr><td> </td></tr>
|
<tr><td> </td></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left">
|
<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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr><td> </td></tr>
|
<tr><td> </td></tr>
|
||||||
@ -30,7 +31,7 @@
|
|||||||
<tr><td> </td></tr>
|
<tr><td> </td></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left">
|
<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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr><td> </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}
|
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 !
|
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}
|
@ -24,7 +24,7 @@
|
|||||||
Nous vous informons que vous avez dans votre compte un crédit de fidélité non utilisé suite à votre commande {commandenum}.
|
Nous vous informons que vous avez dans votre compte un crédit de fidélité non utilisé suite à votre commande {commandenum}.
|
||||||
Celui-ci expire dans 1 mois.
|
Celui-ci expire dans 1 mois.
|
||||||
|
|
||||||
Venez nous rendre visite sur le site : https://wwww.bebeboutik.com et profiter de nos offres jusqu'à -70% !
|
Venez nous rendre visite sur le site : https://www.bebeboutik.com et profiter de nos offres jusqu'à -70% !
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -3,6 +3,6 @@ Bonjour {firstname} {lastname},
|
|||||||
Nous vous informons que vous avez dans votre compte un crédit de fidélité non utilisé suite à votre commande {commandenum}.
|
Nous vous informons que vous avez dans votre compte un crédit de fidélité non utilisé suite à votre commande {commandenum}.
|
||||||
Celui-ci expire dans 1 mois.
|
Celui-ci expire dans 1 mois.
|
||||||
|
|
||||||
Venez nous rendre visite sur le site : https://wwww.bebeboutik.com et profiter de nos offres jusqu'à -70% !
|
Venez nous rendre visite sur le site : https://www.bebeboutik.com et profiter de nos offres jusqu'à -70% !
|
||||||
|
|
||||||
L'équipe Bébé Boutik,
|
L'équipe Bébé Boutik,
|
@ -1,9 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
if(!defined('_PS_VERSION_')) {
|
if (!defined('_PS_VERSION_')) {
|
||||||
exit;
|
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
|
class AdminAntDropshippingtracking extends AdminTab
|
||||||
{
|
{
|
||||||
@ -20,10 +21,13 @@ class AdminAntDropshippingtracking extends AdminTab
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function _postProcess() {
|
public function _postProcess()
|
||||||
if(Tools::isSubmit('submitOrderTracking') && Tools::getValue('id_sale')){
|
{
|
||||||
|
$this->_html = '';
|
||||||
|
|
||||||
|
if ($id_sale = Tools::getValue('id_sale')) {
|
||||||
|
// Selection des produits de la vente
|
||||||
$errors = 0;
|
$errors = 0;
|
||||||
$id_sale = (int)Tools::getValue('id_sale');
|
|
||||||
$sale_names = array();
|
$sale_names = array();
|
||||||
foreach(Db::getInstance()->ExecuteS('
|
foreach(Db::getInstance()->ExecuteS('
|
||||||
SELECT c.`name`, c.`id_lang`
|
SELECT c.`name`, c.`id_lang`
|
||||||
@ -41,41 +45,114 @@ class AdminAntDropshippingtracking extends AdminTab
|
|||||||
') as $key => $row) {
|
') as $key => $row) {
|
||||||
$sale_products[(int)$row['id_product']] = (int)$row['id_product'];
|
$sale_products[(int)$row['id_product']] = (int)$row['id_product'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_FILES['csvfile']) && $_FILES['csvfile']['name'] != '') {
|
$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();
|
||||||
|
if (isset($_FILES['csvfile']) && $_FILES['csvfile']['name'] != '') {
|
||||||
|
$cols = array(
|
||||||
|
'id_order',
|
||||||
|
'tracking_number',
|
||||||
|
'carrier',
|
||||||
|
'link',
|
||||||
|
);
|
||||||
|
$i = 0;
|
||||||
$f = fopen($_FILES['csvfile']['tmp_name'], 'r');
|
$f = fopen($_FILES['csvfile']['tmp_name'], 'r');
|
||||||
fgetcsv($f, 0, ';');
|
while ($data = fgetcsv($f, 0, ';')) {
|
||||||
$i = 1;
|
|
||||||
|
|
||||||
$orders = array();
|
|
||||||
while($line = fgetcsv($f, 0, ';')) {
|
|
||||||
$i++;
|
$i++;
|
||||||
$orders[(int) $line[0]] = array(
|
if ($i == 1) {
|
||||||
'id_order' => (int) $line[0],
|
continue;
|
||||||
'tracking_number' => trim($line[1]),
|
}
|
||||||
'carrier' => $line[2],
|
|
||||||
'link' => trim($line[3]),
|
// 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)) {
|
}
|
||||||
foreach ($orders as $id_order => $o) {
|
else {
|
||||||
if($id_order != 0){
|
$this->_html .= HelperFormBootstrap::displayErrors($this->l('Fichier manquant !'));
|
||||||
$order = new Order((int)$id_order);
|
}
|
||||||
if(Validate::isLoadedObject($order)) {
|
|
||||||
$order_details = array();
|
// Traitement des commandes
|
||||||
foreach(Db::getInstance()->ExecuteS('
|
if (count($orders) > 0) {
|
||||||
SELECT DISTINCT `id_order_detail`, `product_name`,`product_id`, `product_attribute_id`, `product_quantity` - GREATEST(`product_quantity_return`, `product_quantity_refunded`) AS `quantity`
|
foreach ($orders as $id_order => $o) {
|
||||||
FROM `'._DB_PREFIX_.'order_detail`
|
if ($id_order != 0) {
|
||||||
WHERE `id_order` = '.(int) $id_order.'
|
$order = new Order((int)$id_order);
|
||||||
') as $key => $row) {
|
if (Validate::isLoadedObject($order)) {
|
||||||
$order_details[(int)$row['id_order_detail']] = $row;
|
$order_details = array();
|
||||||
}
|
foreach (Db::getInstance()->ExecuteS('
|
||||||
|
SELECT DISTINCT `id_order_detail`, `product_name`,`product_id`, `product_attribute_id`, `product_quantity` - GREATEST(`product_quantity_return`, `product_quantity_refunded`) AS `quantity`
|
||||||
$fully_sent = false;
|
FROM `'._DB_PREFIX_.'order_detail`
|
||||||
$products_sent = array();
|
WHERE `id_order` = '.(int) $id_order.'
|
||||||
|
') as $key => $row) {
|
||||||
foreach(Db::getInstance()->ExecuteS('
|
$order_details[(int)$row['id_order_detail']] = $row;
|
||||||
|
}
|
||||||
|
|
||||||
|
$fully_sent = false;
|
||||||
|
|
||||||
|
// Calcul des produits déjà envoyés par LaPoste
|
||||||
|
$products_sent = array();
|
||||||
|
foreach (Db::getInstance()->ExecuteS('
|
||||||
SELECT d.`id_order_detail`, IF(
|
SELECT d.`id_order_detail`, IF(
|
||||||
(d.`product_quantity` - IF(
|
(d.`product_quantity` - IF(
|
||||||
d.`product_quantity_return` > 0, d.`product_quantity_return`, d.`product_quantity_refunded`
|
d.`product_quantity_return` > 0, d.`product_quantity_return`, d.`product_quantity_refunded`
|
||||||
@ -87,12 +164,13 @@ class AdminAntDropshippingtracking extends AdminTab
|
|||||||
WHERE d.`id_order` = '.(int) $order->id.'
|
WHERE d.`id_order` = '.(int) $order->id.'
|
||||||
GROUP BY d.`id_order_detail`
|
GROUP BY d.`id_order_detail`
|
||||||
') as $quantity_remain) {
|
') as $quantity_remain) {
|
||||||
if((int) $quantity_remain['remain'] == 0) {
|
if ((int) $quantity_remain['remain'] == 0) {
|
||||||
$products_sent[] = (int) $quantity_remain['id_order_detail'];
|
$products_sent[] = (int) $quantity_remain['id_order_detail'];
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
foreach(Db::getInstance()->ExecuteS('
|
|
||||||
|
// Calcul des produits déjà envoyé Exapaq
|
||||||
|
foreach (Db::getInstance()->ExecuteS('
|
||||||
SELECT d.`id_order_detail`, IF(
|
SELECT d.`id_order_detail`, IF(
|
||||||
(d.`product_quantity` - IF(
|
(d.`product_quantity` - IF(
|
||||||
d.`product_quantity_return` > 0, d.`product_quantity_return`, d.`product_quantity_refunded`
|
d.`product_quantity_return` > 0, d.`product_quantity_return`, d.`product_quantity_refunded`
|
||||||
@ -104,12 +182,13 @@ class AdminAntDropshippingtracking extends AdminTab
|
|||||||
WHERE d.`id_order` = '.(int) $order->id.'
|
WHERE d.`id_order` = '.(int) $order->id.'
|
||||||
GROUP BY d.`id_order_detail`
|
GROUP BY d.`id_order_detail`
|
||||||
') as $quantity_remain) {
|
') as $quantity_remain) {
|
||||||
if((int) $quantity_remain['remain'] == 0) {
|
if ((int) $quantity_remain['remain'] == 0) {
|
||||||
$products_sent[] = (int) $quantity_remain['id_order_detail'];
|
$products_sent[] = (int) $quantity_remain['id_order_detail'];
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
foreach(Db::getInstance()->ExecuteS('
|
|
||||||
|
// Calcul des produits déjà envoyé MondialRelay
|
||||||
|
foreach (Db::getInstance()->ExecuteS('
|
||||||
SELECT d.`id_order_detail`, IF(
|
SELECT d.`id_order_detail`, IF(
|
||||||
(d.`product_quantity` - IF(
|
(d.`product_quantity` - IF(
|
||||||
d.`product_quantity_return` > 0, d.`product_quantity_return`, d.`product_quantity_refunded`
|
d.`product_quantity_return` > 0, d.`product_quantity_return`, d.`product_quantity_refunded`
|
||||||
@ -121,12 +200,13 @@ class AdminAntDropshippingtracking extends AdminTab
|
|||||||
WHERE d.`id_order` = '.(int) $order->id.'
|
WHERE d.`id_order` = '.(int) $order->id.'
|
||||||
GROUP BY d.`id_order_detail`
|
GROUP BY d.`id_order_detail`
|
||||||
') as $quantity_remain) {
|
') as $quantity_remain) {
|
||||||
if((int) $quantity_remain['remain'] == 0) {
|
if ((int) $quantity_remain['remain'] == 0) {
|
||||||
$products_sent[] = (int) $quantity_remain['id_order_detail'];
|
$products_sent[] = (int) $quantity_remain['id_order_detail'];
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
foreach(Db::getInstance()->ExecuteS('
|
|
||||||
|
// Calcul des produits déjà envoyé Philea
|
||||||
|
foreach (Db::getInstance()->ExecuteS('
|
||||||
SELECT d.`id_order_detail`, IF(
|
SELECT d.`id_order_detail`, IF(
|
||||||
(d.`product_quantity` - IF(
|
(d.`product_quantity` - IF(
|
||||||
d.`product_quantity_return` > 0, d.`product_quantity_return`, d.`product_quantity_refunded`
|
d.`product_quantity_return` > 0, d.`product_quantity_return`, d.`product_quantity_refunded`
|
||||||
@ -138,12 +218,13 @@ class AdminAntDropshippingtracking extends AdminTab
|
|||||||
WHERE d.`id_order` = '.(int) $order->id.'
|
WHERE d.`id_order` = '.(int) $order->id.'
|
||||||
GROUP BY d.`id_order_detail`
|
GROUP BY d.`id_order_detail`
|
||||||
') as $quantity_remain) {
|
') as $quantity_remain) {
|
||||||
if((int) $quantity_remain['remain'] == 0) {
|
if ((int) $quantity_remain['remain'] == 0) {
|
||||||
$products_sent[] = (int) $quantity_remain['id_order_detail'];
|
$products_sent[] = (int) $quantity_remain['id_order_detail'];
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
foreach(Db::getInstance()->ExecuteS('
|
|
||||||
|
// Calcul des produits déjà envoyé Dropshipping
|
||||||
|
foreach (Db::getInstance()->ExecuteS('
|
||||||
SELECT d.`id_order_detail`, IF(
|
SELECT d.`id_order_detail`, IF(
|
||||||
(d.`product_quantity` - IF(
|
(d.`product_quantity` - IF(
|
||||||
d.`product_quantity_return` > 0, d.`product_quantity_return`, d.`product_quantity_refunded`
|
d.`product_quantity_return` > 0, d.`product_quantity_return`, d.`product_quantity_refunded`
|
||||||
@ -155,17 +236,21 @@ class AdminAntDropshippingtracking extends AdminTab
|
|||||||
WHERE d.`id_order` = '.(int) $order->id.'
|
WHERE d.`id_order` = '.(int) $order->id.'
|
||||||
GROUP BY d.`id_order_detail`
|
GROUP BY d.`id_order_detail`
|
||||||
') as $quantity_remain) {
|
') as $quantity_remain) {
|
||||||
if((int) $quantity_remain['remain'] == 0) {
|
if ((int) $quantity_remain['remain'] == 0) {
|
||||||
$products_sent[] = (int) $quantity_remain['id_order_detail'];
|
$products_sent[] = (int) $quantity_remain['id_order_detail'];
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$remaining = array();
|
}
|
||||||
$html_products_sent = '';
|
|
||||||
foreach($order_details as $id_order_detail => $d) {
|
$remaining = array();
|
||||||
if(!in_array($id_order_detail, $products_sent) && !in_array($d['product_id'],$sale_products)) {
|
foreach($order_details as $id_order_detail => $d) {
|
||||||
$remaining[] = (int)$id_order_detail;
|
// Calcul des produits restant
|
||||||
} elseif(!in_array($id_order_detail, $products_sent) && in_array((int)$d['product_id'],$sale_products)) {
|
if (!in_array($id_order_detail, $products_sent) && !in_array($d['product_id'], $sale_products)) {
|
||||||
$html_products_sent .= '<br />'."\r\n".$d['quantity'] . 'x' . ' ' . $p['product_name'];
|
$remaining[] = (int)$id_order_detail;
|
||||||
|
}
|
||||||
|
// Marquage envoi
|
||||||
|
elseif (!in_array($id_order_detail, $products_sent) && in_array((int)$d['product_id'],$sale_products)) {
|
||||||
|
|
||||||
|
if ($infosTrackingEnable == 1) {
|
||||||
Db::getInstance()->ExecuteS('
|
Db::getInstance()->ExecuteS('
|
||||||
INSERT INTO `'._DB_PREFIX_.'ant_dropshipping_parcel`
|
INSERT INTO `'._DB_PREFIX_.'ant_dropshipping_parcel`
|
||||||
VALUES (
|
VALUES (
|
||||||
@ -178,14 +263,51 @@ 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) {
|
|
||||||
$fully_sent = true;
|
if (count($remaining) == 0) {
|
||||||
} else {
|
$fully_sent = true;
|
||||||
$fully_sent = false;
|
} else {
|
||||||
}
|
$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);
|
$customer = new Customer((int) $order->id_customer);
|
||||||
$templateVars = array(
|
$templateVars = array(
|
||||||
'{followup}' => $o['link'],
|
'{followup}' => $o['link'],
|
||||||
@ -195,59 +317,59 @@ class AdminAntDropshippingtracking extends AdminTab
|
|||||||
'{firstname}' => $customer->firstname,
|
'{firstname}' => $customer->firstname,
|
||||||
'{lastname}' => $customer->lastname,
|
'{lastname}' => $customer->lastname,
|
||||||
'{id_order}' => (int) $order->id,
|
'{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',
|
||||||
$history = new OrderHistory();
|
((is_array($_LANGMAIL) && key_exists($subject, $_LANGMAIL)) ? $_LANGMAIL[$subject] : $subject),
|
||||||
$history->id_order = (int) $order->id;
|
$templateVars, $customer->email, $customer->firstname.' '.$customer->lastname)) {
|
||||||
$history->changeIdOrderState(($fully_sent? Configuration::get('PS_OS_SHIPPING'): 17), (int) $order->id);
|
$errors++;
|
||||||
$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;
|
|
||||||
$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)){
|
|
||||||
$errors++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Send Mail without tracking info
|
||||||
|
if ($infosTrackingDisable == 1) {
|
||||||
|
$subject = 'Package in transit';
|
||||||
|
$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'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!isset($_COOKIE['logistics_sales'])){
|
|
||||||
setcookie('logistics_sales', $id_sale, 0, __PS_BASE_URI__);
|
|
||||||
} else {
|
|
||||||
$sales = explode('-', $_COOKIE['logistics_sales']);
|
|
||||||
if(!in_array($id_sale,$sales)){
|
|
||||||
$sales[] = $id_sale;
|
|
||||||
}
|
|
||||||
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 {
|
|
||||||
$this->_html .= HelperFormBootstrap::displayErrors($this->l('Aucune commande trouvée, vérifier votre fichier'));
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
$this->_html .= HelperFormBootstrap::displayErrors($this->l('Fichier manquant !'));
|
// Cookie
|
||||||
|
if (!isset($_COOKIE['logistics_sales'])){
|
||||||
|
setcookie('logistics_sales', $id_sale, 0, __PS_BASE_URI__);
|
||||||
|
} else {
|
||||||
|
$sales = explode('-', $_COOKIE['logistics_sales']);
|
||||||
|
if(!in_array($id_sale,$sales)){
|
||||||
|
$sales[] = $id_sale;
|
||||||
|
}
|
||||||
|
setcookie('logistics_sales', implode('-', $sales), 0, __PS_BASE_URI__);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$this->_html .= HelperFormBootstrap::displayErrors($this->l('Aucune commande trouvée, vérifier votre fichier'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function display() {
|
public function display()
|
||||||
|
{
|
||||||
global $cookie, $currentIndex;
|
global $cookie, $currentIndex;
|
||||||
$base_link = $currentIndex . '&token='.Tools::getAdminTokenLite('AdminAntDropshippingtracking');
|
$base_link = $currentIndex . '&token='.Tools::getAdminTokenLite('AdminAntDropshippingtracking');
|
||||||
|
|
||||||
@ -287,10 +409,12 @@ class AdminAntDropshippingtracking extends AdminTab
|
|||||||
</div>
|
</div>
|
||||||
<div class="panel-content">
|
<div class="panel-content">
|
||||||
<form action="'.Tools::safeOutput($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
|
<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>
|
$help = '<br>
|
||||||
<p class="help-block">'.$this->l('Format: id_order;tracking_number;carrier;tracking_link').'</p>
|
<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('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(
|
$input = array(
|
||||||
'label' => $this->l('Sale: '),
|
'label' => $this->l('Sale: '),
|
||||||
@ -313,13 +437,15 @@ class AdminAntDropshippingtracking extends AdminTab
|
|||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
<div class="ln_solid"></div>
|
<div class="ln_solid"></div>
|
||||||
<div class="form-group text-right">
|
<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>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>';
|
</div>
|
||||||
|
';
|
||||||
|
|
||||||
$this->_html .= $helperForm->renderScript();
|
$this->_html .= $helperForm->renderScript();
|
||||||
|
|
||||||
|
16
modules/ant_support_form/captcha.php
Normal file
16
modules/ant_support_form/captcha.php
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
require_once dirname(__FILE__).'/../../config/config.inc.php';
|
||||||
|
require_once dirname(__FILE__).'/../../init.php';
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
$mathCaptcha = new MathCaptcha\MathCaptcha();
|
||||||
|
|
||||||
|
try {
|
||||||
|
$mathCaptcha->generate();
|
||||||
|
$mathCaptcha->output();
|
||||||
|
}
|
||||||
|
catch ( MathCaptcha\MathCaptchaException $e ) {
|
||||||
|
// Here you normally log the error, and you can output an error image
|
||||||
|
// to notify the user that something went wrong, if you want.
|
||||||
|
}
|
@ -1,7 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
require_once(dirname(__FILE__).'/../../config/config.inc.php');
|
require_once dirname(__FILE__).'/../../config/config.inc.php';
|
||||||
require_once(dirname(__FILE__).'/../../init.php');
|
require_once dirname(__FILE__).'/../../init.php';
|
||||||
require_once(dirname(__FILE__).'/Reason.php');
|
require_once dirname(__FILE__).'/Reason.php';
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
|
||||||
$controller->preProcess();
|
$controller->preProcess();
|
||||||
|
|
||||||
$langs = Language::getLanguages();
|
$langs = Language::getLanguages();
|
||||||
@ -52,12 +55,18 @@ if (Tools::isSubmit('submitMessage')) {
|
|||||||
$fileAttachment['mime'] = $_FILES['fileUpload']['type'];
|
$fileAttachment['mime'] = $_FILES['fileUpload']['type'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$mathCaptcha = new MathCaptcha\MathCaptcha();
|
||||||
|
$captcha_ans = Tools::getValue('cans');
|
||||||
$message = Tools::htmlentitiesUTF8(Tools::getValue('message'));
|
$message = Tools::htmlentitiesUTF8(Tools::getValue('message'));
|
||||||
|
|
||||||
if (Tools::getValue('email2') != '') {
|
if (Tools::getValue('email2') != '') {
|
||||||
$this->errors[] = Tools::displayError('Invalid');
|
$errors[] = Tools::displayError('Invalid');
|
||||||
|
}
|
||||||
|
elseif ($mathCaptcha->check($captcha_ans) !== true) {
|
||||||
|
$errors[] = Tools::displayError('For security reasons, thank you to solve the addition to validate the sending of your message');
|
||||||
}
|
}
|
||||||
elseif (preg_match("/\p{Han}+/u", $message)) {
|
elseif (preg_match("/\p{Han}+/u", $message)) {
|
||||||
$this->errors[] = Tools::displayError('Invalid message');
|
$errors[] = Tools::displayError('Invalid message');
|
||||||
}
|
}
|
||||||
elseif (!($from = trim(Tools::getValue('from'))) OR !Validate::isEmail($from)) {
|
elseif (!($from = trim(Tools::getValue('from'))) OR !Validate::isEmail($from)) {
|
||||||
$errors[] = Tools::displayError('Invalid e-mail address');
|
$errors[] = Tools::displayError('Invalid e-mail address');
|
||||||
@ -173,9 +182,15 @@ if (Tools::isSubmit('submitMessage')) {
|
|||||||
|
|
||||||
if ($contact->customer_service)
|
if ($contact->customer_service)
|
||||||
{
|
{
|
||||||
|
$ctStatusLast = false;
|
||||||
|
|
||||||
if ((int)$id_customer_thread)
|
if ((int)$id_customer_thread)
|
||||||
{
|
{
|
||||||
$ct = new CustomerThread($id_customer_thread);
|
$ct = new CustomerThread($id_customer_thread);
|
||||||
|
|
||||||
|
$ctStatusLast = $ct->status;
|
||||||
|
$ctStatusDate = $ct->date_upd;
|
||||||
|
|
||||||
$ct->status = 'open';
|
$ct->status = 'open';
|
||||||
$ct->id_lang = (int)$cookie->id_lang;
|
$ct->id_lang = (int)$cookie->id_lang;
|
||||||
$ct->id_contact = (int)($id_contact);
|
$ct->id_contact = (int)($id_contact);
|
||||||
@ -213,6 +228,12 @@ if (Tools::isSubmit('submitMessage')) {
|
|||||||
|
|
||||||
if ($ct->id)
|
if ($ct->id)
|
||||||
{
|
{
|
||||||
|
// Update date_upd to the last interesting date
|
||||||
|
if ($ctStatusLast !== false && $ctStatusLast == 'open') {
|
||||||
|
$sql = 'UPDATE `'._DB_PREFIX_.'customer_thread` SET `date_upd` = "'.$ctStatusDate.'" WHERE id_customer_thread='. $ct->id;
|
||||||
|
Db::getInstance()->Execute($sql);
|
||||||
|
}
|
||||||
|
|
||||||
// adding (antadis) - linking reason and customer_thread
|
// adding (antadis) - linking reason and customer_thread
|
||||||
if (Tools::getValue('id_reason')) {
|
if (Tools::getValue('id_reason')) {
|
||||||
$id_reason = (int) Tools::getValue('id_reason');
|
$id_reason = (int) Tools::getValue('id_reason');
|
||||||
|
@ -176,10 +176,13 @@
|
|||||||
<label for="message">{l s='Message' mod='ant_support_form'}</label>
|
<label for="message">{l s='Message' mod='ant_support_form'}</label>
|
||||||
<textarea id="message" name="message">{if isset($message)}{$message|escape:'htmlall':'UTF-8'|stripslashes}{/if}</textarea>
|
<textarea id="message" name="message">{if isset($message)}{$message|escape:'htmlall':'UTF-8'|stripslashes}{/if}</textarea>
|
||||||
</p>
|
</p>
|
||||||
|
<p>
|
||||||
|
<img src="{$base_dir_ssl}c.png" alt="" style="vertical-align:middle;">
|
||||||
|
<input type="text" name="cans" style="width:40px;padding:0;">
|
||||||
|
</p>
|
||||||
<p class="submit">
|
<p class="submit">
|
||||||
<input type="submit" name="submitMessage" id="submitMessage" value="{l s='Send' mod='ant_support_form'}" class="button_large" onclick="$(this).hide();" />
|
<input type="submit" name="submitMessage" id="submitMessage" value="{l s='Send' mod='ant_support_form'}" class="button_large" onclick="$(this).hide();" />
|
||||||
</p>
|
</p>
|
||||||
</div>
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
Binary file not shown.
@ -1 +0,0 @@
|
|||||||
default
|
|
2
modules/blockauth/.hg/cache/branchheads
vendored
2
modules/blockauth/.hg/cache/branchheads
vendored
@ -1,2 +0,0 @@
|
|||||||
22140c622301271e8694549e29e360916921e485 0
|
|
||||||
22140c622301271e8694549e29e360916921e485 default
|
|
2
modules/blockauth/.hg/cache/tags
vendored
2
modules/blockauth/.hg/cache/tags
vendored
@ -1,2 +0,0 @@
|
|||||||
0 22140c622301271e8694549e29e360916921e485
|
|
||||||
|
|
Binary file not shown.
@ -1,2 +0,0 @@
|
|||||||
[paths]
|
|
||||||
default = ssh://ewen@localhost//hg/blockauth
|
|
@ -1,4 +0,0 @@
|
|||||||
revlogv1
|
|
||||||
fncache
|
|
||||||
store
|
|
||||||
dotencode
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,5 +0,0 @@
|
|||||||
data/logo.gif.i
|
|
||||||
data/config.xml.i
|
|
||||||
data/fr.php.i
|
|
||||||
data/blockauth.php.i
|
|
||||||
data/blockauth.tpl.i
|
|
Binary file not shown.
@ -1 +0,0 @@
|
|||||||
default
|
|
@ -1,3 +0,0 @@
|
|||||||
0
|
|
||||||
pull
|
|
||||||
ssh://ewen@localhost//hg/blockauth
|
|
Binary file not shown.
@ -1 +0,0 @@
|
|||||||
default
|
|
2
modules/blockcartex/.hg/cache/branchheads
vendored
2
modules/blockcartex/.hg/cache/branchheads
vendored
@ -1,2 +0,0 @@
|
|||||||
55a547b9200e199cbe52370d3ee590a2a8237c03 2
|
|
||||||
55a547b9200e199cbe52370d3ee590a2a8237c03 default
|
|
2
modules/blockcartex/.hg/cache/tags
vendored
2
modules/blockcartex/.hg/cache/tags
vendored
@ -1,2 +0,0 @@
|
|||||||
2 55a547b9200e199cbe52370d3ee590a2a8237c03
|
|
||||||
|
|
Binary file not shown.
@ -1,2 +0,0 @@
|
|||||||
[paths]
|
|
||||||
default = ssh://ewen@localhost//hg/blockcartex
|
|
@ -1,4 +0,0 @@
|
|||||||
revlogv1
|
|
||||||
fncache
|
|
||||||
store
|
|
||||||
dotencode
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,16 +0,0 @@
|
|||||||
data/img/index.php.i
|
|
||||||
data/index.php.i
|
|
||||||
data/config.xml.i
|
|
||||||
data/img/icon/delete.gif.i
|
|
||||||
data/img/icon/index.php.i
|
|
||||||
data/img/icon/basket_go.png.i
|
|
||||||
data/blockcart-ajax.php.i
|
|
||||||
data/img/icon/checkout.png.i
|
|
||||||
data/blockcart-set-collapse.php.i
|
|
||||||
data/blockcartex.php.i
|
|
||||||
data/fr.php.i
|
|
||||||
data/logo.gif.i
|
|
||||||
data/ajax-cart.js.i
|
|
||||||
data/blockcart.tpl.i
|
|
||||||
data/img/icon/basket.png.i
|
|
||||||
data/blockcart-json.tpl.i
|
|
Binary file not shown.
@ -1 +0,0 @@
|
|||||||
default
|
|
@ -1,3 +0,0 @@
|
|||||||
0
|
|
||||||
pull
|
|
||||||
ssh://ewen@localhost//hg/blockcartex
|
|
Binary file not shown.
@ -1 +0,0 @@
|
|||||||
default
|
|
2
modules/blocklogo/.hg/cache/branchheads
vendored
2
modules/blocklogo/.hg/cache/branchheads
vendored
@ -1,2 +0,0 @@
|
|||||||
a0b6701fd7c40b9759a83fc8e78566aa84a678e2 0
|
|
||||||
a0b6701fd7c40b9759a83fc8e78566aa84a678e2 default
|
|
2
modules/blocklogo/.hg/cache/tags
vendored
2
modules/blocklogo/.hg/cache/tags
vendored
@ -1,2 +0,0 @@
|
|||||||
0 a0b6701fd7c40b9759a83fc8e78566aa84a678e2
|
|
||||||
|
|
Binary file not shown.
@ -1,2 +0,0 @@
|
|||||||
[paths]
|
|
||||||
default = ssh://ewen@localhost//hg/blocklogo
|
|
@ -1,4 +0,0 @@
|
|||||||
revlogv1
|
|
||||||
fncache
|
|
||||||
store
|
|
||||||
dotencode
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,7 +0,0 @@
|
|||||||
data/index.php.i
|
|
||||||
data/config.xml.i
|
|
||||||
data/logo.gif.i
|
|
||||||
data/en.php.i
|
|
||||||
data/blocklogo.php.i
|
|
||||||
data/blocklogo.tpl.i
|
|
||||||
data/fr.php.i
|
|
Binary file not shown.
@ -1 +0,0 @@
|
|||||||
default
|
|
@ -1,3 +0,0 @@
|
|||||||
0
|
|
||||||
pull
|
|
||||||
ssh://ewen@localhost//hg/blocklogo
|
|
@ -537,47 +537,53 @@ class AdminBulkUpdate extends AdminTab {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$output .= '<p class="conf">'.$this->l('Products updated').'</p>';
|
$output .= '<p class="conf">'.$this->l('Products updated').'</p>';
|
||||||
} elseif(Tools::isSubmit('submitUploadPrices')) {
|
}
|
||||||
|
// MAJ Rapide produits (Reduction, Prix d'achat HT, Prix d'achat TTC)
|
||||||
|
elseif(Tools::isSubmit('submitUploadPrices'))
|
||||||
|
{
|
||||||
$f = fopen($_FILES['csvfile']['tmp_name'], 'r');
|
$f = fopen($_FILES['csvfile']['tmp_name'], 'r');
|
||||||
fgetcsv($f, 0, ';');
|
fgetcsv($f, 0, ';');
|
||||||
|
|
||||||
$products = array();
|
$products = array();
|
||||||
$prices = array();
|
$prices = array();
|
||||||
|
|
||||||
if(Tools::getValue('price_process') == 2) {
|
if (Tools::getValue('price_process') == 2) {
|
||||||
while($line = fgetcsv($f, 0, ';')) {
|
while ($line = fgetcsv($f, 0, ';')) {
|
||||||
if(empty($line[0])) {
|
if (empty($line[0])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$products[] = (int) $line[0];
|
$products[] = (int) $line[0];
|
||||||
}
|
}
|
||||||
} elseif(Tools::getValue('price_process') == 3
|
}
|
||||||
|| Tools::getValue('price_process') == 4){
|
// Prix d'achat HT || Prix public TTC
|
||||||
while($line = fgetcsv($f, 0, ';')) {
|
elseif (Tools::getValue('price_process') == 3 || Tools::getValue('price_process') == 4) {
|
||||||
if(empty($line[0])) {
|
while ($line = fgetcsv($f, 0, ';')) {
|
||||||
|
if (empty($line[0])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$prices[] = array(
|
$prices[] = array(
|
||||||
(int) $line[0],
|
(int) $line[0],
|
||||||
$line[1]
|
$line[1]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}else {
|
}
|
||||||
while($line = fgetcsv($f, 0, ';')) {
|
// Reduction
|
||||||
if(empty($line[0])) {
|
else {
|
||||||
|
while ($line = fgetcsv($f, 0, ';')) {
|
||||||
|
if (empty($line[0])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isset($line[1])) {
|
if (!isset($line[1])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$products[] = (int) $line[0];
|
$products[] = (int) $line[0];
|
||||||
$prices[] = array(
|
$prices[] = array(
|
||||||
(int) $line[0],
|
(int) $line[0],
|
||||||
(float) $line[1] > 1? (float) $line[1] / 100: (float) $line[1]
|
(float) $line[1] > 1 ? (float) $line[1] / 100: (float) $line[1]
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -585,17 +591,18 @@ class AdminBulkUpdate extends AdminTab {
|
|||||||
|
|
||||||
fclose($f);
|
fclose($f);
|
||||||
|
|
||||||
if(Tools::getValue('price_process') == 1
|
// Reduction || ...
|
||||||
|| Tools::getValue('price_process') == 2) {
|
if (Tools::getValue('price_process') == 1 || Tools::getValue('price_process') == 2) {
|
||||||
Db::getInstance()->ExecuteS('
|
Db::getInstance()->ExecuteS('
|
||||||
DELETE FROM `'._DB_PREFIX_.'specific_price`
|
DELETE FROM `'._DB_PREFIX_.'specific_price`
|
||||||
WHERE `id_product` IN ('.implode(', ', $products).')
|
WHERE `id_product` IN ('.implode(', ', $products).')
|
||||||
');
|
');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Tools::getValue('price_process') == 1) {
|
// Reduction
|
||||||
foreach($prices as $price) {
|
if (Tools::getValue('price_process') == 1) {
|
||||||
if((int) $price[0] != 0) {
|
foreach ($prices as $price) {
|
||||||
|
if ((int) $price[0] != 0) {
|
||||||
Db::getInstance()->ExecuteS('
|
Db::getInstance()->ExecuteS('
|
||||||
INSERT INTO `'._DB_PREFIX_.'specific_price` VALUES (
|
INSERT INTO `'._DB_PREFIX_.'specific_price` VALUES (
|
||||||
DEFAULT,
|
DEFAULT,
|
||||||
@ -617,51 +624,64 @@ class AdminBulkUpdate extends AdminTab {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(Tools::getValue('price_process') == 3) {
|
|
||||||
foreach($prices as $price) {
|
// Prix d'achat HT
|
||||||
if((int) $price[0] != 0){
|
if (Tools::getValue('price_process') == 3) {
|
||||||
|
foreach ($prices as $price) {
|
||||||
|
if ((int) $price[0] != 0){
|
||||||
$price[1] = str_replace(',', '.', $price[1]);
|
$price[1] = str_replace(',', '.', $price[1]);
|
||||||
$price_ht = floatval($price[1]);
|
$price_ht = floatval($price[1]);
|
||||||
Db::getInstance()->ExecuteS('
|
Db::getInstance()->ExecuteS('
|
||||||
UPDATE `'._DB_PREFIX_.'product`
|
UPDATE `'._DB_PREFIX_.'product`
|
||||||
SET wholesale_price = '. (float)$price_ht .'
|
SET wholesale_price = '. (float)$price_ht .'
|
||||||
WHERE id_product ='. (int)$price[0]);
|
WHERE id_product ='. (int)$price[0]);
|
||||||
}else{
|
} else {
|
||||||
$output .= '<p class="error">ID produit à 0, ligne non traitée : '.serialize($price).'</p>';
|
$output .= '<p class="error">ID produit à 0, ligne non traitée : '.serialize($price).'</p>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(Tools::getValue('price_process') == 4) {
|
|
||||||
foreach($prices as $price) {
|
// Prix public TTC
|
||||||
if((int) $price[0] != 0){
|
if (Tools::getValue('price_process') == 4) {
|
||||||
|
foreach ($prices as $price) {
|
||||||
|
if ((int) $price[0] != 0){
|
||||||
$price[1] = str_replace(',', '.', $price[1]);
|
$price[1] = str_replace(',', '.', $price[1]);
|
||||||
$price_ht = floatval($price[1] / 1.20);
|
// Find Tax for this id product
|
||||||
|
// product.id_tax_rules_group => tax_rules_group => tax_rule => tax.rate
|
||||||
|
$tax = new Tax();
|
||||||
|
$taxValue = $tax->getProductTaxRate((int)$price[0]);
|
||||||
|
if ($taxValue == 0) {
|
||||||
|
$taxValue = 20;
|
||||||
|
}
|
||||||
|
|
||||||
|
$price_ht = floatval($price[1] / (1 + $taxValue / 100) );
|
||||||
Db::getInstance()->ExecuteS('
|
Db::getInstance()->ExecuteS('
|
||||||
UPDATE `'._DB_PREFIX_.'product`
|
UPDATE `'._DB_PREFIX_.'product`
|
||||||
SET price = '. (float)$price_ht .'
|
SET price = '. (float)$price_ht .'
|
||||||
WHERE id_product ='. (int)$price[0]);
|
WHERE id_product ='. (int)$price[0]);
|
||||||
}else{
|
} else {
|
||||||
$output .= '<p class="error">ID produit à 0, ligne non traitée : '.serialize($price).'</p>';
|
$output .= '<p class="error">ID produit à 0, ligne non traitée : '.serialize($price).'</p>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$output .= '<p class="conf">'.$this->l('Products updated').'</p>';
|
$output .= '<p class="conf">'.$this->l('Products updated').'</p>';
|
||||||
} elseif(Tools::isSubmit('submitUploadProductDescriptions')) {
|
}
|
||||||
|
elseif (Tools::isSubmit('submitUploadProductDescriptions')) {
|
||||||
$id_lang = Tools::getValue('description_process');
|
$id_lang = Tools::getValue('description_process');
|
||||||
$f = fopen($_FILES['csvfile']['tmp_name'], 'r');
|
$f = fopen($_FILES['csvfile']['tmp_name'], 'r');
|
||||||
fgetcsv($f, 0, ';');
|
fgetcsv($f, 0, ';');
|
||||||
|
|
||||||
$products = array();
|
$products = array();
|
||||||
|
|
||||||
while($line = fgetcsv($f, 0, ';')) {
|
while ($line = fgetcsv($f, 0, ';')) {
|
||||||
if($line[0] == '' || $line[1] == '') {
|
if ($line[0] == '' || $line[1] == '') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$products[] = $line;
|
$products[] = $line;
|
||||||
}
|
}
|
||||||
foreach($products as $line) {
|
foreach ($products as $line) {
|
||||||
$result = Db::getInstance()->ExecuteS('
|
$result = Db::getInstance()->ExecuteS('
|
||||||
UPDATE `'._DB_PREFIX_.'product_lang`
|
UPDATE `'._DB_PREFIX_.'product_lang`
|
||||||
SET `description` = "'. pSQL($line[1],true) .'"
|
SET `description` = "'. pSQL($line[1],true) .'"
|
||||||
@ -675,14 +695,15 @@ class AdminBulkUpdate extends AdminTab {
|
|||||||
|
|
||||||
fclose($f);
|
fclose($f);
|
||||||
$output .= '<p class="conf">'.$this->l('Products updated').'</p>';
|
$output .= '<p class="conf">'.$this->l('Products updated').'</p>';
|
||||||
} elseif(Tools::isSubmit('submitUploadCombinations')) {
|
}
|
||||||
|
elseif (Tools::isSubmit('submitUploadCombinations')) {
|
||||||
$f = fopen($_FILES['csvfile']['tmp_name'], 'r');
|
$f = fopen($_FILES['csvfile']['tmp_name'], 'r');
|
||||||
fgetcsv($f, 0, ';');
|
fgetcsv($f, 0, ';');
|
||||||
|
|
||||||
$products = array();
|
$products = array();
|
||||||
|
|
||||||
while($line = fgetcsv($f, 0, ';')) {
|
while ($line = fgetcsv($f, 0, ';')) {
|
||||||
if(empty($line[0])) {
|
if (empty($line[0])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -713,7 +734,7 @@ class AdminBulkUpdate extends AdminTab {
|
|||||||
|
|
||||||
$output .= '<p class="conf">'.$this->l('Products updated').'</p>';
|
$output .= '<p class="conf">'.$this->l('Products updated').'</p>';
|
||||||
|
|
||||||
} elseif(Tools::isSubmit('submitExportDeb')){
|
} elseif (Tools::isSubmit('submitExportDeb')){
|
||||||
set_time_limit(300);
|
set_time_limit(300);
|
||||||
$id_lang = Tools::getValue('id_lang', $cookie->id_lang);
|
$id_lang = Tools::getValue('id_lang', $cookie->id_lang);
|
||||||
$deb = Tools::getValue('deb', 0);
|
$deb = Tools::getValue('deb', 0);
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user