Merge branch 'master' of gitlab.antadis.net:mobile-antadis/api-bbb

This commit is contained in:
Christophe Latour 2017-08-30 11:55:19 +02:00
commit fcbecbadff

View File

@ -20,8 +20,14 @@ class Cart extends BaseCart
$date = new \DateTime();
$delivery_date = \SaleDelay::getDeliveryDate($delays, null, $date, true);
$economy = 0;
foreach ($this->_products as $product) {
$economy += (($product['price_without_reduc'] * $product['quantity']) - $product['total_wt']);
}
return array_merge(parent::toArray(), array(
'delay' => empty($delivery_date) ? '' : $delivery_date
'delay' => empty($delivery_date) ? '' : $delivery_date,
'economy' => $economy,
));
}
}