udpate
This commit is contained in:
56
override/classes/Cart.php
Normal file
56
override/classes/Cart.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright ETS Software Technology Co., Ltd
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This file is not open source! Each license that you purchased is only available for 1 website only.
|
||||
* If you want to use this file on more websites (or projects), you need to purchase additional licenses.
|
||||
* You are not allowed to redistribute, resell, lease, license, sub-license or offer our resources to any third party.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future.
|
||||
*
|
||||
* @author ETS Software Technology Co., Ltd
|
||||
* @copyright ETS Software Technology Co., Ltd
|
||||
* @license Valid for 1 website (or project) for each purchase of license
|
||||
*/
|
||||
|
||||
class Cart extends CartCore
|
||||
{
|
||||
/*
|
||||
* module: ets_promotion
|
||||
* date: 2023-11-25 09:55:38
|
||||
* version: 1.1.9
|
||||
*/
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user