fix conflict css

This commit is contained in:
Marion Muszynski 2016-05-13 13:33:44 +02:00
commit 44829771cf
6 changed files with 255 additions and 86 deletions

View File

@ -3,21 +3,30 @@ class OrderController extends OrderControllerCore {
public function preProcess() {
global $isVirtualCart, $orderTotal;
// Bloque les canaries ES
if ($this->step == 2) {
if($this->step == 2 && !Tools::getValue('ajax')){
// Bloque les canaries ES
$delivery = new Address(self::$cart->id_address_delivery);
$prefix_postcode = substr($delivery->postcode, 0 ,2);
if ($delivery->id_country == 6
&& (intval($prefix_postcode) == 35 || intval($prefix_postcode) == 38)
) {
//$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.');
$this->step = 1;
Tools::redirect('order.php?step=1&canaries=1');
}
}
if (Tools::getValue('canaries')) {
$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 DOM-TOM
$prefix_postcode = substr($delivery->postcode, 0 ,3);
$domtom = array(971,972,973,974,975,976,984,986,987,988);
if ($delivery->id_country == 8 && (in_array(intval($prefix_postcode),$domtom))
) {
//$this->errors[] = Tools::displayError('Nous sommes désolé, nous ne livrons pas dans le DOM-TOM');
$this->step = 1;
Tools::redirect('order.php?step=1&domtom=1');
}
}
if(Module::isInstalled('privatesales')) {
$removed = FALSE;
@ -223,4 +232,53 @@ class OrderController extends OrderControllerCore {
$this->processCarrier();
}
}
/*
* Manage address
*/
public function processAddress()
{
if (!Tools::isSubmit('id_address_delivery') OR !Address::isCountryActiveById((int)Tools::getValue('id_address_delivery')))
$this->errors[] = Tools::displayError('This address is not in a valid area.');
else
{
self::$cart->id_address_delivery = (int)(Tools::getValue('id_address_delivery'));
self::$cart->id_address_invoice = Tools::isSubmit('same') ? self::$cart->id_address_delivery : (int)(Tools::getValue('id_address_invoice'));
if (!self::$cart->update())
$this->errors[] = Tools::displayError('An error occurred while updating your cart.');
if (Tools::isSubmit('message'))
$this->_updateMessage(Tools::getValue('message'));
if (Tools::getValue('ajax')) {
// Bloque les canaries ES
$delivery = new Address(self::$cart->id_address_delivery);
$prefix_postcode = substr($delivery->postcode, 0 ,2);
if ($delivery->id_country == 6
&& (intval($prefix_postcode) == 35 || intval($prefix_postcode) == 38)
) {
$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 DOM-TOM
$prefix_postcode = substr($delivery->postcode, 0 ,3);
$domtom = array(971,972,973,974,975,976,984,986,987,988);
if ($delivery->id_country == 8 && (in_array(intval($prefix_postcode),$domtom))
) {
$this->errors[] = Tools::displayError('Nous sommes désolé, nous ne livrons pas dans le DOM-TOM');
}
}
}
if (sizeof($this->errors))
{
if (Tools::getValue('ajax'))
die('{"hasError" : true, "errors" : ["'.implode('\',\'', $this->errors).'"]}');
$this->step = 1;
}
if (Tools::getValue('ajax'))
die(true);
}
}

View File

@ -160,17 +160,35 @@ class ParentOrderController extends ParentOrderControllerCore {
} else {
$carriers = $_carriers;
}
}
}
}
self::$smarty->assign(array(
'checked' => $this->_setDefaultCarrierSelection($carriers),
'carriers' => $carriers,
'carrier_shipping_cost' => $carrier_shipping_cost ? $carrier_shipping_cost:0,
'sale_delivery' => array_unique($sale_delivery),
'default_carrier' => (int)(Configuration::get('PS_CARRIER_DEFAULT'))
));
// distinction "at home" et "out of home"
$carriers_ah = array();
$carriers_ooh = array();
if(_THEME_NAME_ != "site_mobile") {
// $config_carrier_ooh = array(47,48); // prod
$config_carrier_ooh = array(40,45); // dev
foreach ($carriers as $carrier) {
if (in_array($carrier['id_carrier'], $config_carrier_ooh) ){
$carriers_ooh[] = $carrier;
} else {
$carriers_ah[] = $carrier;
}
}
unset($carriers);
$carriers = $carriers_ah;
}
}
}
}
self::$smarty->assign(array(
'checked' => $this->_setDefaultCarrierSelection($carriers),
'carriers' => $carriers,
'carriers_ooh' => $carriers_ooh,
'carrier_shipping_cost' => $carrier_shipping_cost ? $carrier_shipping_cost:0,
'sale_delivery' => array_unique($sale_delivery),
'default_carrier' => (int)(Configuration::get('PS_CARRIER_DEFAULT'))
));
self::$smarty->assign(array(
'HOOK_EXTRACARRIER' => Module::hookExec('extraCarrier', array('address' => $address)),
'HOOK_BEFORECARRIER' => Module::hookExec('beforeCarrier', array('carriers' => $carriers))

View File

@ -3215,6 +3215,10 @@ table.std tfoot tr.cart_total_price.endline td, #block-order-detail tr.endline t
#order td.carrier_price {
width: 90px;
}
#carrierTable tr.item,
#carrierTable tr.alternate_item {
background: #fff;
}
#cms .rte {
padding-left: 20px;
}
@ -6194,6 +6198,25 @@ div#giftvoucher_ask_infos_block .gv_customization > .gv_param input {
background: url('../img/picto_account.png') no-repeat 75px 11px #fff;
}
h3.carrier_title{
margin-bottom: 10px;
}
table#carrierTable tbody td {
color: #444d52;
font-size: 12px;
border-bottom: 0px;
border-top: 10px solid #f1f1f1;
background: #FFF;
line-height: 1.5em;
padding: 5px 10px;
}
#carrierTable thead {
background-color: #514c8c;
}
#carrierTable thead tr th{
color: #fff;
}
@keyframes slideInDown {
0% {

View File

@ -164,6 +164,18 @@
<h1>{l s='Addresses'}</h1>
{include file="$tpl_dir./errors.tpl"}
{if $smarty.get.domtom || $smarty.get.canaries}
<div class="error">
<p>{l s='There is'}{l s='error'} :</p>
<ol>
{if $smarty.get.domtom}
<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>
{/if}
</ol>
</div>
{/if}
<form action="{$link->getPageLink($back_order_page, true)}" method="post">
{else}
<h2>1. {l s='Addresses'}</h2>

View File

@ -115,78 +115,126 @@
{/if}
<p class="warning" id="noCarrierWarning" {if isset($carriers) && $carriers && count($carriers)}style="display:none;"{/if}>{l s='There are no carriers available that deliver to this address.'}</p>
<table id="carrierTable" class="std" {if !isset($carriers) || !$carriers || !count($carriers)}style="display:none;"{/if}>
<thead>
<tr>
<th class="carrier_action first_item"></th>
<th class="carrier_name item">{l s='Carrier'}</th>
<th class="carrier_infos item">{l s='Information'}</th>
<th class="carrier_price last_item">{l s='Price'}</th>
</tr>
</thead>
<thead>
<tr>
<th class="carrier_action first_item" colspan="2">{l s='At home'}</th>
{*<th class="carrier_name item">{l s='Carrier'}</th>*}
<th class="carrier_infos item">{l s='Information'}</th>
<th class="carrier_price last_item">{l s='Price'}</th>
</tr>
</thead>
<tbody>
{if isset($carriers)}
{foreach from=$carriers item=carrier name=myLoop}
<tr class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{/if} {if $smarty.foreach.myLoop.index % 2}alternate_item{else}item{/if}">
<td class="carrier_action radio">
<input type="radio" name="id_carrier" value="{$carrier.id_carrier|intval}" id="id_carrier{$carrier.id_carrier|intval}" {if $opc}onclick="updateCarrierSelectionAndGift();"{/if} {if !($carrier.is_module AND $opc AND !$isLogged)}{if $carrier.id_carrier == $checked}checked="checked"{/if}{else}disabled="disabled"{/if} />
</td>
<td class="carrier_name">
<label for="id_carrier{$carrier.id_carrier|intval}">
{if $only_gifts}E-mail{else}
{if $carrier.img}
{if $cookie->id_lang == 3}
<img src="/img/s/es.png" alt="{$carrier.name|escape:'htmlall':'UTF-8'}" />
{else}
<img src="{$carrier.img|escape:'htmlall':'UTF-8'}" alt="{$carrier.name|escape:'htmlall':'UTF-8'}" />
{/if}
{else}
{$carrier.name|escape:'htmlall':'UTF-8'}
{/if}
{/if}
</label>
</td>
<td class="carrier_infos">{if $only_gifts}Si vous l'avez personnalisé, votre chèque cadeau sera envoyé par e-mail à son bénéficiaire, sinon vous le recevrez{else}
{if count($sale_delivery) > 1}
{l s='Délai de livraison multiple :'}
{/if}
<ul>
{if in_array(1,$sale_delivery)}
<li>{l s='Délai de livraison prévisionnel de 3 semaines'}</li>
{/if}
{if in_array(2,$sale_delivery)}
<li>{l s='Délai de livraison sous 48h'}</li>
{/if}
{if in_array(3,$sale_delivery)}
<li>{l s='Délai de livraison sous 7 jours'}</li>
{/if}
{if in_array(4,$sale_delivery)}
<li>{l s='Délai de livraison sous 10 jours'}</li>
{/if}
{if in_array(5,$sale_delivery)}
<li>{l s='Livraison avant Noël'}</li>
{/if}
{if in_array(6,$sale_delivery)}
<li>{l s='Produit Star - Livraison 48h'}</li>
{/if}
</ul>
{/if}
</td>
<td class="carrier_price">
{if $carrier.price}
<span class="price">
{if $priceDisplay == 1}{convertPrice price=$carrier.price_tax_exc}{else}{convertPrice price=$carrier.price}{/if}
</span>
{if $use_taxes}{if $priceDisplay == 1} {l s='(tax excl.)'}{else} {l s='(tax incl.)'}{/if}{/if}
{else}
{l s='Free!'}
{/if}
</td>
</tr>
{/foreach}
<tr id="HOOK_EXTRACARRIER">{$HOOK_EXTRACARRIER}</tr>
{/if}
</tbody>
</table>
{foreach from=$carriers item=carrier name=myLoop}
<tr class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{/if} {if $smarty.foreach.myLoop.index % 2}alternate_item{else}item{/if}">
<td class="carrier_action radio">
<input type="radio" name="id_carrier" value="{$carrier.id_carrier|intval}" id="id_carrier{$carrier.id_carrier|intval}" {if $opc}onclick="updateCarrierSelectionAndGift();"{/if} {if !($carrier.is_module AND $opc AND !$isLogged)}{if $carrier.id_carrier == $checked}checked="checked"{/if}{else}disabled="disabled"{/if} />
</td>
<td class="carrier_name">
<label for="id_carrier{$carrier.id_carrier|intval}">
{if $only_gifts}E-mail{else}
{if $carrier.img}
{if $cookie->id_lang == 3}
<img src="/img/s/es.png" alt="{$carrier.name|escape:'htmlall':'UTF-8'}" />
{else}
<img src="{$carrier.img|escape:'htmlall':'UTF-8'}" alt="{$carrier.name|escape:'htmlall':'UTF-8'}" />
{/if}
{else}
{$carrier.name|escape:'htmlall':'UTF-8'}
{/if}
{/if}
</label>
</td>
<td class="carrier_infos">{if $only_gifts}Si vous l'avez personnalisé, votre chèque cadeau sera envoyé par e-mail à son bénéficiaire, sinon vous le recevrez{else}
{$carrier.delay}
{*{if count($sale_delivery) > 1}
{l s='Délai de livraison multiple :'}
{/if}
<ul>
{if in_array(1,$sale_delivery)}
<li>{l s='Délai de livraison prévisionnel de 3 semaines'}</li>
{/if}
{if in_array(2,$sale_delivery)}
<li>{l s='Délai de livraison sous 48h'}</li>
{/if}
{if in_array(3,$sale_delivery)}
<li>{l s='Délai de livraison sous 7 jours'}</li>
{/if}
{if in_array(4,$sale_delivery)}
<li>{l s='Délai de livraison sous 10 jours'}</li>
{/if}
{if in_array(5,$sale_delivery)}
<li>{l s='Livraison avant Noël'}</li>
{/if}
{if in_array(6,$sale_delivery)}
<li>{l s='Produit Star - Livraison 48h'}</li>
{/if}
</ul>*}
{/if}
</td>
<td class="carrier_price">
{if $carrier.price}
<span class="price">
{if $priceDisplay == 1}{convertPrice price=$carrier.price_tax_exc}{else}{convertPrice price=$carrier.price}{/if}
</span>
{if $use_taxes}{if $priceDisplay == 1} {l s='(tax excl.)'}{else} {l s='(tax incl.)'}{/if}{/if}
{else}
{l s='Free!'}
{/if}
</td>
</tr>
{/foreach}
<tr id="HOOK_EXTRACARRIER">{$HOOK_EXTRACARRIER}</tr>
{/if}
</tbody>
{if count($carriers_ooh) > 0}
<thead>
<tr>
<th class="carrier_action first_item" colspan="2" style="border-top: 20px solid #f1f1f1;">{l s='At a relay point'}</th>
<th class="carrier_infos item" style="border-top: 20px solid #f1f1f1;">{l s='Information'}</th>
<th class="carrier_price last_item" style="border-top: 20px solid #f1f1f1;">{l s='Price'}</th>
</tr>
</thead>
<tbody>
{foreach from=$carriers_ooh item=carrier name=myLoop}
<tr class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{/if} {if $smarty.foreach.myLoop.index % 2}alternate_item{else}item{/if}">
<td class="carrier_action radio">
<input type="radio" name="id_carrier" value="{$carrier.id_carrier|intval}" id="id_carrier{$carrier.id_carrier|intval}" {if $opc}onclick="updateCarrierSelectionAndGift();"{/if} {if !($carrier.is_module AND $opc AND !$isLogged)}{if $carrier.id_carrier == $checked}checked="checked"{/if}{else}disabled="disabled"{/if} />
</td>
<td class="carrier_name">
<label for="id_carrier{$carrier.id_carrier|intval}">
{if $only_gifts}E-mail{else}
{if $carrier.img}
{if $cookie->id_lang == 3}
<img src="/img/s/es.png" alt="{$carrier.name|escape:'htmlall':'UTF-8'}" />
{else}
<img src="{$carrier.img|escape:'htmlall':'UTF-8'}" alt="{$carrier.name|escape:'htmlall':'UTF-8'}" />
{/if}
{else}
{$carrier.name|escape:'htmlall':'UTF-8'}
{/if}
{/if}
</label>
</td>
<td class="carrier_infos">{if $only_gifts}Si vous l'avez personnalisé, votre chèque cadeau sera envoyé par e-mail à son bénéficiaire, sinon vous le recevrez{else}
{$carrier.delay}
{/if}
</td>
<td class="carrier_price">
{if $carrier.price}
<span class="price">
{if $priceDisplay == 1}{convertPrice price=$carrier.price_tax_exc}{else}{convertPrice price=$carrier.price}{/if}
</span>
{if $use_taxes}{if $priceDisplay == 1} {l s='(tax excl.)'}{else} {l s='(tax incl.)'}{/if}{/if}
{else}
{l s='Free!'}
{/if}
</td>
</tr>
{/foreach}
</tbody>
{/if}
</table>
<div style="display: none;" id="extra_carrier"></div>
{if $giftAllowed}

View File

@ -2788,10 +2788,20 @@ body#order p.checkbox{
display: table-row;
font-size:13px;
}
#soflexibilite_description_address { padding: 10px;}
#soflexibilite_description_address h3 { font-size: 12px; margin-bottom: 0;}
#soflexibilite_speech{ font-size: 12px; width: auto !important}
.so-bold{ font-weight: normal !important; height: auto !important;}
#table_so_info input, #infofofo input{ width: 100% !important;}
body#order table#carrierTable{
font-size:13px;
margin-bottom:20px;
}
body#order table#carrierTable tr {
margin-bottom: 10px;
}
body#order table#carrierTable tbody tr,
body#order table#carrierTable tbody tr td{
border:0px none;