Merge branch 'master' of gitlab.antadis.net:mobile-antadis/api-bbb
This commit is contained in:
commit
fcbecbadff
@ -20,8 +20,14 @@ class Cart extends BaseCart
|
|||||||
$date = new \DateTime();
|
$date = new \DateTime();
|
||||||
$delivery_date = \SaleDelay::getDeliveryDate($delays, null, $date, true);
|
$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(
|
return array_merge(parent::toArray(), array(
|
||||||
'delay' => empty($delivery_date) ? '' : $delivery_date
|
'delay' => empty($delivery_date) ? '' : $delivery_date,
|
||||||
|
'economy' => $economy,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user