Merge branch 'ticket-12052-PreventDelivery' into develop

This commit is contained in:
Marion Muszynski 2016-12-15 12:02:48 +01:00
commit b3b9d7313f
16 changed files with 666 additions and 270 deletions

View File

@ -7,47 +7,58 @@ class HelperFormBootstrap{
public $_html;
public $_object;
public $_css;
public $_style; // inc style
public $_css; // user style
public $_script; // inc js
public $_js; // user js
public $_messages;
public $_select2;
public $_inputMask;
public $_dateTime;
public function __construct(){
$this->_html = '';
$this->_object = NULL;
$this->_css = '';
$this->_script = '';
$this->_js = '';
$this->_messages = '';
$this->_selectCheck = false;
$this->_dateTime = false;
$this->_html = '';
$this->_object = NULL;
$this->_css = '';
$this->_style = '';
$this->_script = '';
$this->_js = '';
$this->_messages = '';
$this->_select2 = false;
$this->_inputMask = false;
$this->_dateTime = false;
}
public function renderForm($display = true, $action = NULL, $method = 'POST', $enctype = 'multipart/form-data'){
public function renderStyle() {
$this->_style .= '<style type="text/css">
@import url("'.__PS_BASE_URI__.'adm/helpers/includes/jquery-ui-1.8.20.custom.css");
@import url("'.__PS_BASE_URI__.'adm/helpers/includes/css/bootstrap.min.css");
'.($this->_select2?'@import url("'.__PS_BASE_URI__.'adm/helpers/includes/css/select2.min.css");':'').'
@import url("'.__PS_BASE_URI__.'adm/helpers/includes/css/custom.css");
' . $this->_css . '
</style>';
return $this->_style;
}
$this->generateForms();
$this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.'adm/helpers/includes/jquery-3.1.1.min.js"></script>';
public function renderScript() {
$this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.'adm/helpers/includes/jquery.min.js"></script>';
$this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.'adm/helpers/includes/jquery-ui-1.8.20.custom.min.js"></script>';
$this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.'adm/helpers/includes/js/bootstrap.min.js"></script>';
if ($this->_select2) {
$this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.'adm/helpers/includes/js/select2.full.min.js"></script>';
}
$form =
'<style type="text/css">
@import url("'.__PS_BASE_URI__.'adm/helpers/includes/jquery-ui-1.8.20.custom.css");
@import url("'.__PS_BASE_URI__.'adm/helpers/includes/css/bootstrap.min.css");
@import url("'.__PS_BASE_URI__.'adm/helpers/includes/css/custom.css");
'.($this->_select2?'@import url("'.__PS_BASE_URI__.'adm/helpers/includes/css/select2.min.css");':'').'
' . $this->_css . '
</style>' .
$this->_script .
($this->_messages ? implode("\n", $this->_messages) : '') .
$this->_html .
$this->_js; // display user js after render form
if ($this->_inputMask) {
$this->_script .= '<script type="text/javascript" src="'.__PS_BASE_URI__.'adm/helpers/includes/jquery.inputmask.bundle.min.js"></script>';
}
$this->_script .= $this->_js;
return $this->_script;
}
public function renderForm($display = true, $action = NULL, $method = 'POST', $enctype = 'multipart/form-data'){
$this->generateForms();
$form = ($this->_messages ? implode("\n", $this->_messages) : '') . $this->_html;
if ($display)
echo $form;
@ -64,25 +75,29 @@ class HelperFormBootstrap{
$enctype = 'multipart/form-data';
foreach ($this->_forms as $form) {
$action = isset($form['action']) ? $form['action'] : $action;
$method = isset($form['method']) ? $form['method'] : $method;
$enctype = isset($form['enctype']) ? $form['enctype'] : $enctype;
$css = isset($form['style']) ? $form['style'] : '';
$class = isset($form['class']) ? $form['class'] : '';
$id = (isset($form['id']) && $form['id']) ? $form['id'] : false;
$icon = (isset($form['icon']) && $form['icon']) ? $form['icon'] : false;
$class_div = isset($form['class_div']) ? $form['class_div'] : '';
$action = isset($form['action']) ? $form['action'] : $action;
$method = isset($form['method']) ? $form['method'] : $method;
$enctype = isset($form['enctype']) ? $form['enctype'] : $enctype;
$css = isset($form['style']) ? $form['style'] : '';
$class = isset($form['class']) ? $form['class'] : '';
$id = (isset($form['id']) && $form['id']) ? $form['id'] : false;
$icon = (isset($form['icon']) && $form['icon']) ? $form['icon'] : false;
$title = (isset($form['title']) && $form['title']) ? $form['title'] : '';
// OPEN FORM
$this->_html .= '
<div class="panel">
<div class="panel-title">
<h2>'.($icon?$icon:'').$title.'</h2>
<div class="clearfix"></div>
</div>
<div class="panel-content">
<form action="'.$action.'" method="'.$method.'" enctype="'.$enctype.'" class="'.$class.'" style="'.$css.'">';
<div class="'.$class_div.'">
<div class="panel">
<div class="panel-title">
<h2>'.($icon?$icon:'').$title.'</h2>
<div class="clearfix"></div>
</div>
<div class="panel-content">
<form action="'.$action.'" method="'.$method.'" enctype="'.$enctype.'" class="'.$class.'" style="'.$css.'">';
if(isset($form['information'])) {
$this->_html .= '<p>'.$form['information'].'</p>';
}
if (isset($form['sections'])){
foreach ($form['sections'] as $section) {
@ -120,6 +135,7 @@ class HelperFormBootstrap{
$this->_html .= '</div>';
}
$this->_html .= '</form>
</div>
</div>
</div>';
}
@ -141,6 +157,9 @@ class HelperFormBootstrap{
case 'text':
$this->inputText($input);
break;
case 'simpleText':
$this->inputSimpleText($input);
break;
case 'select':
$this->inputSelect($input);
break;
@ -150,6 +169,9 @@ class HelperFormBootstrap{
case 'select-styled':
$this->inputSelectStyled($input);
break;
case 'simpleDate':
$this->inputSimpleDate($input);
break;
case 'bool':
case 'radio':
$this->inputBool($input);
@ -222,8 +244,8 @@ class HelperFormBootstrap{
public function inputTextAddon($p = array()) {
$this->_html .='
<div class="form-group">
<label class="control-label '.$p['label-class'].'" for="'.(isset($p['id']) ? $p['id'] : $p['name']).'">'.$p['label'].'</label>
<div class="form-group '.(isset($p['class-group'])?$p['class-group']:'').'">
'.(isset($p['label']) && $p['label'] ?'<label class="control-label '.$p['label-class'].'" for="'.(isset($p['id']) ? $p['id'] : $p['name']).'">'.$p['label'].'</label>':'').'
<div class="input-group">
'.(isset($p['before']) && $p['before'] ?'<div class="input-group-addon">'.$p['before'].'</div>':'').'
<input type="text" class="form-control" name="'.$p['name'].'" id="'.(isset($p['id']) ? $p['id'] : $p['name']).'" placeholder="'.((isset($p['placeholder']) && $p['placeholder'])?$p['placeholder']:'').'">
@ -232,11 +254,50 @@ class HelperFormBootstrap{
</div>';
}
public function inputSimpleText($p = array()) {
$this->_html .='
<div class="form-group '.(isset($p['class-group'])?$p['class-group']:'').'">
<label class="control-label '.(isset($p['label-class']) ? $p['label-class'] : '').'" for="'.(isset($p['id']) ? $p['id'] : $p['name']).'">'.$p['label'].'</label>
<div class="'.(isset($p['input-class']) ? $p['input-class'] : '').'">
<input type="text" class="form-control" name="'.$p['name'].'" id="'.(isset($p['id']) ? $p['id'] : $p['name']).'" placeholder="'.((isset($p['placeholder']) && $p['placeholder'])?$p['placeholder']:'').'">
</div>
</div>';
}
public function inputSimpleDate($p = array()) {
if($p['period']) {
$this->_html .='<div class="'.(isset($p['class-from'])?$p['class-from']:'').'">';
}
$this->_html .='
<div class="form-group">
'.(isset($p['label']) && $p['label'] ?'<label class="control-label '.$p['label-class'].'" for="'.(isset($p['id']) ? $p['id'] : $p['name']).'">'.$p['label'].'</label>':'').'
<div class="input-group">
'.(isset($p['before']) && $p['before'] ?'<div class="input-group-addon">'.$p['before'].'</div>':'').'
<input type="text" class="form-control" name="'.$p['name'].'" id="'.(isset($p['id']) ? $p['id'] : $p['name']).'" placeholder="'.((isset($p['placeholder']) && $p['placeholder'])?$p['placeholder']:'').'">
'.(isset($p['after']) && $p['after'] ?'<div class="input-group-addon">'.$p['after'].'</div>':'').'
</div>
</div>';
if($p['period']) {
$this->_html .='</div>
<div class="'.(isset($p['class-to'])?$p['class-to']:'').'">
<div class="form-group">
'.(isset($p['label-to']) && $p['label-to'] ?'<label class="control-label '.$p['label-class'].'" for="'.(isset($p['id-to']) ? $p['id-to'] : $p['name-to']).'">'.$p['label-to'].'</label>':'').'
<div class="input-group">
'.(isset($p['before-to']) && $p['before-to'] ?'<div class="input-group-addon">'.$p['before-to'].'</div>':'').'
<input type="text" class="form-control" name="'.$p['name-to'].'" id="'.(isset($p['id-to']) ? $p['id-to'] : $p['name-to']).'" placeholder="'.((isset($p['placeholder-to']) && $p['placeholder-to'])?$p['placeholder-to']:'').'">
'.(isset($p['after-to']) && $p['after-to'] ?'<div class="input-group-addon">'.$p['after-to'].'</div>':'').'
</div>
</div>
</div>
<div class="clearfix"></div>';
}
}
public function inputSelect2($p = array()) {
$this->_html .='
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12 '.(isset($p['label-class']) ? $p['label-class'] : '').'">'.$p['label'].'</label>
<div class="col-md-9 col-sm-9 col-xs-12">
<div class="form-group '.(isset($p['class-group'])?$p['class-group']:'').'">
'.(isset($p['label'])?'<label class="control-label col-md-3 col-sm-3 col-xs-12 '.(isset($p['label-class']) ? $p['label-class'] : '').'">'.$p['label'].'</label>':'').'
<div class="'.(isset($p['label'])?'col-md-9 col-sm-9 col-xs-12':'').'">
<select class="form-control" name="'.$p['name'].'" id="'.(isset($p['id']) ? $p['id'] : $p['name']).'" tabindex="-1">';
foreach($p['options'] as $opt) {
$selected = '';

View File

@ -25,6 +25,39 @@ ul#menu li a {
text-decoration: underline;
}
/* CUSTOM */
.text-purple-dark{
color: #504d8b!important;
}
#content {
background-color: #f5f5f9;
}
.row {
background: none;
}
.btn-primary {
background: #504d8b;
border-color: #504d8b;
}
.btn-primary:hover {
background: #796dc7;
border-color: #796dc7;
}
.btn-primary.active,
.btn-primary:active,
.open>.dropdown-toggle.btn-primary {
color: #fff;
background: #796dc7;
border-color: #796dc7;
}
.btn-primary.focus,
.btn-primary:focus {
color: #fff;
background: #504d8b;
border-color: #504d8b;
}
h2 {
font-size: 18px;
font-weight: 400;
@ -86,13 +119,16 @@ label{
margin-left: 10px;
}
.panel-content {
padding: 0 5px 6px;
padding: 0 5px;
position: relative;
width: 100%;
float: left;
clear: both;
margin-top: 5px;
}
.panel-content .form-group:last-child{
margin-bottom: 5px;
}
.ln_solid,
.ln_solid-small {
border-top: 1px solid #e5e5e5;
@ -104,10 +140,16 @@ label{
.ln_solid-small{
margin: 25px 0 10px;
}
form p:first-child{
margin-top: 0px;
}
.form-horizontal .form-group {
margin-right: 0;
margin-left: 0;
}
input:focus, textarea:focus {
background: none;
}
#content .alert {
width: 100%;
margin: 0;
@ -127,7 +169,27 @@ label{
border-color: #d6e9c6;
}
/* form */
.form-control {
height: 28px;
line-height: 28px;
}
/* table */
table.table-custombordered {
border: 1px solid rgba(221,221,221,0.78);
}
table tr th,
table.table tr th {
background: #504d8b;
color: #fff;
}
/* Select2 */
.select2-results ul li{
text-align: left;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
background-color: #504d8b;
color: white;
}

File diff suppressed because one or more lines are too long

4
adm/helpers/includes/jquery.min.js vendored Executable file

File diff suppressed because one or more lines are too long

View File

@ -37,6 +37,18 @@ if($cookie->isLogged() && Tools::getValue('id_order')) {
$errors[] = Tools::displayError('Lo sentimos, en estos momentos no distribuimos nuestros productos en Canarias. Si deseas más información, puedes contactar con el Servicio de atención al cliente o llamar al 902 044 399.');
}
// Checking CEUTA/MELINA
$ceuta = array(51001, 51002, 51003, 51004, 51005, 51070, 51071, 51080);
if ($delivery->id_country == 6 && (in_array(intval($delivery->postcode),$ceuta))
) {
$errors[] = Tools::displayError('Lo sentimos, en estos momentos no distribuimos nuestros productos a Ceuta. Si deseas más información, puedes contactar con el Servicio de atención al cliente o llamar al 902 044 399.');
}
$melina = array(52001, 52002, 52003, 52004, 52005, 52006, 52070, 52071, 52080);
if ($delivery->id_country == 6 && (in_array(intval($delivery->postcode),$melina))
) {
$errors[] = Tools::displayError('Lo sentimos, en estos momentos no distribuimos nuestros productos a Melina. Si deseas más información, puedes contactar con el Servicio de atención al cliente o llamar al 902 044 399.');
}
// Checking DOM-TOM
$prefix_postcode = substr($delivery->postcode, 0 ,3);
$domtom = array(971,972,973,974,975,976,984,986,987,988);

View File

@ -150,74 +150,83 @@ class AdminAntConfigurations extends AdminTab
$helperForm->_select2 = true;
$helperForm->_forms = array(
array(
'action' => $base_link,
'title' => $this->l('Configurations'),
'icon' => '<span class="glyphicon glyphicon-cog"></span> ',
'class' => 'form-horizontal',
'sections' => array(
'action' => $base_link,
'title' => $this->l('Association Produits'),
'icon' => '<span class="glyphicon glyphicon-refresh"></span> ',
'class' => 'form-horizontal',
'class_div' => 'col-md-3',
'information' => 'Permet d\'associer les produits aux ventes lorsque le cron n\'est pas encore passé',
'sections' => array(
array(
'title' => $this->l('Association produits/ventes'),
'class' => 'col-md-3',
'inputs' => array(
array(
'type' => 'submit',
'class' => 'btn-default',
'class' => 'btn-primary',
'name' => 'submitProductSaleCache',
'value' => $this->l('Mettre à jour l\'association'),
),
),
),
array(
'title' => $this->l('Association categories/ventes'),
'class' => 'col-md-offset-1 col-md-8',
'inputs' => array(
array(
'type' => 'select2',
'class-select' => '',
'name' => 'id_sale',
'label' => $this->l('Select a sale'),
'options' => $id_sale_options,
),
),
'actions' => array(
array(
'type' => 'submit',
'class' => 'btn-default',
'name' => 'submitCategorySaleCache',
'value' => $this->l('Associer')
)
),
'actions-class' => 'text-right',
),
),
)
);
$helperForm->_forms[] = array(
'action' => $base_link,
'title' => $this->l('Association categories/ventes'),
'icon' => '<span class="glyphicon glyphicon-cog"></span> ',
'class' => 'form-horizontal',
'class_div' => 'col-md-9',
'sections' => array(
array(
'inputs' => array(
array(
'type' => 'select2',
'class-select' => '',
'name' => 'id_sale',
'options' => $id_sale_options,
),
),
'actions' => array(
array(
'type' => 'submit',
'class' => 'btn-primary',
'name' => 'submitCategorySaleCache',
'value' => $this->l('Associer')
)
),
'actions-class' => 'text-right',
),
),
);
if($cookie->id_employee == 1) {
$helperForm->_forms[] =
array(
'action' => $base_link,
'title' => $this->l('Section Antadis'),
'class' => 'form-horizontal',
'sections' => array(
array(
'class' => 'col-md-6',
//'title' => $this->l('Mettre à jour les crédit fidélité'),
'inputs' => array(
array(
'type' => 'submit',
'class' => 'btn-default',
'name' => 'submitUpdateLoyaltyOrders',
'label' => $this->l('Credit fidélité : '),
'value' => $this->l('Mettre à jour'),
),
$nb_credits = $this->getNbOrderToUpdate();
$helperForm->_forms[] = array(
'action' => $base_link,
'title' => $this->l('Section Antadis'),
'class' => 'form-horizontal',
'class_div' => 'col-md-12',
'sections' => array(
array(
'class' => 'col-md-6',
//'title' => $this->l('Mettre à jour les crédit fidélité'),
'inputs' => array(
array(
'type' => 'submit',
'class' => 'btn-default',
'name' => 'submitUpdateLoyaltyOrders',
'label' => $this->l('Credit fidélité ').($nb_credits>0?'('.$nb_credits.')':'').': ',
'value' => $this->l('Mettre à jour'),
),
),
),
);
),
);
}
$form .= $helperForm->renderForm(false, NULL, NULL, true);
$form .= $helperForm->renderStyle();
$form .= '<div class="row">'.$helperForm->renderForm(false, NULL, NULL, true).'</div>';
$form .= $helperForm->renderScript();
echo $form;
}
@ -256,4 +265,13 @@ class AdminAntConfigurations extends AdminTab
}
return $count_orders;
}
public function getNbOrderToUpdate(){
return Db::getInstance()->getValue('
SELECT COUNT(lo.`id_order`)
FROM `'._DB_PREFIX_.'loyalty` lo
LEFT JOIN `'._DB_PREFIX_.'order_history` oh ON (oh.`id_order` = lo.`id_order`)
WHERE oh.`id_order_history` = (SELECT MAX(`id_order_history`) FROM `'._DB_PREFIX_.'order_history` moh WHERE moh.`id_order` = lo.`id_order` GROUP BY moh.`id_order`)
AND oh.`id_order_state` = 4 AND lo.`id_loyalty_state` NOT IN (2,4)
');
}
}

View File

@ -1,6 +1,7 @@
<?php
require_once(PS_ADMIN_DIR . '/helpers/HelperForm.php');
require_once(PS_ADMIN_DIR . '/helpers/HelperFormBootstrap.php');
require_once(PS_ADMIN_DIR . '/helpers/HelperList.php');
class AdminPhileaMagistor extends AdminTab {
@ -13,12 +14,11 @@ class AdminPhileaMagistor extends AdminTab {
global $cookie;
$fileName = 'cron_sale_cache.php';
$output = shell_exec("ps -ax | grep $fileName | wc -l");
if($output > 2){
echo '<p class="error">'.$this->l('Association automatique en cours, réessayez plus tard').'</p><br />';
}
$hour = (int) date('H');
$min = (int) date('i');
if ($hour%3 == 0 && $min <= 20 && $min >= 10 ){
if($output > 2){
echo '<p class="error">'.$this->l('Association automatique en cours, réessayez plus tard').'</p><br />';
} elseif ($hour%3 == 0 && $min <= 20 && $min >= 10 ){
echo '<p class="error">'.$this->l('Association automatique en cours, réessayez plus tard').'</p><br />';
} else {
$min_id_product = Db::getInstance()->getValue('
@ -192,8 +192,7 @@ class AdminPhileaMagistor extends AdminTab {
LIMIT 1
')){
echo '<p class="conf">'.$this->l('Vente désarchivée').'</p><br />';
}
else{
} else{
echo '<p class="error">'.$this->l('La vente n\'a pas pu être désarchivée.').'</p><br />';
}
} elseif(Tools::isSubmit('exportCMDPhilea')){
@ -353,6 +352,7 @@ class AdminPhileaMagistor extends AdminTab {
background: rgba(86,84,133,0.9);
text-align: center;
color: #fff;
font-size: 12px;
}
.table tr{
background:#fff;
@ -360,15 +360,12 @@ class AdminPhileaMagistor extends AdminTab {
.table tr:nth-child(even){
background:#F1F1F1;
}
.table tr:nth-child(even) td {
border-left:1px solid #FFF;
border-right:1px solid #FFF;
}
.table tr td {
#upload_form .table tr td {
border-bottom: 1px solid #DEDEDE;
color: #000;
height: auto;
padding: 5px 4px 10px 4px;
padding: 5px 4px;
vertical-align: middle;
}
.table tr td[id*=ART] p,
.table tr td[id*=CDC] p{
@ -450,6 +447,13 @@ class AdminPhileaMagistor extends AdminTab {
$base_link = $currentIndex . '&token='.Tools::getAdminTokenLite('AdminPhileaMagistor');
$philea_sales = array();
foreach(Db::getInstance()->ExecuteS('
SELECT `id_sale`
FROM `'._DB_PREFIX_.'philea_sync`
') as $row) {
$philea_sales[] = $row['id_sale'];
}
$id_sale_options = array();
foreach(Db::getInstance()->ExecuteS('
SELECT p.`id_sale`, c.`name`, c.`id_category`
@ -457,7 +461,8 @@ class AdminPhileaMagistor extends AdminTab {
LEFT JOIN `'._DB_PREFIX_.'category_lang` c ON (c.`id_category` = p.`id_category`)
LEFT JOIN `'._DB_PREFIX_.'privatesale_shipping_sale` pss ON (pss.`id_sale` = p.`id_sale`)
WHERE c.`id_lang` = '.$cookie->id_lang.'
AND p.`date_start` > "2015-01-01 00:00:00"
AND p.`id_sale` NOT IN ('.implode(',',$philea_sales).')
AND p.`date_start` > "2016-01-01 00:00:00"
AND pss.`id_shipping` = 1
ORDER BY p.`id_sale` DESC
') as $row) {
@ -467,110 +472,150 @@ class AdminPhileaMagistor extends AdminTab {
'value' => (int) $row['id_sale']
);
}
$helperForm = new HelperForm();
$helperForm = new HelperFormBootstrap();
$helperForm->_select2 = true;
$helperForm->_inputMask = true;
$helperForm->_forms = array(
array(
'action' => $base_link,
'legend' => $this->l('Association Vente - Produits'),
'actions' => array(
'action' => $base_link,
'title' => $this->l('Association Produits'),
'icon' => '<span class="glyphicon glyphicon-refresh"></span> ',
'class' => 'form-horizontal',
'class_div' => 'col-md-3',
'information' => 'Permet d\'associer les produits aux ventes lorsque le cron n\'est pas encore passé',
'sections' => array(
array(
'type' => 'submit',
'name' => 'submitProductSaleCache',
'label' => $this->l('Associer les produits aux ventes')
)
)
)
);
$form .= $helperForm->renderForm(false, NULL, NULL, true);
$helperForm = new HelperForm();
$helperForm->_forms = array(
array(
'action' => $base_link,
'legend' => $this->l('Philea'),
'inputs' => array(
array(
'type' => 'select-styled',
'class-select' => 'bg-purple-light big-select',
'name' => 'id_sale',
'label' => $this->l('Select a sale'),
'options' => $id_sale_options,
'filter' => true,
'filter_text' => $this->l('Filter par vente')
),
// array(
// 'type' => 'checkbox',
// 'name' => 'force_rec_file',
// 'label' => $this->l('Forcer l\'envoi'),
// 'text' => $this->l('Force un nouvel envoi du fichier REC.')
// )
),
'actions' => array(
array(
'type' => 'submit',
'name' => 'submitPhilea',
'label' => $this->l('Envoyer à Philea')
)
)
)
);
$form .= $helperForm->renderForm(false, NULL, NULL, true);
$helperForm = new HelperForm();
$helperForm->_forms = array(
array(
'action' => $base_link,
'legend' => $this->l('Export des commandes envoyées à Philéa'),
'inputs' => array(
array(
'type' => 'text',
'name' => 'date_from',
'label' => $this->l('De :'),
'help' => 'Format YYYY-MM-DD'
),
array(
'type' => 'text',
'name' => 'date_to',
'label' => $this->l('A :'),
'help' => 'Format YYYY-MM-DD'
'inputs' => array(
array(
'type' => 'submit',
'class' => 'btn-primary',
'name' => 'submitProductSaleCache',
'value' => $this->l('Mettre à jour l\'association'),
),
),
),
),
'actions' => array(
array(
'type' => 'submit',
'name' => 'exportCMDPhilea',
'label' => $this->l('Exporter')
)
)
)
);
$helperForm->_forms[] = array(
'action' => $base_link,
'title' => $this->l('Synchronisation des ventes'),
'icon' => '<span class="glyphicon glyphicon-cog"></span> ',
'class' => 'form-horizontal',
'class_div' => 'col-md-4',
'sections' => array(
array(
'inputs' => array(
array(
'type' => 'select2',
'class-select' => '',
'name' => 'id_sale',
'options' => $id_sale_options,
),
),
'actions' => array(
array(
'type' => 'submit',
'class' => 'btn-primary',
'name' => 'submitPhilea',
'value' => $this->l('Synchroniser vers Philéa')
)
),
'actions-class' => 'text-right',
),
),
);
$helperForm->_forms[] = array(
'action' => $base_link,
'title' => $this->l('Extracts suivi cmd'),
'icon' => '<span class="glyphicon glyphicon-save-file"></span> ',
'class' => 'form-horizontal',
'class_div' => 'col-md-5',
'sections' => array(
array(
'inputs' => array(
array(
'type' => 'simpleDate',
'period' => true,
'class-from' => 'col-md-6',
'class-to' => 'col-md-6',
'id' => 'date_from',
'id-to' => 'date_to',
'name' => 'date_from',
'name-to' => 'date_to',
'before' => '<span class="glyphicon glyphicon-calendar"></span>',
'before-to' => '<span class="glyphicon glyphicon-calendar"></span>',
),
),
'actions' => array(
array(
'type' => 'submit',
'class' => 'btn-primary',
'name' => 'exportCMDPhilea',
'value' => $this->l('Exporter')
)
),
'actions-class' => 'text-right',
),
),
);
$form .= $helperForm->renderForm(false, NULL, NULL, true);
$helperForm->_css .= '
table .collapse.in {
display:table-row;
}
#upload_form .table tr.info_more_th td,
.table tr.info_more_th td{
background:#fff;
color: #504d8b;
font-weight: 700;
border-bottom:0px;
}
#upload_form .table tr.info_more_tr td,
.table tr.info_more_tr td{
background:#fff;
border-top:0px;
vertical-align:top!important;
}
';
$helperForm->_js .= '
<script>
$(document).ready(function() {
$("#date_from").inputmask("9999-99-99");
$("#date_to").inputmask("9999-99-99");
});
</script>';
$form .= $helperForm->renderStyle();
$form .= '<div class="row">'.$helperForm->renderForm(false, NULL, NULL, true).'</div>';
$CRR_list = $this->getCRRList();
$form .= '
<form id="upload_form" action="' . $base_link . '" method="post" class="form"><div class="clear">&nbsp;</div>
<fieldset><legend>'.$this->l('Orders CRR').'</legend>
<p>'.$this->l('Historique des ventes envoyées à Philea'). (self::TIME_DISPLAY > 0 ? ' (' . self::TIME_DISPLAY . ' ' . $this->l('derniers jours') . ')' : '').'</p>
<input type="hidden" id="id_sale_hidden" name="id_sale" value="" />
<input type="hidden" name="addCDC"/>
<p><input type="submit" class="btn button" name="philea_archive_submit" value="' . $this->l('Archiver la sélection') . '"/></p>
<table class="table">
<thead>
<tr>
<th colspan="2">' . $this->l('ID sale') . '</th>
<th width="325">' . $this->l('Name') . '</th>
<th>' . $this->l('Date envoi (ART)') . '</th>
<th>' . $this->l('Envoyer la commande') . '</th>
<th>' . $this->l('Date envoi (CMD)') . '</th>
<th>' . $this->l('Préparation (CRP)') . '</th>
<th>' . $this->l('Envoi auto') . '</th>
</tr>
</thead>
<tbody>';
$form .= '<div class="panel">
<div class="panel-title">
<h2>Ventes Philéa</h2>
<div class="clearfix"></div>
</div>
<div class="panel-content">
<form id="upload_form" action="' . $base_link . '" method="post" class="form">
<p>'.$this->l('Historique des ventes envoyées à Philea'). (self::TIME_DISPLAY > 0 ? ' (' . self::TIME_DISPLAY . ' ' . $this->l('derniers jours') . ')' : '').'</p>
<input type="hidden" id="id_sale_hidden" name="id_sale" value="" />
<input type="hidden" name="addCDC"/>
<p><input type="submit" class="btn btn-primary" name="philea_archive_submit" value="' . $this->l('Archiver la sélection') . '"/></p>
<table class="table table-custombordered">
<thead>
<tr>
<th colspan="2">' . $this->l('ID sale') . '</th>
<th width="325">' . $this->l('Nom de la vente') . '</th>
<th>' . $this->l('Base Produits') . '</th>
<th>' . $this->l('Dernier envoi CMD') . '</th>
<th>' . $this->l('Dernière preparation CMD') . '</th>
<th colspan="2">' . $this->l('Actions') . '</th>
</tr>
</thead>
<tbody>';
$dowload_link = _MODULE_DIR_.'philea_magistor/script/archives/IN/RECEPTION/';
$upload_link = $base_link;
$now = date('Y-m-d H:i:s', mktime(date('H') -1));
@ -593,9 +638,9 @@ class AdminPhileaMagistor extends AdminTab {
$title = ($auto_sync ? $this->l('Désactiver l\'envoi automatique pour la vente') : $this->l('Activer l\'envoi automatique pour la vente') );
if (isset($CRR['date_end']) && $CRR['date_end'] >= $now)
$auto_sync_btn = '<a title="' . $title . ' '. (int)$CRR['id_sale'] .'" data-id_sale = "' . (int) $CRR['id_sale'] . '" class="auto_sync_btn' . ($auto_sync ? ' active' : '') . '" href="' . $currentIndex . '&token=' . $this->token . '&auto_sync&id_sale=' . (int)$CRR['id_sale'] . '&active=' . (int) !$auto_sync . '"><img src="../img/admin/' . ($auto_sync ? 'module_install.png' : 'module_disabled.png') . '"/></a>';
$auto_sync_btn = '<a title="' . $title . ' '. (int)$CRR['id_sale'] .'" data-id_sale = "' . (int) $CRR['id_sale'] . '" class="text-' . ($auto_sync ? 'green-light' : 'rose') . '" href="' . $currentIndex . '&token=' . $this->token . '&auto_sync&id_sale=' . (int)$CRR['id_sale'] . '&active=' . (int) !$auto_sync . '"><span style="font-size:21px;" class="anticon anticon-rss2"></span></a>';
else
$auto_sync_btn = '<span style="opacity: 0.4;" title="' . $this->l('La vente est terminée') .'"><img src="../img/admin/' . ($auto_sync ? 'module_install.png' : 'module_notinstall.png') . '"/></span>';
$auto_sync_btn = '<a title="' . $this->l('La vente est terminée') .'" class="text-' . ($auto_sync ? 'green-light' : 'rose') . '"><span style="opacity: 0.4;font-size:21px;" class="anticon anticon-rss2"></span></a>';
$submit_link = $upload_link;// . '&id_sale=' . (int) $CRR['id_sale'] . '&addCDC=1';
@ -623,56 +668,88 @@ class AdminPhileaMagistor extends AdminTab {
$form .= '<tr>
<td><input type="checkbox" id="check_sale_'.(int) $CRR['id_sale'].'" name="id_sales[]" value="'.(int) $CRR['id_sale'].'" /></td>
<td><label style="float:none; width:auto; padding: 0; text-align: left; font-weight: normal;" for="check_sale_'.(int) $CRR['id_sale'].'">'.(int) $CRR['id_sale'].'</label></td>
<td><label style="float:none; width:auto; padding: 0; text-align: left; font-weight: normal;" for="check_sale_'.(int) $CRR['id_sale'].'"><strong>'.$CRR['name'].'</strong> - '.$CRR['subtitle'].'</label></td>
<td><label style="float:none; width:auto; padding: 0; text-align: left; font-weight: normal; margin:0;" for="check_sale_'.(int) $CRR['id_sale'].'">'.(int) $CRR['id_sale'].'</label></td>
<td><label style="float:none; width:auto; padding: 0; text-align: left; font-weight: normal; margin:0;" for="check_sale_'.(int) $CRR['id_sale'].'"><strong>'.$CRR['name'].'</strong> - '.$CRR['subtitle'].'</label></td>
<td style="text-align: center;" id="ART_'. (int) $CRR['id_sale'] .'">
<p style="color: #565485;">'.(!empty($CRR['sync_date'])?'<span style="font-size: 12px;" class="anticon anticon-clock"></span> '.date('d/m/Y H:i',strtotime($CRR['sync_date'])):'--').'</p>';
if(!empty($art_reports)){
foreach($art_reports as $key => $report) {
$form .= '<div>
<a class="button see_report" data-id="'. (int) $CRR['id_sale'] .'" data-key="'.(int)$key.'" data-type="ART" href="#" title="'.$this->l('See ART report').'"><span class="anticon anticon-file-text2"></span> '.date('d/m/Y H:i',strtotime($report['report_date'])).'</a>
<div id="'.(int) $CRR['id_sale'].'_'.$key.'_ART" style="display:none">'.(!empty($report['report_data'])?$report['report_data']:'Pas encore de Rapport').'</div>
</div>';
}
<p style="color: #565485;font-size:12px;">';
if((int)$CRR['status_sent'] == 1 && !empty($CRR['sync_date'])) {
$form .= '<a class="" data-toggle="tooltip" title="Envoyé le '.date('d/m/Y H:i',strtotime($CRR['sync_date'])).'"><span class="anticon anticon-hour-glass text-orange"></span></a>';
} elseif((int)$CRR['status_sent'] == 2) {
$form .= '<a class="" data-toggle="tooltip" title="Base Produits OK"><span class="anticon anticon-checkmark text-green-light"></span></a>';
} elseif((int)$CRR['status_sent'] == 3) {
$form .= '<a class="" data-toggle="tooltip" title="Erreur Produits"><span class="anticon anticon-cross text-rose"></span></a>';
}
$form .= '</td>
<td style="text-align: center;"><a title="'.$this->l('Envoi du fichier CDC').'" class="button upload_link" data-id="' . (int) $CRR['id_sale'] . '" href="'.$submit_link.'" title="'.$this->l('Upload CDC file').'"><span class="anticon anticon-upload2"></span> '.$this->l('Envoyer à Philea').'</a></td>
<td style="text-align: center;" id="CDC_'. (int) $CRR['id_sale'] .'">
<p style="color: #565485;">'.(!empty($CRR['sent_date'])?'<span style="font-size: 12px;" class="anticon anticon-clock"></span> '.date('d/m/Y H:i',strtotime($CRR['sent_date'])):'--').'</p>';
if(!empty($cdc_reports)){
$form .= '<span class="see_more anticon anticon-zoom-in" style="color:#565485;cursor:pointer"></span><div class="reports" style="display:none">';
foreach($cdc_reports as $key => $report) {
$form .= '<div>
<a class="button see_report" data-id="'. (int) $CRR['id_sale'] .'" data-key="'.(int)$key.'" data-type="CDC" href="#" title="'.$this->l('See CDC report').'"><span class="anticon anticon-file-text2"></span> '.date('d/m/Y H:i',strtotime($report['report_date'])).'</a>
<div id="'.(int) $CRR['id_sale'].'_'.$key.'_CDC" style="display:none">'.(!empty($report['report_data'])?$report['report_data']:'Pas encore de Rapport').'</div>
</div>';
}
$form .= '</div>';
}
<p style="color: #565485; font-size:12px;">'.(!empty($CRR['sent_date'])?'<span style="font-size: 12px;" class="anticon anticon-clock"></span> '.date('d/m/Y H:i',strtotime($CRR['sent_date'])):'--').'</p>';
$form .= '</td>
<td style="text-align: center;" id="CRP_'. (int) $CRR['id_sale'] .'">';
if(!empty($crp_reports)){
$form .= '<p style="color: #565485;"><span style="font-size: 12px;" class="anticon anticon-clock"></span> '.date('d/m/Y H:i',strtotime($crp_reports[0]['report_date'])).'</p>
<span class="see_more anticon anticon-zoom-in" style="color:#565485;cursor:pointer"></span><div class="reports" style="display:none">';
foreach($crp_reports as $key => $report) {
$form .= '<div>
<a class="button see_report" data-id="'. (int) $CRR['id_sale'] .'" data-key="'.(int)$key.'" data-type="CRP" href="#" title="'.$this->l('See CDC report').'"><span class="anticon anticon-file-text2"></span> '.date('d/m/Y H:i',strtotime($report['report_date'])).'</a>
<div id="'.(int) $CRR['id_sale'].'_'.$key.'_CRP" style="display:none">'.(!empty($report['report_data'])?$report['report_data']:'Pas encore de Rapport').'</div>
</div>';
}
$form .= '</div>';
$form .= '<p style="color: #565485; font-size:12px;"><span style="font-size: 12px;" class="anticon anticon-clock"></span> '.date('d/m/Y H:i',strtotime($crp_reports[0]['report_date'])).'</p>';
} else {
$form .='--';
}
$form .= '</td>
<td style="text-align: center;">'.$auto_sync_btn.'</td>
<td style="text-align: center;">
<a class="text-purple-dark upload_link" data-id="' . (int) $CRR['id_sale'] . '" href="'.$submit_link.'" title="'.$this->l('Envoyer à Philéa').'"><span style="font-size:21px;" class="anticon anticon-mail"></span></a> '.$auto_sync_btn.'
</td>
<td style="text-align: center;">
<a class="text-purple-dark" data-toggle="collapse" data-target=".row_more_'.(int) $CRR['id_sale'].'"><span style="font-size:21px;cursor:pointer" class="anticon anticon-info"></span></a>
</td>
</tr>
<tr class="collapse info_more_th row_more_'.(int) $CRR['id_sale'].'">
<td align="center" colspan="3"><u>Rapport Base Produits</u></td>
<td align="center" colspan="2"><u>Rapports Envois Commandes</u></td>
<td align="center" colspan="3"><u>Rapports Preparations</u></td>
</tr>
<tr class="collapse info_more_tr row_more_'.(int) $CRR['id_sale'].'">
<td align="center" colspan="3">';
if(!empty($art_reports)){
foreach($art_reports as $key => $report) {
$form .= '<div>
<a class="btn btn-primary btn-xs see_report" data-id="'. (int) $CRR['id_sale'] .'" data-key="'.(int)$key.'" data-type="ART" href="#" title="'.$this->l('See ART report').'"><span class="anticon anticon-file-text2"></span> '.date('d/m/Y H:i',strtotime($report['report_date'])).'</a>
<div id="'.(int) $CRR['id_sale'].'_'.$key.'_ART" style="display:none">'.(!empty($report['report_data'])?$report['report_data']:'Pas encore de Rapport').'</div>
</div>';
}
}
$form .= '</td>
<td align="center" colspan="2">';
if(!empty($cdc_reports)){
$form .= '<div class="reports">';
foreach($cdc_reports as $key => $report) {
$form .= '<div>
<a class="btn btn-primary btn-xs see_report" data-id="'. (int) $CRR['id_sale'] .'" data-key="'.(int)$key.'" data-type="CDC" href="#" title="'.$this->l('See CDC report').'"><span class="anticon anticon-file-text2"></span> '.date('d/m/Y H:i',strtotime($report['report_date'])).'</a>
<div id="'.(int) $CRR['id_sale'].'_'.$key.'_CDC" style="display:none">'.(!empty($report['report_data'])?$report['report_data']:'Pas encore de Rapport').'</div>
</div>';
}
$form .= '</div>';
} else {
$form .='Pas encore de rapport';
}
$form .='</td>
<td align="center" colspan="3">';
if(!empty($crp_reports)){
$form .= '<div class="reports">';
foreach($crp_reports as $key => $report) {
$form .= '<div>
<a class="btn btn-primary btn-xs see_report" data-id="'. (int) $CRR['id_sale'] .'" data-key="'.(int)$key.'" data-type="CRP" href="#" title="'.$this->l('See CDC report').'"><span class="anticon anticon-file-text2"></span> '.date('d/m/Y H:i',strtotime($report['report_date'])).'</a>
<div id="'.(int) $CRR['id_sale'].'_'.$key.'_CRP" style="display:none">'.(!empty($report['report_data'])?$report['report_data']:'Pas encore de Rapport').'</div>
</div>';
}
$form .= '</div>';
} else {
$form .='Pas encore de rapport';
}
$form .='</td>
</tr>';
}
$form .= '
</tbody>
</table>
<div class="report_error div_report"></div>
<p><input type="submit" class="btn button" name="philea_archive_submit" value="' . $this->l('Archiver la sélection') . '"/></p>
</fieldset>
</form>
$form .= '</tbody>
</table>
<div class="report_error div_report"></div>
<p><input type="submit" class="btn btn-primary" name="philea_archive_submit" value="' . $this->l('Archiver la sélection') . '"/></p>
</form>
</div>
</div>
<div class="div_report_overlay"></div>
<script type="text/javascript">
$("document").ready(function(){
@ -721,7 +798,7 @@ class AdminPhileaMagistor extends AdminTab {
$form .= $this->displayArchives();
$form .= $helperForm->renderScript();
echo $form;
}
@ -735,9 +812,11 @@ class AdminPhileaMagistor extends AdminTab {
// Get CRR if CDC has not been sent OR sync_date < TIME_DISPLAY DAYs
$id_sales = array();
$pm_sync = array();
$pm_status = array();
$sql = '
SELECT
pm_sync.`id_sale`,
pm_sync.`products` as `status_sent`,
MAX(pm_sync.`date_add`) as `sync_date`
FROM `'._DB_PREFIX_.'philea_sync` pm_sync
LEFT JOIN `'._DB_PREFIX_.'philea_archive` pm_arch
@ -750,6 +829,7 @@ class AdminPhileaMagistor extends AdminTab {
foreach (Db::getInstance()->executeS($sql) as $row) {
$id_sales[] = (int) $row['id_sale'];
$pm_sync[(int) $row['id_sale']] = $row['sync_date'];
$pm_status[(int) $row['id_sale']] = $row['status_sent'];
}
$receptions = array();
@ -808,6 +888,7 @@ class AdminPhileaMagistor extends AdminTab {
$recep = (isset($receptions[(int) $id_sale]) ? $receptions[(int) $id_sale] : array('filename' => '', 'recep_date' => ''));
$sale = (isset($sales[(int) $id_sale]) ? $sales[(int) $id_sale] : array('name' => '', 'date_start' => '', 'date_end' => ''));
$sent_date = (isset($pm_sent[(int) $id_sale]) ? $pm_sent[(int) $id_sale] : '');
$status_sent = (isset($pm_status[(int) $id_sale]) ? $pm_status[(int) $id_sale] : '');
$as_active = (isset($pm_active[(int) $id_sale])) ? 1 : 0;
$extrafields = Category::getSalesInfos(array((int) $sales[(int) $id_sale]['id_category']));
@ -818,6 +899,7 @@ class AdminPhileaMagistor extends AdminTab {
'recep_date' => $recep['recep_date'],
'name' => $sale['name'],
'sent_date' => $sent_date,
'status_sent' => $status_sent,
'auto_sync_active' => $as_active,
'date_start' => $sale['date_start'],
'date_end' => $sale['date_end'],
@ -888,30 +970,37 @@ class AdminPhileaMagistor extends AdminTab {
);
}
$helperForm = new HelperForm();
$helperForm = new HelperFormBootstrap();
$helperForm->_select2 = true;
$helperForm->_forms = array(
array(
'action' => $base_link,
'legend' => $this->l('Archives'),
'inputs' => array(
'title' => $this->l('Archives'),
'icon' => '<span class="glyphicon glyphicon-level-up"></span> ',
'class' => 'form-horizontal',
'sections' => array(
array(
'type' => 'select-styled',
'class-select' => 'bg-purple-light big-select',
'name' => 'id_sale_unarchive',
'label' => $this->l('Désarchiver une vente'),
'options' => $archives_options,
'filter' => true,
'filter_text' => $this->l('Filter par vente')
)
'inputs' => array(
array(
'type' => 'select2',
'class-select' => '',
'name' => 'id_sale_unarchive',
'label' => $this->l('Choisir une vente'),
'options' => $archives_options,
),
),
'actions' => array(
array(
'type' => 'submit',
'class' => 'btn-primary',
'name' => 'unarchiveSale',
'value' => $this->l('Désarchiver la vente')
)
),
'actions-class' => 'text-right',
),
),
'actions' => array(
array(
'type' => 'submit',
'name' => 'unarchiveSale',
'label' => $this->l('Désarchiver la vente')
)
)
)
),
);
return $helperForm->renderForm(false, NULL, NULL, true);

View File

@ -49,8 +49,32 @@ if(is_object($iterator) && count($iterator)) {
$result = nl2br(implode("\n", $result));
if($result == '') {
$id_sale = Db::getInstance()->getValue('
SELECT `id_sale` FROM `'._DB_PREFIX_.'philea_syncreport`
WHERE `filename` = "'.pSQL($file).'"
');
if($id_sale) {
Db::getInstance()->Execute('
UPDATE `'._DB_PREFIX_.'philea_sync`
SET `products` = 2
WHERE `id_sale` = '.(int)$id_sale.'
LIMIT 1
');
}
$result = "RAS";
} else {
$id_sale = Db::getInstance()->getValue('
SELECT `id_sale` FROM `'._DB_PREFIX_.'philea_syncreport`
WHERE `filename` = "'.pSQL($file).'"
');
if($id_sale) {
Db::getInstance()->Execute('
UPDATE `'._DB_PREFIX_.'philea_sync`
SET `products` = 3
WHERE `id_sale` = '.(int)$id_sale.'
LIMIT 1
');
}
$errors = implode("\n", $errors);
mail('marion@antadis.com', '[BBB] article bloquant Philea', $file."\n".$errors);
}

View File

@ -454,7 +454,12 @@
$order->shipping_number = $parcel[0];
$order->update();
if(in_array($order->id, $status_sent)) {
$last_state = Db::getInstance()->getValue('
SELECT `id_order_state`
FROM `'._DB_PREFIX_.'order_state_current`
WHERE `id_order` ='.(int)$order->id
);
if(in_array($order->id, $status_sent) && (int)$last_state != 4) {
$history = new OrderHistory();
$history->id_order = (int) $order->id;
$history->changeIdOrderState(4, (int) $order->id);

View File

@ -183,7 +183,13 @@ if($magistorModule->active) {
NOW()
)
');
mail('marion@antadis.com', '[BBB] Philea - Send article for sale #'.$id_sale, $file); // log
Db::getInstance()->Execute('
UPDATE `'._DB_PREFIX_.'philea_sync`
SET `products` = 1
WHERE `id_sale` = '.(int)$id_sale.'
LIMIT 1
');
// mail('marion@antadis.com', '[BBB] Philea - Send article for sale #'.$id_sale, $file); // log
file_put_contents($fileName.'.DAT', "\xEF\xBB\xBF".utf8_encode($data));
file_put_contents($fileArchive.'.DAT', "\xEF\xBB\xBF".utf8_encode($data));
unset($data);

View File

@ -31,6 +31,20 @@ class OrderController extends OrderControllerCore {
Tools::redirect('order.php?step=1&canaries=1');
}
// Bloque Ceuta/Melina ES
$ceuta = array(51001, 51002, 51003, 51004, 51005, 51070, 51071, 51080);
if ($delivery->id_country == 6 && (in_array(intval($delivery->postcode),$ceuta))
) {
$this->step = 1;
Tools::redirect('order.php?step=1&ceuta=1');
}
$melina = array(52001, 52002, 52003, 52004, 52005, 52006, 52070, 52071, 52080);
if ($delivery->id_country == 6 && (in_array(intval($delivery->postcode),$melina))
) {
$this->step = 1;
Tools::redirect('order.php?step=1&melina=1');
}
// bloque DOM-TOM
$prefix_postcode = substr($delivery->postcode, 0 ,3);
$domtom = array(971,972,973,974,975,976,984,986,987,988);
@ -298,6 +312,18 @@ class OrderController extends OrderControllerCore {
$this->errors[] = Tools::displayError('Lo sentimos, en estos momentos no distribuimos nuestros productos en Canarias. Si deseas más información, puedes contactar con el Servicio de atención al cliente o llamar al 902 044 399.');
}
// bloque Ceuta/Melina
$ceuta = array(51001, 51002, 51003, 51004, 51005, 51070, 51071, 51080);
if ($delivery->id_country == 6 && (in_array(intval($delivery->postcode),$ceuta))
) {
$this->errors[] = Tools::displayError('Lo sentimos, en estos momentos no distribuimos nuestros productos a Ceuta. Si deseas más información, puedes contactar con el Servicio de atención al cliente o llamar al 902 044 399.');
}
$melina = array(52001, 52002, 52003, 52004, 52005, 52006, 52070, 52071, 52080);
if ($delivery->id_country == 6 && (in_array(intval($delivery->postcode),$melina))
) {
$this->errors[] = Tools::displayError('Lo sentimos, en estos momentos no distribuimos nuestros productos a Melina. Si deseas más información, puedes contactar con el Servicio de atención al cliente o llamar al 902 044 399.');
}
// bloque DOM-TOM
$prefix_postcode = substr($delivery->postcode, 0 ,3);
$domtom = array(971,972,973,974,975,976,984,986,987,988);

View File

@ -174,7 +174,7 @@
</ol>
</div>
{/if}
{if $smarty.get.domtom || $smarty.get.canaries}
{if $smarty.get.domtom || $smarty.get.canaries || $smarty.get.ceuta || $smarty.get.melina}
<div class="error">
<p>{l s='There is'} {l s='error'} :</p>
<ol>
@ -182,6 +182,10 @@
<li>{l s='Nous sommes désolé, nous ne livrons pas dans le DOM-TOM'}</li>
{elseif $smarty.get.canaries}
<li>{l s='Lo sentimos, en estos momentos no distribuimos nuestros productos en Canarias. Si deseas más información, puedes contactar con el Servicio de atención al cliente o llamar al 902 044 399.'}</li>
{elseif $smarty.get.ceuta}
<li>{l s='Lo sentimos, en estos momentos no distribuimos nuestros productos a Ceuta. Si deseas más información, puedes contactar con el Servicio de atención al cliente o llamar al 902 044 399.'}</li>
{elseif $smarty.get.melina}
<li>{l s='Lo sentimos, en estos momentos no distribuimos nuestros productos a Melina. Si deseas más información, puedes contactar con el Servicio de atención al cliente o llamar al 902 044 399.'}</li>
{/if}
</ol>
</div>

View File

@ -5081,3 +5081,29 @@ body#product #best-sellers_block_product{
body#product div.sale_img img{
background: none;
}
#product .product_info {
/* border-bottom: 1px solid #cac7be; */
padding: 0px 0px 15px;
margin: 0px 0px 20px;
text-align: center;
clear: both;
overflow: auto;
}
#product .product_info .info {
overflow: auto;
font-style: italic;
margin-bottom: 5px;
}
#product .product_info .picto {
background: url('../img/picto_info_produit.jpg') no-repeat top center;
display: block;
height: 30px;
width: 30px;
margin: 0 auto;
}
#product .product_info .info_2 .picto{ background-position: 0 -44px}
#product .product_info .info_3 .picto{ background-position: 0 -82px}
#product .product_info .info .pink{
color: #e36ea2;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@ -172,7 +172,7 @@
</ol>
</div>
{/if}
{if $smarty.get.domtom || $smarty.get.canaries}
{if $smarty.get.domtom || $smarty.get.canaries || $smarty.get.ceuta || $smarty.get.melina}
<div class="error">
<p>{l s='There is'} {l s='error'} :</p>
<ol>
@ -180,6 +180,10 @@
<li>{l s='Nous sommes désolé, nous ne livrons pas dans le DOM-TOM'}</li>
{elseif $smarty.get.canaries}
<li>{l s='Lo sentimos, en estos momentos no distribuimos nuestros productos en Canarias. Si deseas más información, puedes contactar con el Servicio de atención al cliente o llamar al 902 044 399.'}</li>
{elseif $smarty.get.ceuta}
<li>{l s='Lo sentimos, en estos momentos no distribuimos nuestros productos a Ceuta. Si deseas más información, puedes contactar con el Servicio de atención al cliente o llamar al 902 044 399.'}</li>
{elseif $smarty.get.melina}
<li>{l s='Lo sentimos, en estos momentos no distribuimos nuestros productos a Melina. Si deseas más información, puedes contactar con el Servicio de atención al cliente o llamar al 902 044 399.'}</li>
{/if}
</ol>
</div>

View File

@ -451,7 +451,7 @@ var oneQuantityAvailableSentence = '{l s='Warning: 1 item in stock!' js=1}';
{if $product->description}<li><a id="more_info_tab_more_info" href="#idTab2" style="">{l s='Good to know'}</a></li>{/if}
{*if $product->buy_guide}<li><a id="more_info_tab_data_sheet" href="#idTab3">{l s='Buy guide'}</a></li>{/if*}
{if $product->videos}<li><a id="more_info_tab_more_info" href="#idTab4" style="">{l s='Videos'}</a></li>{/if}
{if $product->description_delivery}<li><a id="more_info_tab_more_info" href="#idTab5" style="">{l s='Shipping'}</a></li>{/if}
<li><a id="more_info_tab_more_info" href="#idTab5" style="">{l s='Shipping'}</a></li>
{*if $features}<li><a id="more_info_tab_data_sheet" href="#idTab2">{l s='Data sheet'}</a></li>{/if*}
{*if $attachments}<li><a id="more_info_tab_attachments" href="#idTab9">{l s='Download'}</a></li>{/if*}
{*if isset($accessories) AND $accessories}<li><a href="#idTab4">{l s='Accessories'}</a></li>{/if*}
@ -478,10 +478,55 @@ var oneQuantityAvailableSentence = '{l s='Warning: 1 item in stock!' js=1}';
<!-- full videos -->
<div id="idTab4" class="rte">{$product->videos}</div>
{/if}
{if $product->description_delivery}
<!-- full description_delivery -->
<div id="idTab5" class="rte">{$product->description_delivery}</div>
<div id="idTab5" class="rte">
<div class="product_info">
<div class="info info_1">
{if $sale->delivery_delay == 2
|| $sale->delivery_delay == 3
|| $sale->delivery_delay == 4
|| $sale->delivery_delay == 5
|| $sale->delivery_delay == 6
|| $sale->delivery_delay == 7
|| $sale->delivery_delay == 8}
{include file="./themes/site_mobile/delay.tpl" delivery_delay=$sale->delivery_delay}
{else}
<span class="picto"></span>
{l s='Livraison estimée sous'} <br />
<span class="pink">{l s=' 3 semaines'}</span>
{/if}
</div>
<div class="info info_2">
<span class="picto"></span>
{l s='Commandez plusieurs marques'} <br />
<span class="pink">{l s='= un seul frais de port !'}</span>
</div>
<div class="info info_3">
<span class="picto"></span>
{l s='Paiement'} <span class="pink">{l s='sécurisé'}</span> <br />
{l s='Paypal & CB'}
</div>
{if isset($delivery_date)}
<div class="delivery-delay-estimation" style="margin-top: 15px;">
{foreach from=$delivery_date key=key item=date}
{if $key == 1}
<p style="text-align:center;">
<b>{$date.name}</b> : <br>{l s='Date de réception prévue entre le'} <strong>{$date.date_start|date_format:'%d/%m/%Y'}</strong> {l s='et le'} <strong>{$date.date_end|date_format:'%d/%m/%Y'}</strong>
</p>
{elseif $key == 5}
<p>
<b>{$date.name}</b> : <br>{l s='Livraison prévue avant le'} <strong>{l s='24/12'}</strong>
</p style="text-align:center;">
{/if}
{/foreach}
</div>
{/if}
</div>
{if !empty($product->description_delivery)}
{$product->description_delivery}
{/if}
</div>
</div>
{if $features}
<!-- product's features -->
<ul id="idTab8" class="bullet">