Merge branch 'fix-OnCustomerRemoving' into develop

This commit is contained in:
Marion Muszynski 2017-06-01 10:53:25 +02:00
commit dc0ff8e9b6
9 changed files with 50 additions and 11 deletions

View File

@ -1231,7 +1231,7 @@ class AdminBulkUpdate extends AdminTab {
$id_lang = Tools::getValue('id_lang', $cookie->id_lang); $id_lang = Tools::getValue('id_lang', $cookie->id_lang);
$order_states = explode(',', Configuration::get('PS_IT_OF_ORDER_STATES')); $order_states = explode(',', Configuration::get('PS_IT_OF_ORDER_STATES'));
if ($id_category = (int) Tools::getValue('category')) { if ((int)Tools::getValue('category')!=0 && $id_category = (int) Tools::getValue('category')) {
$c = new Category($id_category, $cookie->id_lang); $c = new Category($id_category, $cookie->id_lang);
$children = $c->recurseLiteCategTree(5, 0, $id_lang); $children = $c->recurseLiteCategTree(5, 0, $id_lang);
$ids = $this->_recurse_array(array($children)); $ids = $this->_recurse_array(array($children));
@ -1921,6 +1921,10 @@ class AdminBulkUpdate extends AdminTab {
} }
$option_sales = array(); $option_sales = array();
$option_sales[] = array(
'value' => 0,
'label' => 'Selectionner une vente'
);
foreach(Db::getInstance()->ExecuteS(' foreach(Db::getInstance()->ExecuteS('
SELECT c.`id_category`, l.`name` SELECT c.`id_category`, l.`name`
FROM `'._DB_PREFIX_.'category_lang` l FROM `'._DB_PREFIX_.'category_lang` l

View File

@ -19,17 +19,18 @@ if(($sponsor = Tools::getValue('sponsor')) && strlen($sponsor) > 12) {
} }
$url = parse_url($_SERVER['REQUEST_URI']); $url = parse_url($_SERVER['REQUEST_URI']);
$gclid = Tools::getIsset('gclid')?'&gclid='.Tools::getValue('gclid'):'';
if(Tools::getIsset('lpes')) { if(Tools::getIsset('lpes')) {
$lp = Tools::getValue('lpes'); $lp = Tools::getValue('lpes');
if( _THEME_NAME_ !== 'site_mobile') { if( _THEME_NAME_ !== 'site_mobile') {
Tools::redirect('?sponsor='.rawurlencode($cipherTool->encrypt('1|'.$email.'|')).(isset($lp)? '&lpes='.$lp: '')); Tools::redirect('?sponsor='.rawurlencode($cipherTool->encrypt('1|'.$email.'|')).(isset($lp)? '&lpes='.$lp: '').$gclid);
} }
} }
if(Tools::getIsset('lp')) { if(Tools::getIsset('lp')) {
$lp = Tools::getValue('lp'); $lp = Tools::getValue('lp');
} }
Tools::redirectLink($link->getPageLink('authentication.php').'?create_account=1&sponsor='.rawurlencode($cipherTool->encrypt('1|'.$email.'|')).(isset($url['query'])? '&'.$url['query']: '').(isset($lp)? '&lp='.$lp: '')); Tools::redirectLink($link->getPageLink('authentication.php').'?create_account=1&sponsor='.rawurlencode($cipherTool->encrypt('1|'.$email.'|')).(isset($url['query'])? '&'.$url['query']: '').(isset($lp)? '&lp='.$lp: '').$gclid);
// Tools::redirectLink($link->getPageLink('authentication.php').'?create_account=1&sponsor='.rawurlencode($cipherTool->encrypt('1|'.$email.'|')).(isset($url['query'])? '&'.$url['query']: '')); // Tools::redirectLink($link->getPageLink('authentication.php').'?create_account=1&sponsor='.rawurlencode($cipherTool->encrypt('1|'.$email.'|')).(isset($url['query'])? '&'.$url['query']: ''));
} }
} }

View File

@ -5,12 +5,22 @@
background-position: center 99px; background-position: center 99px;
background-repeat: no-repeat; background-repeat: no-repeat;
} }
@media screen and (max-width:767px){
body#authentication {
background-image: none !important;
}
}
{else} {else}
body#authentication { body#authentication {
background-image: url("{$base_dir_ssl}modules/landingpages/img/default.jpg"); background-image: url("{$base_dir_ssl}modules/landingpages/img/default.jpg");
background-position: center 99px; background-position: center 99px;
background-repeat: no-repeat; background-repeat: no-repeat;
} }
@media screen and (max-width:767px){
body#authentication {
background-image: none !important;
}
}
{/if} {/if}
</style> </style>
<div class="hidden" style="display: none !important;"> <div class="hidden" style="display: none !important;">

View File

