Merge branch 'ticket/r12615-domtom' into dev

This commit is contained in:
Rodney Figaro 2017-03-17 12:39:51 +01:00
commit 66b68af7bd
4 changed files with 31 additions and 7 deletions

View File

@ -26,6 +26,20 @@
class OrderController extends OrderControllerCore class OrderController extends OrderControllerCore
{ {
private function noticeWhenContainProductToExclude()
{
$restricted_product = $this->context->cart->getExcludedUPSProductNameForUPSDelivery();
if (is_array($restricted_product)) {
if ($this->context->language->id == 1) {
$txt = sprintf('"%s" est un soin qui ne peut malheureusement pas être transporté par voie aérienne. Afin de poursuivre votre commande, nous vous conseillons de le retirer de votre panier.', trim($restricted_product['name']));
}
else {
$txt = sprintf('"%s" cannot be carried by plane. We recommand to remove the product from your cart so that you can resume your order.', trim($restricted_product['name']));
}
$this->context->smarty->assign('restricted_product_txt', $txt);
}
}
private function updateCartWhenContainProductToExclude() private function updateCartWhenContainProductToExclude()
{ {
$restricted_product = $this->context->cart->getExcludedUPSProductNameForUPSDelivery(); $restricted_product = $this->context->cart->getExcludedUPSProductNameForUPSDelivery();
@ -84,11 +98,16 @@ class OrderController extends OrderControllerCore
// die(); // die();
} }
if (Tools::getValue('step')=='1') { if ((int)Tools::getValue('step', '0')<1 && !Tools::isSubmit('ajax')) {
$this->noticeWhenContainProductToExclude();
$this->removeCookieRestrictedProductText();
}
else {
$this->updateCartWhenContainProductToExclude(); $this->updateCartWhenContainProductToExclude();
}
// force option list to be refreshed // force option list to be refreshed
$this->context->smarty->assign('delivery_option_list', $this->context->cart->getDeliveryOptionList(null, true)); $this->context->smarty->assign('delivery_option_list', $this->context->cart->getDeliveryOptionList(null, true));
}
// if ($this->step == 2 && Tools::isSubmit('processCarrier')) // if ($this->step == 2 && Tools::isSubmit('processCarrier'))
// if ($this->step == 1 || ($this->step == 2 && Tools::isSubmit('processAddress'))) // if ($this->step == 1 || ($this->step == 2 && Tools::isSubmit('processAddress')))

View File

@ -143,7 +143,7 @@
</div> </div>
<div class="hook_extracarrier" id="HOOK_EXTRACARRIER_{$id_address}">{if isset($HOOK_EXTRACARRIER_ADDR) && isset($HOOK_EXTRACARRIER_ADDR.$id_address)}{$HOOK_EXTRACARRIER_ADDR.$id_address}{/if}</div> <div class="hook_extracarrier" id="HOOK_EXTRACARRIER_{$id_address}">{if isset($HOOK_EXTRACARRIER_ADDR) && isset($HOOK_EXTRACARRIER_ADDR.$id_address)}{$HOOK_EXTRACARRIER_ADDR.$id_address}{/if}</div>
{foreachelse} {foreachelse}
{if !isset($restricted_product_name)} {if !isset($restricted_product_txt)}
<p class="warning" id="noCarrierWarning"> <p class="warning" id="noCarrierWarning">
{foreach $cart->getDeliveryAddressesWithoutCarriers(true) as $address} {foreach $cart->getDeliveryAddressesWithoutCarriers(true) as $address}
{if empty($address->alias)} {if empty($address->alias)}

View File

@ -142,7 +142,7 @@
</div> </div>
<div class="hook_extracarrier" id="HOOK_EXTRACARRIER_{$id_address}">{if isset($HOOK_EXTRACARRIER_ADDR) && isset($HOOK_EXTRACARRIER_ADDR.$id_address)}{$HOOK_EXTRACARRIER_ADDR.$id_address}{/if}</div> <div class="hook_extracarrier" id="HOOK_EXTRACARRIER_{$id_address}">{if isset($HOOK_EXTRACARRIER_ADDR) && isset($HOOK_EXTRACARRIER_ADDR.$id_address)}{$HOOK_EXTRACARRIER_ADDR.$id_address}{/if}</div>
{foreachelse} {foreachelse}
{if !isset($restricted_product_name)} {if !isset($restricted_product_txt)}
<p class="warning" id="noCarrierWarning"> <p class="warning" id="noCarrierWarning">
{foreach $cart->getDeliveryAddressesWithoutCarriers(true) as $address} {foreach $cart->getDeliveryAddressesWithoutCarriers(true) as $address}
{if empty($address->alias)} {if empty($address->alias)}

View File

@ -57,6 +57,11 @@
{elseif $PS_CATALOG_MODE} {elseif $PS_CATALOG_MODE}
<p class="warning">{l s='This store has not accepted your new order.'}</p> <p class="warning">{l s='This store has not accepted your new order.'}</p>
{else} {else}
{if isset($restricted_product_txt) && $restricted_product_txt!=''}
<p class="warning" id="restricted_product_txt">
{$restricted_product_txt}
</p>
{/if}
<script type="text/javascript"> <script type="text/javascript">
// <![CDATA[ // <![CDATA[
var currencySign = '{$currencySign|html_entity_decode:2:"UTF-8"}'; var currencySign = '{$currencySign|html_entity_decode:2:"UTF-8"}';