Merge branch 'ticket-deliveryDelay_cart' into develop

This commit is contained in:
Marion Muszynski 2016-07-13 17:41:53 +02:00
commit 64a8296a57
2 changed files with 28 additions and 3 deletions

View File

@ -3,6 +3,21 @@ class OrderController extends OrderControllerCore {
public function preProcess() {
global $isVirtualCart, $orderTotal;
if($this->step == 0 && !Tools::getValue('ajax') && Module::isInstalled('privatesales_delay')) {
// assign delay to Products
if (!class_exists('SaleDelay')) {
require_once dirname(__FILE__).'/../../modules/privatesales_delay/saledelay.php';
}
$products_delay = SaleDelay::associateDelay(self::$cart->getProducts());
$delays = array_keys($products_delay);
$date = new DateTime();
$delivery_date = SaleDelay::getDeliveryDate($delays, null, $date);
self::$smarty->assign(array(
'delivery_date' => (!empty($delivery_date)?$delivery_date:null),
));
}
if($this->step == 2 && !Tools::getValue('ajax')){
// Bloque les canaries ES
$delivery = new Address(self::$cart->id_address_delivery);

View File

@ -212,14 +212,24 @@
{assign var='economy' value=0}
{assign var='strike_price' value=0}
{foreach from=$products item=details}
{foreach from=$products item=details key=k}
<tr style="height:10px;">
<td colspan="5" style="border:none"></td>
</tr>
<tr style="background:#e1e1e1;" class="delivery_delay_cart">
<td colspan="5">
<h4>{$details.title}</h4>
<h4>{$details.title}
{if isset($delivery_date)}
{foreach from=$delivery_date item=date key=key}
{if $k == $key}
<span>
- {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>
</span>
{/if}
{/foreach}
{/if}
</h4>
</td>
</tr>
<tr style="height:10px;">