Compare commits

...

26 Commits

Author SHA1 Message Date
Michael RICOIS
1d5578d66b Merge remote-tracking branch 'origin/ticket-14739-PackLogistic' 2018-03-27 10:20:34 +02:00
Michael RICOIS
922de8200a Fix quantity 2018-03-22 11:08:49 +01:00
Michael RICOIS
7699f86acd Save logisitic queue name in configuration 2018-03-21 10:32:59 +01:00
Michael RICOIS
76b26ac6b4 CS 2018-03-21 10:27:58 +01:00
Michael RICOIS
6b863fe940 Fix 2018-03-19 12:27:57 +01:00
Michael RICOIS
34e2bdc553 Merge remote-tracking branch 'origin/ticket/r16490-email_error' 2018-03-19 12:19:16 +01:00
Michael RICOIS
2207ae3cb8 CS 2018-03-19 10:28:19 +01:00
Michael RICOIS
893da877e8 Merge remote-tracking branch 'origin/ticket/r16686-filter_back' 2018-03-19 10:19:01 +01:00
Michael RICOIS
efbcf6327f Remove opening title (not working) 2018-03-19 10:15:54 +01:00
Michael RICOIS
5a605ad905 Fix url : typo 2018-03-19 09:45:28 +01:00
Michael RICOIS
e057c88351 CSS open if values in cookie 2018-03-16 10:12:24 +01:00
Michael RICOIS
93fe8b597a CS 2018-03-16 10:11:38 +01:00
Michael RICOIS
9803b2424c Add filter value in cookie 2018-03-15 17:37:01 +01:00
Michael RICOIS
4691d8bb0f Remove .hg 2018-03-15 15:25:12 +01:00
Michael RICOIS
a4625499c0 Override email value 2018-03-15 11:21:41 +01:00
Michael RICOIS
b5053e443a Merge remote-tracking branch 'origin/ticket/r15862-label_refbbb' 2018-03-14 11:57:07 +01:00
Michael RICOIS
34c962b75e Fix regexp 2018-03-14 11:51:28 +01:00
Michael RICOIS
588fa7e334 Merge branch 'ticket/r15862-label_refbbb' 2018-03-14 11:48:10 +01:00
Michael RICOIS
03cd386f70 New regexp 2018-03-14 11:47:16 +01:00
Michael RICOIS
6d0beefa1c Merge branch 'ticket/r15862-label_refbbb' 2018-03-14 11:29:50 +01:00
Michael RICOIS
2a3e8ebddd Change regexp to detect first - 2018-03-14 11:28:11 +01:00
Michael RICOIS
eea2e769d1 Remove break point 2018-03-14 11:17:26 +01:00
Michael RICOIS
305234f74f CS 2018-03-12 12:58:54 +01:00
Michael RICOIS
1920a84634 Add rules 2018-03-12 11:52:00 +01:00
Michael RICOIS
d1d0642f91 Add a better way to correct email - to test 2018-03-09 17:54:36 +01:00
Michael RICOIS
197f4161d1 Add New Import 2018-02-26 11:46:03 +01:00
248 changed files with 480 additions and 385 deletions

View File

@ -79,7 +79,16 @@ class AdminImport extends AdminTab
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')))
{
@ -280,7 +289,19 @@ class AdminImport extends AdminTab
'meta_keywords' => array('label' => $this->l('Meta-keywords')),
'meta_description' => array('label' => $this->l('Meta-description')));
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();
}
@ -1292,6 +1313,51 @@ class AdminImport extends AdminTab
}
$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()
{
@ -1824,6 +1890,9 @@ class AdminImport extends AdminTab
case $this->entities[$this->l('Suppliers')]:
$this->supplierImport();
break;
case $this->entities[$this->l('Pack')]:
$this->packImport();
break;
default:
$this->_errors[] = $this->l('no entity selected');
}

View File

@ -174,18 +174,30 @@ class PackCore extends Product
}
/**
* Add an item to the pack
*
* @param integer $id_product
* @param integer $id_item
* @param integer $qty
* @return boolean true if everything was fine
*/
* Add an item to the pack
* @param integer $id_product
* @param integer $id_item
* @param integer $qty
* @return boolean true if everything was fine
*/
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');
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)
{

View File

@ -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}.
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>
</tr>
<tr>

View File

@ -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}.
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,

Binary file not shown.

View File

@ -1 +0,0 @@
default

View File

@ -1,2 +0,0 @@
22140c622301271e8694549e29e360916921e485 0
22140c622301271e8694549e29e360916921e485 default

View File

@ -1,2 +0,0 @@
0 22140c622301271e8694549e29e360916921e485

Binary file not shown.

View File

@ -1,2 +0,0 @@
[paths]
default = ssh://ewen@localhost//hg/blockauth

View File

@ -1,4 +0,0 @@
revlogv1
fncache
store
dotencode

View File

@ -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.

View File

@ -1 +0,0 @@
default

View File

@ -1,3 +0,0 @@
0
pull
ssh://ewen@localhost//hg/blockauth

View File

@ -1 +0,0 @@
default

View File

@ -1,2 +0,0 @@
55a547b9200e199cbe52370d3ee590a2a8237c03 2
55a547b9200e199cbe52370d3ee590a2a8237c03 default

View File

@ -1,2 +0,0 @@
2 55a547b9200e199cbe52370d3ee590a2a8237c03

Binary file not shown.

View File

@ -1,2 +0,0 @@
[paths]
default = ssh://ewen@localhost//hg/blockcartex

View File

@ -1,4 +0,0 @@
revlogv1
fncache
store
dotencode

View File

@ -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.

View File

@ -1 +0,0 @@
default

View File

@ -1,3 +0,0 @@
0
pull
ssh://ewen@localhost//hg/blockcartex

Binary file not shown.

View File

@ -1 +0,0 @@
default

View File

@ -1,2 +0,0 @@
a0b6701fd7c40b9759a83fc8e78566aa84a678e2 0
a0b6701fd7c40b9759a83fc8e78566aa84a678e2 default

View File

@ -1,2 +0,0 @@
0 a0b6701fd7c40b9759a83fc8e78566aa84a678e2

Binary file not shown.

View File

@ -1,2 +0,0 @@
[paths]
default = ssh://ewen@localhost//hg/blocklogo

View File

@ -1,4 +0,0 @@
revlogv1
fncache
store
dotencode

View File

@ -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.

View File

@ -1 +0,0 @@
default

View File

@ -1,3 +0,0 @@
0
pull
ssh://ewen@localhost//hg/blocklogo

View File

@ -1 +0,0 @@
default

View File

@ -1,2 +0,0 @@
613b481451e73594f52e08e2a35120c98652d63c 3
613b481451e73594f52e08e2a35120c98652d63c default

View File

@ -1,2 +0,0 @@
3 613b481451e73594f52e08e2a35120c98652d63c

Binary file not shown.

View File

@ -1,2 +0,0 @@
[paths]
default = ssh://ewen@localhost//hg/categoryscroll

View File

@ -1,4 +0,0 @@
revlogv1
fncache
store
dotencode

View File

@ -1,8 +0,0 @@
data/config.xml.i
data/product-list.tpl.i
data/product_list.tpl.i
data/header.tpl.i
data/ajax.php.i
data/categoryscroll.php.i
data/logo.gif.i
data/fr.php.i

View File

@ -1 +0,0 @@
default

View File

@ -1,3 +0,0 @@
0
pull
ssh://ewen@localhost//hg/categoryscroll

Some files were not shown because too many files have changed in this diff Show More