35 lines
1.3 KiB
PHP
35 lines
1.3 KiB
PHP
<?php
|
|
|
|
|
|
class Cart extends CartCore
|
|
{
|
|
|
|
public function getOrderTotal($withTaxes = true, $type = Cart::BOTH, $products = null, $id_carrier = null, $use_cache = false, $keepOrderPrices = false, $fee_payment = false, $only_cart = false, $custom = true)
|
|
{
|
|
$total = parent::getOrderTotal($withTaxes,$type,$products,$id_carrier,$use_cache,$keepOrderPrices);
|
|
if($custom && ($type==Cart::ONLY_DISCOUNTS || $type == Cart::BOTH) && Module::isEnabled('ets_promotion'))
|
|
{
|
|
$totalDiscount = Module::getInstanceByName('ets_promotion')->getDiscountTotal($withTaxes);
|
|
if($type==Cart::ONLY_DISCOUNTS)
|
|
$total = $total+$totalDiscount;
|
|
else
|
|
$total= $total - $totalDiscount;
|
|
}
|
|
if(Module::isEnabled('ets_payment_with_fee'))
|
|
{
|
|
if($only_cart || $type!=Cart::BOTH)
|
|
return $total;
|
|
if($type== Cart::BOTH)
|
|
{
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$fee = $custom_payment->getFeePayOrderTotal($products,$withTaxes);
|
|
}
|
|
else
|
|
$fee = 0;
|
|
if($fee_payment)
|
|
return $fee;
|
|
return $fee + $total;
|
|
}
|
|
return $total;
|
|
}
|
|
} |