Merge branch 'develop' of gitlab.antadis.net:dev-antadis/bebeboutik into develop

This commit is contained in:
root 2017-05-17 11:33:25 +02:00
commit 709fd079ed
5 changed files with 58 additions and 32 deletions

View File

@ -19,7 +19,6 @@ foreach(Db::getInstance()->ExecuteS('
') as $c){
$categories[] = $c['id_category'];
}
foreach ($categories as $key => $id_category) {
$products = Db::getInstance()->ExecuteS('
SELECT cp.`id_product`
@ -29,14 +28,15 @@ foreach ($categories as $key => $id_category) {
WHERE cp.id_category ='.(int)$id_category.' AND p.quantity != 0
ORDER BY cp.`position`
');
foreach ($products as $key => $product) {
Db::getInstance()->Execute('
UPDATE `'._DB_PREFIX_.'category_product`
SET `position` = '. (int)($key) .'
WHERE `id_product` = '.(int)($product['id_product']).'
AND `id_category`='.(int)$id_category
);
if($products){
foreach ($products as $key => $product) {
Db::getInstance()->Execute('
UPDATE `'._DB_PREFIX_.'category_product`
SET `position` = '. (int)($key) .'
WHERE `id_product` = '.(int)($product['id_product']).'
AND `id_category`='.(int)$id_category
);
}
}
$products_zero = Db::getInstance()->ExecuteS('
@ -44,17 +44,19 @@ foreach ($categories as $key => $id_category) {
FROM `'._DB_PREFIX_.'category_product` cp
RIGHT JOIN `'._DB_PREFIX_.'product` p ON (p.id_product=cp.id_product)
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.id_product=p.id_product AND pl.`id_lang` = 1)
WHERE cp.id_category ='.(int)$id_category.' AND p.quantity == 0
WHERE cp.id_category ='.(int)$id_category.' AND p.quantity = 0
ORDER BY cp.`position`
');
$position = count($products);
foreach ($$products_zero as $key => $product) {
Db::getInstance()->Execute('
UPDATE `'._DB_PREFIX_.'category_product`
SET `position` = '. (int)($position) .'
WHERE `id_product` = '.(int)($product['id_product']).'
AND `id_category`='.(int)$id_category
);
$position++;
if($products_zero){
$position = count($products);
foreach ($products_zero as $key => $product) {
Db::getInstance()->Execute('
UPDATE `'._DB_PREFIX_.'category_product`
SET `position` = '. (int)($position) .'
WHERE `id_product` = '.(int)($product['id_product']).'
AND `id_category`='.(int)$id_category
);
$position++;
}
}
}

View File

@ -117,6 +117,16 @@ if (in_array($_SERVER['REMOTE_ADDR'], $authorized_ip)) {
mail('marion@antadis.com', '[BBB] Envoi paybox direct', $trame);
}
// log
$content = '';
if (file_exists('logs.txt')) {
$content = file_get_contents('logs.txt');
}
$line = 'SEND ['.(int)$cart->id.']['.$num_question.'] '.date('Y-m-d H:i:s').': '.$trame."\n";
$content .= $line;
file_put_contents('logs.txt', $content);
// end log
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));
curl_setopt($curl, CURLOPT_POSTFIELDS, $trame);
@ -124,6 +134,16 @@ curl_setopt($curl, CURLOPT_POSTFIELDS, $trame);
$response = curl_exec($curl);
curl_close($curl);
// log
$content = '';
if (file_exists('logs.txt')) {
$content = file_get_contents('logs.txt');
}
$line = 'RESPONSE ['.(int)$cart->id.']['.$num_question.'] '.date('Y-m-d H:i:s').': '.$response."\n";
$content .= $line;
file_put_contents('logs.txt', $content);
// end log
$data = explode('&', $response);
foreach ($data as $d) {
$d = explode('=', $d);

View File

@ -953,7 +953,7 @@ div#editorial_block_center p a:first-child{
}
.footer_img img{ width: 70%; }
.footer_social {
max-width: 300px;
max-width: 350px;
margin: auto;
margin-top: 20px;
margin-bottom: 50px;
@ -1446,7 +1446,7 @@ body#index #columns #privatesales_block ul li .short_desc .date{
body#index #columns #privatesales_block ul li .links,
body#trailer #columns .links {
position: relative;
overflow: auto;
overflow: hidden;
}
body#index #columns #privatesales_block ul li .links .short_desc,
body#trailer #columns .links .short_desc {
@ -1479,6 +1479,9 @@ body#trailer #columns .links {
line-height: 15px;
display: block;
}
body#index #columns #privatesales_block ul#futuresales_list li .links .short_desc .small_title{
min-height: 30px;
}
body#index #columns #privatesales_block ul li .links .short_desc .percent { display: none; }
body#index #columns #privatesales_block ul li .links .actions,
body#trailer #columns .links .actions {

View File

@ -464,14 +464,14 @@ $(document).ready(function()
}
//add a link on the span 'view full size' and on the big image
$('span#view_full_size, div#image-block img').click(function(){
$('#views_block li a.shown').click().fancybox({
'hideOnContentClick': true,
'transitionIn' : 'elastic',
'transitionOut' : 'elastic',
'onComplete' : function(){$('#views_block li a.shown').unbind('click.fb');}
});
});
// $('span#view_full_size, div#image-block img').click(function(){
// $('#views_block li a.shown').click().fancybox({
// 'hideOnContentClick': true,
// 'transitionIn' : 'elastic',
// 'transitionOut' : 'elastic',
// 'onComplete' : function(){$('#views_block li a.shown').unbind('click.fb');}
// });
// });
//catch the click on the "more infos" button at the top of the page
@ -503,6 +503,7 @@ $(document).ready(function()
$('#product #thumbs_list_frame a').click(function(e) {
e.preventDefault();
return false;
});

View File

@ -105,7 +105,7 @@ var oneQuantityAvailableSentence = '{l s='Warning: 1 item in stock!' js=1}';
<a href="{$smarty.server.HTTP_REFERER|escape:'htmlall':'UTF-8'|secureReferrer}" class="button_small back" title="{l s='Back'}">{l s='Back'}</a>
</span>
{/if}
<span>{$product->name|escape:'htmlall':'UTF-8'|truncate:28:'...':true:false}</span>
<span>{$product->name|truncate:30:'...':true:false}</span>
</h1>
</div>
@ -190,12 +190,12 @@ var oneQuantityAvailableSentence = '{l s='Warning: 1 item in stock!' js=1}';
</div>
{/if}
{if ($product->show_price AND !isset($restricted_country_mode)) OR isset($groups) OR $product->reference OR (isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS)}
<!-- add to cart form-->
<form id="buy_block" class="clearfix {if $PS_CATALOG_MODE AND !isset($groups) AND $product->quantity > 0}hidden{/if}" action="{$link->getPageLink('cart.php')}" method="post">
<!-- hidden datas -->
<p class="hidden">
<input type="hidden" name="token" value="{$static_token}" />