@ -193,7 +193,7 @@ $values = array(
// payment success // payment success
if ((!isset($autorisation[1]) || empty($autorisation[1]))) if ((!isset($autorisation) || empty($autorisation)))
{ {
if (in_array($_SERVER['REMOTE_ADDR'], $authorized_ip)) { if (in_array($_SERVER['REMOTE_ADDR'], $authorized_ip)) {
mail('marion@antadis.com', '[BBB] ERREUR Reponse paybox direct', http_build_query($data, '', '&')); mail('marion@antadis.com', '[BBB] ERREUR Reponse paybox direct', http_build_query($data, '', '&'));
@ -202,7 +202,7 @@ if ((!isset($autorisation[1]) || empty($autorisation[1])))
die('No autorisation number'); die('No autorisation number');
} }
// Wrong authorization number in live mode // Wrong authorization number in live mode
if ($autorisation[1] == 'XXXXXX' && $test_mode === 1) { if ($autorisation == 'XXXXXX' && $test_mode === 1) {
$error .= '- error payment - wrong authorization number <br>'."\n"; $error .= '- error payment - wrong authorization number <br>'."\n";
} }
@ -257,7 +257,7 @@ $total_paid = $values['m'] / 100;
if ($test_mode === 0) if ($test_mode === 0)
{ {
if (empty($error) && $code_reponse[1] == '00000') if (empty($error) && $code_reponse == '00000')
{ {
$error = '***TEST*** : Validated Payment <br>'."\n"; $error = '***TEST*** : Validated Payment <br>'."\n";
$statut = _PS_OS_PAYMENT_; $statut = _PS_OS_PAYMENT_;
@ -270,7 +270,7 @@ if ($test_mode === 0)
} }
elseif ($test_mode === 1) elseif ($test_mode === 1)
{ {
if ($code_reponse[1] == '00000' && empty($error)){ if ($code_reponse == '00000' && empty($error)){
$statut = _PS_OS_PAYMENT_; $statut = _PS_OS_PAYMENT_;
} }
else else
@ -279,7 +279,7 @@ elseif ($test_mode === 1)
} }
} }
switch ($code_reponse[1]) switch ($code_reponse)
{ {
case '00001': case '00001':
$error .= 'Connection to the authorization center failed or an internal error occurred <br>'."\n"; $error .= 'Connection to the authorization center failed or an internal error occurred <br>'."\n";
@ -308,6 +308,9 @@ switch ($code_reponse[1])
case '00015': case '00015':
$error .= 'Payment already done<br>'."\n"; $error .= 'Payment already done<br>'."\n";
break; break;
case '00105':
$error .= 'Error 00105<br>'."\n";
break;
case '00016': case '00016':
$error .= 'Subscriber already exists<br>'."\n"; $error .= 'Subscriber already exists<br>'."\n";
break; break;

View File

@ -296,6 +296,9 @@ switch ($pbx_error)
case '00138': case '00138':
$error .= 'Too many attempts at secret code.<br>'."\n"; $error .= 'Too many attempts at secret code.<br>'."\n";
break; break;
case '00151':
$error .= 'provision insuffisante.<br>'."\n";
break;
case '00159': case '00159':
$error .= 'Suspicion of fraud.<br>'."\n"; $error .= 'Suspicion of fraud.<br>'."\n";
break; break;

View File

@ -1,7 +1,7 @@
<?php <?php
class Customer extends CustomerCore class Customer extends CustomerCore
{ {
public function printVersion($value, $params) public function printVersion($value, $params)
{ {
$versions = array( $versions = array(
'en' => 1, 'en' => 1,
@ -11,4 +11,18 @@ class Customer extends CustomerCore
); );
return '<img src="/img/l/'.(int) $versions[$value].'.jpg" alt="" />'; return '<img src="/img/l/'.(int) $versions[$value].'.jpg" alt="" />';
} }
public function delete()
{
$addresses = $this->getAddresses((int)(Configuration::get('PS_LANG_DEFAULT')));
foreach ($addresses AS $address)
{
$obj = new Address((int)($address['id_address']));
$obj->delete();
}
Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'customer_group` WHERE `id_customer` = '.(int)($this->id));
Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'customer_thread` SET `id_customer` = 0 WHERE `id_customer` = '.(int)($this->id));
Discount::deleteByIdCustomer((int)($this->id));
return parent::delete();
}
} }

View File

@ -18,6 +18,10 @@ class OrderReturn extends OrderReturnCore {
SELECT SUM(`quantity`) SELECT SUM(`quantity`)
FROM `'._DB_PREFIX_.'mondialrelay_parcel` FROM `'._DB_PREFIX_.'mondialrelay_parcel`
WHERE `id_order_detail` = '.(int) $product['id_order_detail'].' WHERE `id_order_detail` = '.(int) $product['id_order_detail'].'
') + (int) Db::getInstance()->getValue('
SELECT SUM(`quantity`)
FROM `'._DB_PREFIX_.'philea_parcel`
WHERE `id_order_detail` = '.(int) $product['id_order_detail'].'
') - max($product['product_quantity_return'], $product['product_quantity_refunded']); ') - max($product['product_quantity_return'], $product['product_quantity_refunded']);
} }
$qty -= (int) Db::getInstance()->getValue(' $qty -= (int) Db::getInstance()->getValue('

Binary file not shown.

Before

Width:  |  Height:  |  Size: 368 KiB

After

Width:  |  Height:  |  Size: 125 KiB

View File

@ -18,7 +18,7 @@ $(document).ready(function() {
if(window.matchMedia("(max-width:1199px)").matches) { if(window.matchMedia("(max-width:1199px)").matches) {
var nameProduct = $(this).text(); var nameProduct = $(this).text();
if(nameProduct.length > 20) { if(nameProduct.length > 20) {
nameProduct = nameProduct.substring(0,22)+"..."; nameProduct = nameProduct.substring(0,17)+"...";
$(this).text(nameProduct); $(this).text(nameProduct);
} }
} }