3110 lines
121 KiB
Plaintext
3110 lines
121 KiB
Plaintext
|
|
|
|
class CartOverrideOriginal_remove64d35ddbd61cd extends \stdClass
|
|
{
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageShippingCost($id_carrier = null, $use_tax = true, Country $default_country = null, $product_list = null, $id_zone = null,bool $keepOrderPrices=false,$default=false)
|
|
{
|
|
if($IDzone = (int)Hook::exec('actionGetIDZoneByAddressID'))
|
|
{
|
|
$id_zone = $IDzone;
|
|
}
|
|
if (null === $product_list) {
|
|
$products = $this->getProducts(false, false, null, true);
|
|
} else {
|
|
$products = $product_list;
|
|
}
|
|
if(Module::isEnabled('ets_marketplace') && ($marketplace = Module::getInstanceByName('ets_marketplace')) && $sellers = $marketplace->checkMultiSellerProductList($products))
|
|
{
|
|
$shipping_cost = 0;
|
|
foreach($sellers as $seller)
|
|
{
|
|
$is_virtual= true;
|
|
if($seller)
|
|
{
|
|
foreach($seller as $p)
|
|
{
|
|
if(!$p['is_virtual'])
|
|
{
|
|
$is_virtual = false;
|
|
}
|
|
}
|
|
}
|
|
if(($price=parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$seller,$id_zone,$keepOrderPrices))===false && !$is_virtual)
|
|
return false;
|
|
$shipping_cost += $is_virtual ? 0 : ( $price? :0);
|
|
}
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
else {
|
|
$shipping_cost = parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$products,$id_zone,$keepOrderPrices);
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageList($flush = false)
|
|
{
|
|
if(($address_type = Tools::getValue('address_type')) && $address_type=='shipping_address')
|
|
$this->id_address_delivery = (int)Tools::getValue('id_address',$this->id_address_delivery);
|
|
$final_package_list = parent::getPackageList($flush);
|
|
if($final_package_list)
|
|
{
|
|
foreach($final_package_list as $final_packages)
|
|
{
|
|
foreach($final_packages as $final_package)
|
|
{
|
|
if(!$final_package['carrier_list'] || ($final_package['carrier_list'] && isset($final_package['carrier_list'][0]) && $final_package['carrier_list'][0]===0))
|
|
{
|
|
return array();
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
return $final_package_list;
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getDeliveryOptionList(Country $default_country = null, $flush = false)
|
|
{
|
|
$products = $this->getProducts(false, false, null, true);
|
|
$marketplace = Module::getInstanceByName('ets_marketplace');
|
|
if($marketplace->checkMultiSellerProductList($products) && $marketplace->is17 && Configuration::get('ETS_MP_ENABLE_MULTI_SHIPPING'))
|
|
{
|
|
$delivery_option_list = $marketplace->getDeliveryOptionList($default_country,$flush);
|
|
return $delivery_option_list;
|
|
}
|
|
else
|
|
{
|
|
$delivery_option_list = parent::getDeliveryOptionList($default_country,$flush);
|
|
return $marketplace->changeDeliveryOptionList($delivery_option_list);
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:13
|
|
* version: 1.1.7
|
|
*/
|
|
public $_products;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:13
|
|
* version: 1.1.7
|
|
*/
|
|
public $shouldSplitGiftProductsQuantity ;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:13
|
|
* version: 1.1.7
|
|
*/
|
|
public function applyProductCalculations($row, $shopContext, $productQuantity = null, bool $keepOrderPrices = false)
|
|
{
|
|
return parent::applyProductCalculations($row,$shopContext,$productQuantity,$keepOrderPrices);
|
|
}
|
|
/*
|
|
* module: ets_payment_with_fee
|
|
* date: 2023-08-09 04:28:09
|
|
* version: 2.4.0
|
|
*/
|
|
public function getProducts($refresh = false, $id_product = false, $id_country = null, $fullInfos = true, bool $keepOrderPrices = false,$default=false)
|
|
{
|
|
if($keepOrderPrices || $default || !Module::isEnabled('ets_extraoptions'))
|
|
{
|
|
$products = parent::getProducts($refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($products);
|
|
return $products;
|
|
}
|
|
else
|
|
{
|
|
$this->_products = Module::getInstanceByName('ets_extraoptions')->getProducts($this,$refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($this->_products);
|
|
return $this->_products;
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_payment_with_fee
|
|
* date: 2023-08-09 05:24:23
|
|
* version: 2.4.0
|
|
*/
|
|
public function getOrderTotal(
|
|
$withTaxes = true,
|
|
$type = Cart::BOTH,
|
|
$products = null,
|
|
$id_carrier = null,
|
|
$use_cache = false,
|
|
bool $keepOrderPrices = false,
|
|
$fee_payment = false,
|
|
$only_cart = false
|
|
){
|
|
$total = parent::getOrderTotal($withTaxes,$type,$products,$id_carrier,$use_cache,$keepOrderPrices);
|
|
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;
|
|
}
|
|
}
|
|
|
|
|
|
class CartOverrideOriginal_remove64d35ddc06b2e extends \stdClass
|
|
{
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageShippingCost($id_carrier = null, $use_tax = true, Country $default_country = null, $product_list = null, $id_zone = null,bool $keepOrderPrices=false,$default=false)
|
|
{
|
|
if($IDzone = (int)Hook::exec('actionGetIDZoneByAddressID'))
|
|
{
|
|
$id_zone = $IDzone;
|
|
}
|
|
if (null === $product_list) {
|
|
$products = $this->getProducts(false, false, null, true);
|
|
} else {
|
|
$products = $product_list;
|
|
}
|
|
if(Module::isEnabled('ets_marketplace') && ($marketplace = Module::getInstanceByName('ets_marketplace')) && $sellers = $marketplace->checkMultiSellerProductList($products))
|
|
{
|
|
$shipping_cost = 0;
|
|
foreach($sellers as $seller)
|
|
{
|
|
$is_virtual= true;
|
|
if($seller)
|
|
{
|
|
foreach($seller as $p)
|
|
{
|
|
if(!$p['is_virtual'])
|
|
{
|
|
$is_virtual = false;
|
|
}
|
|
}
|
|
}
|
|
if(($price=parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$seller,$id_zone,$keepOrderPrices))===false && !$is_virtual)
|
|
return false;
|
|
$shipping_cost += $is_virtual ? 0 : ( $price? :0);
|
|
}
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
else {
|
|
$shipping_cost = parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$products,$id_zone,$keepOrderPrices);
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageList($flush = false)
|
|
{
|
|
if(($address_type = Tools::getValue('address_type')) && $address_type=='shipping_address')
|
|
$this->id_address_delivery = (int)Tools::getValue('id_address',$this->id_address_delivery);
|
|
$final_package_list = parent::getPackageList($flush);
|
|
if($final_package_list)
|
|
{
|
|
foreach($final_package_list as $final_packages)
|
|
{
|
|
foreach($final_packages as $final_package)
|
|
{
|
|
if(!$final_package['carrier_list'] || ($final_package['carrier_list'] && isset($final_package['carrier_list'][0]) && $final_package['carrier_list'][0]===0))
|
|
{
|
|
return array();
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
return $final_package_list;
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getDeliveryOptionList(Country $default_country = null, $flush = false)
|
|
{
|
|
$products = $this->getProducts(false, false, null, true);
|
|
$marketplace = Module::getInstanceByName('ets_marketplace');
|
|
if($marketplace->checkMultiSellerProductList($products) && $marketplace->is17 && Configuration::get('ETS_MP_ENABLE_MULTI_SHIPPING'))
|
|
{
|
|
$delivery_option_list = $marketplace->getDeliveryOptionList($default_country,$flush);
|
|
return $delivery_option_list;
|
|
}
|
|
else
|
|
{
|
|
$delivery_option_list = parent::getDeliveryOptionList($default_country,$flush);
|
|
return $marketplace->changeDeliveryOptionList($delivery_option_list);
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:13
|
|
* version: 1.1.7
|
|
*/
|
|
public $_products;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:13
|
|
* version: 1.1.7
|
|
*/
|
|
public $shouldSplitGiftProductsQuantity ;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:13
|
|
* version: 1.1.7
|
|
*/
|
|
public function applyProductCalculations($row, $shopContext, $productQuantity = null, bool $keepOrderPrices = false)
|
|
{
|
|
return parent::applyProductCalculations($row,$shopContext,$productQuantity,$keepOrderPrices);
|
|
}
|
|
/*
|
|
* module: ets_payment_with_fee
|
|
* date: 2023-08-09 04:28:09
|
|
* version: 2.4.0
|
|
*/
|
|
public function getProducts($refresh = false, $id_product = false, $id_country = null, $fullInfos = true, bool $keepOrderPrices = false,$default=false)
|
|
{
|
|
if($keepOrderPrices || $default || !Module::isEnabled('ets_extraoptions'))
|
|
{
|
|
$products = parent::getProducts($refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($products);
|
|
return $products;
|
|
}
|
|
else
|
|
{
|
|
$this->_products = Module::getInstanceByName('ets_extraoptions')->getProducts($this,$refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($this->_products);
|
|
return $this->_products;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
class CartControllerOverrideOriginal_remove64d35ddc2b071 extends \stdClass
|
|
{
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:14
|
|
* version: 1.1.7
|
|
*/
|
|
public function processChangeProductInCart()
|
|
{
|
|
|
|
$module = null;
|
|
if(Module::isEnabled('ets_extraoptions'))
|
|
$module = Module::getInstanceByName('ets_extraoptions');
|
|
if ($module)
|
|
$module->validateAddCustomAttributeToCart($this->errors, $this->id_product);
|
|
parent::processChangeProductInCart();
|
|
if ($module && !$this->errors)
|
|
$module->postAddCustomAttributeToCart($this->id_product, $this->id_product_attribute, $this->qty, $this->customization_id);
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:14
|
|
* version: 1.1.7
|
|
*/
|
|
public function productInCartMatchesCriteria($productInCart)
|
|
{
|
|
return (
|
|
!isset($this->id_product_attribute) ||
|
|
(
|
|
$productInCart['id_product_attribute'] == $this->id_product_attribute &&
|
|
$productInCart['id_customization'] == $this->customization_id
|
|
)
|
|
) && isset($this->id_product) && $productInCart['id_product'] == $this->id_product && (!isset($productInCart['id_combination']) || $productInCart['id_combination']==(int)Tools::getValue('id_combination'));
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:24:23
|
|
* version: 1.1.7
|
|
*/
|
|
public function displayAjaxRefresh()
|
|
{
|
|
if (Configuration::isCatalogMode()) {
|
|
return;
|
|
}
|
|
ob_end_clean();
|
|
header('Content-Type: application/json');
|
|
$this->ajaxRender(json_encode([
|
|
'cart_detailed' => $this->context->smarty->fetch(_PS_MODULE_DIR_.'ets_extraoptions/views/templates/hook/checkout/cart-detailed.tpl'),
|
|
'cart_detailed_totals' => $this->render('checkout/_partials/cart-detailed-totals'),
|
|
'cart_summary_items_subtotal' => $this->render('checkout/_partials/cart-summary-items-subtotal'),
|
|
'cart_summary_subtotals_container' => $this->render('checkout/_partials/cart-summary-subtotals'),
|
|
'cart_summary_totals' => $this->render('checkout/_partials/cart-summary-totals'),
|
|
'cart_detailed_actions' => $this->render('checkout/_partials/cart-detailed-actions'),
|
|
'cart_voucher' => $this->render('checkout/_partials/cart-voucher'),
|
|
]));
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:24:23
|
|
* version: 1.1.7
|
|
*/
|
|
public function displayAjaxRefresh()
|
|
{
|
|
if (Configuration::isCatalogMode()) {
|
|
return;
|
|
}
|
|
ob_end_clean();
|
|
header('Content-Type: application/json');
|
|
$this->ajaxRender(json_encode([
|
|
'cart_detailed' => $this->context->smarty->fetch(_PS_MODULE_DIR_.'ets_extraoptions/views/templates/hook/checkout/cart-detailed.tpl'),
|
|
'cart_detailed_totals' => $this->render('checkout/_partials/cart-detailed-totals'),
|
|
'cart_summary_items_subtotal' => $this->render('checkout/_partials/cart-summary-items-subtotal'),
|
|
'cart_summary_subtotals_container' => $this->render('checkout/_partials/cart-summary-subtotals'),
|
|
'cart_summary_totals' => $this->render('checkout/_partials/cart-summary-totals'),
|
|
'cart_detailed_actions' => $this->render('checkout/_partials/cart-detailed-actions'),
|
|
'cart_voucher' => $this->render('checkout/_partials/cart-voucher'),
|
|
]));
|
|
}
|
|
}
|
|
|
|
|
|
class CartOverrideOriginal_remove64d35e06358c4 extends \stdClass
|
|
{
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageShippingCost($id_carrier = null, $use_tax = true, Country $default_country = null, $product_list = null, $id_zone = null,bool $keepOrderPrices=false,$default=false)
|
|
{
|
|
if($IDzone = (int)Hook::exec('actionGetIDZoneByAddressID'))
|
|
{
|
|
$id_zone = $IDzone;
|
|
}
|
|
if (null === $product_list) {
|
|
$products = $this->getProducts(false, false, null, true);
|
|
} else {
|
|
$products = $product_list;
|
|
}
|
|
if(Module::isEnabled('ets_marketplace') && ($marketplace = Module::getInstanceByName('ets_marketplace')) && $sellers = $marketplace->checkMultiSellerProductList($products))
|
|
{
|
|
$shipping_cost = 0;
|
|
foreach($sellers as $seller)
|
|
{
|
|
$is_virtual= true;
|
|
if($seller)
|
|
{
|
|
foreach($seller as $p)
|
|
{
|
|
if(!$p['is_virtual'])
|
|
{
|
|
$is_virtual = false;
|
|
}
|
|
}
|
|
}
|
|
if(($price=parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$seller,$id_zone,$keepOrderPrices))===false && !$is_virtual)
|
|
return false;
|
|
$shipping_cost += $is_virtual ? 0 : ( $price? :0);
|
|
}
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
else {
|
|
$shipping_cost = parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$products,$id_zone,$keepOrderPrices);
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageList($flush = false)
|
|
{
|
|
if(($address_type = Tools::getValue('address_type')) && $address_type=='shipping_address')
|
|
$this->id_address_delivery = (int)Tools::getValue('id_address',$this->id_address_delivery);
|
|
$final_package_list = parent::getPackageList($flush);
|
|
if($final_package_list)
|
|
{
|
|
foreach($final_package_list as $final_packages)
|
|
{
|
|
foreach($final_packages as $final_package)
|
|
{
|
|
if(!$final_package['carrier_list'] || ($final_package['carrier_list'] && isset($final_package['carrier_list'][0]) && $final_package['carrier_list'][0]===0))
|
|
{
|
|
return array();
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
return $final_package_list;
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getDeliveryOptionList(Country $default_country = null, $flush = false)
|
|
{
|
|
$products = $this->getProducts(false, false, null, true);
|
|
$marketplace = Module::getInstanceByName('ets_marketplace');
|
|
if($marketplace->checkMultiSellerProductList($products) && $marketplace->is17 && Configuration::get('ETS_MP_ENABLE_MULTI_SHIPPING'))
|
|
{
|
|
$delivery_option_list = $marketplace->getDeliveryOptionList($default_country,$flush);
|
|
return $delivery_option_list;
|
|
}
|
|
else
|
|
{
|
|
$delivery_option_list = parent::getDeliveryOptionList($default_country,$flush);
|
|
return $marketplace->changeDeliveryOptionList($delivery_option_list);
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:13
|
|
* version: 1.1.7
|
|
*/
|
|
public $_products;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:13
|
|
* version: 1.1.7
|
|
*/
|
|
public $shouldSplitGiftProductsQuantity ;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:13
|
|
* version: 1.1.7
|
|
*/
|
|
public function applyProductCalculations($row, $shopContext, $productQuantity = null, bool $keepOrderPrices = false)
|
|
{
|
|
return parent::applyProductCalculations($row,$shopContext,$productQuantity,$keepOrderPrices);
|
|
}
|
|
/*
|
|
* module: ets_payment_with_fee
|
|
* date: 2023-08-09 04:28:09
|
|
* version: 2.4.0
|
|
*/
|
|
public function getProducts($refresh = false, $id_product = false, $id_country = null, $fullInfos = true, bool $keepOrderPrices = false,$default=false)
|
|
{
|
|
if($keepOrderPrices || $default || !Module::isEnabled('ets_extraoptions'))
|
|
{
|
|
$products = parent::getProducts($refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($products);
|
|
return $products;
|
|
}
|
|
else
|
|
{
|
|
$this->_products = Module::getInstanceByName('ets_extraoptions')->getProducts($this,$refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($this->_products);
|
|
return $this->_products;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
class CartOverrideOriginal_remove64d35e0659c71 extends \stdClass
|
|
{
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageShippingCost($id_carrier = null, $use_tax = true, Country $default_country = null, $product_list = null, $id_zone = null,bool $keepOrderPrices=false,$default=false)
|
|
{
|
|
if($IDzone = (int)Hook::exec('actionGetIDZoneByAddressID'))
|
|
{
|
|
$id_zone = $IDzone;
|
|
}
|
|
if (null === $product_list) {
|
|
$products = $this->getProducts(false, false, null, true);
|
|
} else {
|
|
$products = $product_list;
|
|
}
|
|
if(Module::isEnabled('ets_marketplace') && ($marketplace = Module::getInstanceByName('ets_marketplace')) && $sellers = $marketplace->checkMultiSellerProductList($products))
|
|
{
|
|
$shipping_cost = 0;
|
|
foreach($sellers as $seller)
|
|
{
|
|
$is_virtual= true;
|
|
if($seller)
|
|
{
|
|
foreach($seller as $p)
|
|
{
|
|
if(!$p['is_virtual'])
|
|
{
|
|
$is_virtual = false;
|
|
}
|
|
}
|
|
}
|
|
if(($price=parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$seller,$id_zone,$keepOrderPrices))===false && !$is_virtual)
|
|
return false;
|
|
$shipping_cost += $is_virtual ? 0 : ( $price? :0);
|
|
}
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
else {
|
|
$shipping_cost = parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$products,$id_zone,$keepOrderPrices);
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageList($flush = false)
|
|
{
|
|
if(($address_type = Tools::getValue('address_type')) && $address_type=='shipping_address')
|
|
$this->id_address_delivery = (int)Tools::getValue('id_address',$this->id_address_delivery);
|
|
$final_package_list = parent::getPackageList($flush);
|
|
if($final_package_list)
|
|
{
|
|
foreach($final_package_list as $final_packages)
|
|
{
|
|
foreach($final_packages as $final_package)
|
|
{
|
|
if(!$final_package['carrier_list'] || ($final_package['carrier_list'] && isset($final_package['carrier_list'][0]) && $final_package['carrier_list'][0]===0))
|
|
{
|
|
return array();
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
return $final_package_list;
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getDeliveryOptionList(Country $default_country = null, $flush = false)
|
|
{
|
|
$products = $this->getProducts(false, false, null, true);
|
|
$marketplace = Module::getInstanceByName('ets_marketplace');
|
|
if($marketplace->checkMultiSellerProductList($products) && $marketplace->is17 && Configuration::get('ETS_MP_ENABLE_MULTI_SHIPPING'))
|
|
{
|
|
$delivery_option_list = $marketplace->getDeliveryOptionList($default_country,$flush);
|
|
return $delivery_option_list;
|
|
}
|
|
else
|
|
{
|
|
$delivery_option_list = parent::getDeliveryOptionList($default_country,$flush);
|
|
return $marketplace->changeDeliveryOptionList($delivery_option_list);
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:13
|
|
* version: 1.1.7
|
|
*/
|
|
public $_products;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:13
|
|
* version: 1.1.7
|
|
*/
|
|
public $shouldSplitGiftProductsQuantity ;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:13
|
|
* version: 1.1.7
|
|
*/
|
|
public function applyProductCalculations($row, $shopContext, $productQuantity = null, bool $keepOrderPrices = false)
|
|
{
|
|
return parent::applyProductCalculations($row,$shopContext,$productQuantity,$keepOrderPrices);
|
|
}
|
|
/*
|
|
* module: ets_payment_with_fee
|
|
* date: 2023-08-09 04:28:09
|
|
* version: 2.4.0
|
|
*/
|
|
public function getProducts($refresh = false, $id_product = false, $id_country = null, $fullInfos = true, bool $keepOrderPrices = false,$default=false)
|
|
{
|
|
if($keepOrderPrices || $default || !Module::isEnabled('ets_extraoptions'))
|
|
{
|
|
$products = parent::getProducts($refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($products);
|
|
return $products;
|
|
}
|
|
else
|
|
{
|
|
$this->_products = Module::getInstanceByName('ets_extraoptions')->getProducts($this,$refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($this->_products);
|
|
return $this->_products;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
class CartControllerOverrideOriginal_remove64d35e067dae2 extends \stdClass
|
|
{
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:14
|
|
* version: 1.1.7
|
|
*/
|
|
public function processChangeProductInCart()
|
|
{
|
|
|
|
$module = null;
|
|
if(Module::isEnabled('ets_extraoptions'))
|
|
$module = Module::getInstanceByName('ets_extraoptions');
|
|
if ($module)
|
|
$module->validateAddCustomAttributeToCart($this->errors, $this->id_product);
|
|
parent::processChangeProductInCart();
|
|
if ($module && !$this->errors)
|
|
$module->postAddCustomAttributeToCart($this->id_product, $this->id_product_attribute, $this->qty, $this->customization_id);
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:14
|
|
* version: 1.1.7
|
|
*/
|
|
public function productInCartMatchesCriteria($productInCart)
|
|
{
|
|
return (
|
|
!isset($this->id_product_attribute) ||
|
|
(
|
|
$productInCart['id_product_attribute'] == $this->id_product_attribute &&
|
|
$productInCart['id_customization'] == $this->customization_id
|
|
)
|
|
) && isset($this->id_product) && $productInCart['id_product'] == $this->id_product && (!isset($productInCart['id_combination']) || $productInCart['id_combination']==(int)Tools::getValue('id_combination'));
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:24:23
|
|
* version: 1.1.7
|
|
*/
|
|
public function displayAjaxRefresh()
|
|
{
|
|
if (Configuration::isCatalogMode()) {
|
|
return;
|
|
}
|
|
ob_end_clean();
|
|
header('Content-Type: application/json');
|
|
$this->ajaxRender(json_encode([
|
|
'cart_detailed' => $this->context->smarty->fetch(_PS_MODULE_DIR_.'ets_extraoptions/views/templates/hook/checkout/cart-detailed.tpl'),
|
|
'cart_detailed_totals' => $this->render('checkout/_partials/cart-detailed-totals'),
|
|
'cart_summary_items_subtotal' => $this->render('checkout/_partials/cart-summary-items-subtotal'),
|
|
'cart_summary_subtotals_container' => $this->render('checkout/_partials/cart-summary-subtotals'),
|
|
'cart_summary_totals' => $this->render('checkout/_partials/cart-summary-totals'),
|
|
'cart_detailed_actions' => $this->render('checkout/_partials/cart-detailed-actions'),
|
|
'cart_voucher' => $this->render('checkout/_partials/cart-voucher'),
|
|
]));
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:24:23
|
|
* version: 1.1.7
|
|
*/
|
|
public function displayAjaxRefresh()
|
|
{
|
|
if (Configuration::isCatalogMode()) {
|
|
return;
|
|
}
|
|
ob_end_clean();
|
|
header('Content-Type: application/json');
|
|
$this->ajaxRender(json_encode([
|
|
'cart_detailed' => $this->context->smarty->fetch(_PS_MODULE_DIR_.'ets_extraoptions/views/templates/hook/checkout/cart-detailed.tpl'),
|
|
'cart_detailed_totals' => $this->render('checkout/_partials/cart-detailed-totals'),
|
|
'cart_summary_items_subtotal' => $this->render('checkout/_partials/cart-summary-items-subtotal'),
|
|
'cart_summary_subtotals_container' => $this->render('checkout/_partials/cart-summary-subtotals'),
|
|
'cart_summary_totals' => $this->render('checkout/_partials/cart-summary-totals'),
|
|
'cart_detailed_actions' => $this->render('checkout/_partials/cart-detailed-actions'),
|
|
'cart_voucher' => $this->render('checkout/_partials/cart-voucher'),
|
|
]));
|
|
}
|
|
}
|
|
|
|
|
|
class CartOverrideOriginal_remove64d35e52d4e20 extends \stdClass
|
|
{
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageShippingCost($id_carrier = null, $use_tax = true, Country $default_country = null, $product_list = null, $id_zone = null,bool $keepOrderPrices=false,$default=false)
|
|
{
|
|
if($IDzone = (int)Hook::exec('actionGetIDZoneByAddressID'))
|
|
{
|
|
$id_zone = $IDzone;
|
|
}
|
|
if (null === $product_list) {
|
|
$products = $this->getProducts(false, false, null, true);
|
|
} else {
|
|
$products = $product_list;
|
|
}
|
|
if(Module::isEnabled('ets_marketplace') && ($marketplace = Module::getInstanceByName('ets_marketplace')) && $sellers = $marketplace->checkMultiSellerProductList($products))
|
|
{
|
|
$shipping_cost = 0;
|
|
foreach($sellers as $seller)
|
|
{
|
|
$is_virtual= true;
|
|
if($seller)
|
|
{
|
|
foreach($seller as $p)
|
|
{
|
|
if(!$p['is_virtual'])
|
|
{
|
|
$is_virtual = false;
|
|
}
|
|
}
|
|
}
|
|
if(($price=parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$seller,$id_zone,$keepOrderPrices))===false && !$is_virtual)
|
|
return false;
|
|
$shipping_cost += $is_virtual ? 0 : ( $price? :0);
|
|
}
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
else {
|
|
$shipping_cost = parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$products,$id_zone,$keepOrderPrices);
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageList($flush = false)
|
|
{
|
|
if(($address_type = Tools::getValue('address_type')) && $address_type=='shipping_address')
|
|
$this->id_address_delivery = (int)Tools::getValue('id_address',$this->id_address_delivery);
|
|
$final_package_list = parent::getPackageList($flush);
|
|
if($final_package_list)
|
|
{
|
|
foreach($final_package_list as $final_packages)
|
|
{
|
|
foreach($final_packages as $final_package)
|
|
{
|
|
if(!$final_package['carrier_list'] || ($final_package['carrier_list'] && isset($final_package['carrier_list'][0]) && $final_package['carrier_list'][0]===0))
|
|
{
|
|
return array();
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
return $final_package_list;
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getDeliveryOptionList(Country $default_country = null, $flush = false)
|
|
{
|
|
$products = $this->getProducts(false, false, null, true);
|
|
$marketplace = Module::getInstanceByName('ets_marketplace');
|
|
if($marketplace->checkMultiSellerProductList($products) && $marketplace->is17 && Configuration::get('ETS_MP_ENABLE_MULTI_SHIPPING'))
|
|
{
|
|
$delivery_option_list = $marketplace->getDeliveryOptionList($default_country,$flush);
|
|
return $delivery_option_list;
|
|
}
|
|
else
|
|
{
|
|
$delivery_option_list = parent::getDeliveryOptionList($default_country,$flush);
|
|
return $marketplace->changeDeliveryOptionList($delivery_option_list);
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:13
|
|
* version: 1.1.7
|
|
*/
|
|
public $_products;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:13
|
|
* version: 1.1.7
|
|
*/
|
|
public $shouldSplitGiftProductsQuantity ;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:13
|
|
* version: 1.1.7
|
|
*/
|
|
public function applyProductCalculations($row, $shopContext, $productQuantity = null, bool $keepOrderPrices = false)
|
|
{
|
|
return parent::applyProductCalculations($row,$shopContext,$productQuantity,$keepOrderPrices);
|
|
}
|
|
/*
|
|
* module: ets_payment_with_fee
|
|
* date: 2023-08-09 04:28:09
|
|
* version: 2.4.0
|
|
*/
|
|
public function getProducts($refresh = false, $id_product = false, $id_country = null, $fullInfos = true, bool $keepOrderPrices = false,$default=false)
|
|
{
|
|
if($keepOrderPrices || $default || !Module::isEnabled('ets_extraoptions'))
|
|
{
|
|
$products = parent::getProducts($refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($products);
|
|
return $products;
|
|
}
|
|
else
|
|
{
|
|
$this->_products = Module::getInstanceByName('ets_extraoptions')->getProducts($this,$refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($this->_products);
|
|
return $this->_products;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
class CartOverrideOriginal_remove64d35e5305260 extends \stdClass
|
|
{
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageShippingCost($id_carrier = null, $use_tax = true, Country $default_country = null, $product_list = null, $id_zone = null,bool $keepOrderPrices=false,$default=false)
|
|
{
|
|
if($IDzone = (int)Hook::exec('actionGetIDZoneByAddressID'))
|
|
{
|
|
$id_zone = $IDzone;
|
|
}
|
|
if (null === $product_list) {
|
|
$products = $this->getProducts(false, false, null, true);
|
|
} else {
|
|
$products = $product_list;
|
|
}
|
|
if(Module::isEnabled('ets_marketplace') && ($marketplace = Module::getInstanceByName('ets_marketplace')) && $sellers = $marketplace->checkMultiSellerProductList($products))
|
|
{
|
|
$shipping_cost = 0;
|
|
foreach($sellers as $seller)
|
|
{
|
|
$is_virtual= true;
|
|
if($seller)
|
|
{
|
|
foreach($seller as $p)
|
|
{
|
|
if(!$p['is_virtual'])
|
|
{
|
|
$is_virtual = false;
|
|
}
|
|
}
|
|
}
|
|
if(($price=parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$seller,$id_zone,$keepOrderPrices))===false && !$is_virtual)
|
|
return false;
|
|
$shipping_cost += $is_virtual ? 0 : ( $price? :0);
|
|
}
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
else {
|
|
$shipping_cost = parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$products,$id_zone,$keepOrderPrices);
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageList($flush = false)
|
|
{
|
|
if(($address_type = Tools::getValue('address_type')) && $address_type=='shipping_address')
|
|
$this->id_address_delivery = (int)Tools::getValue('id_address',$this->id_address_delivery);
|
|
$final_package_list = parent::getPackageList($flush);
|
|
if($final_package_list)
|
|
{
|
|
foreach($final_package_list as $final_packages)
|
|
{
|
|
foreach($final_packages as $final_package)
|
|
{
|
|
if(!$final_package['carrier_list'] || ($final_package['carrier_list'] && isset($final_package['carrier_list'][0]) && $final_package['carrier_list'][0]===0))
|
|
{
|
|
return array();
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
return $final_package_list;
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getDeliveryOptionList(Country $default_country = null, $flush = false)
|
|
{
|
|
$products = $this->getProducts(false, false, null, true);
|
|
$marketplace = Module::getInstanceByName('ets_marketplace');
|
|
if($marketplace->checkMultiSellerProductList($products) && $marketplace->is17 && Configuration::get('ETS_MP_ENABLE_MULTI_SHIPPING'))
|
|
{
|
|
$delivery_option_list = $marketplace->getDeliveryOptionList($default_country,$flush);
|
|
return $delivery_option_list;
|
|
}
|
|
else
|
|
{
|
|
$delivery_option_list = parent::getDeliveryOptionList($default_country,$flush);
|
|
return $marketplace->changeDeliveryOptionList($delivery_option_list);
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:13
|
|
* version: 1.1.7
|
|
*/
|
|
public $_products;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:13
|
|
* version: 1.1.7
|
|
*/
|
|
public $shouldSplitGiftProductsQuantity ;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:13
|
|
* version: 1.1.7
|
|
*/
|
|
public function applyProductCalculations($row, $shopContext, $productQuantity = null, bool $keepOrderPrices = false)
|
|
{
|
|
return parent::applyProductCalculations($row,$shopContext,$productQuantity,$keepOrderPrices);
|
|
}
|
|
/*
|
|
* module: ets_payment_with_fee
|
|
* date: 2023-08-09 04:28:09
|
|
* version: 2.4.0
|
|
*/
|
|
public function getProducts($refresh = false, $id_product = false, $id_country = null, $fullInfos = true, bool $keepOrderPrices = false,$default=false)
|
|
{
|
|
if($keepOrderPrices || $default || !Module::isEnabled('ets_extraoptions'))
|
|
{
|
|
$products = parent::getProducts($refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($products);
|
|
return $products;
|
|
}
|
|
else
|
|
{
|
|
$this->_products = Module::getInstanceByName('ets_extraoptions')->getProducts($this,$refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($this->_products);
|
|
return $this->_products;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
class CartControllerOverrideOriginal_remove64d35e5329925 extends \stdClass
|
|
{
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:14
|
|
* version: 1.1.7
|
|
*/
|
|
public function processChangeProductInCart()
|
|
{
|
|
|
|
$module = null;
|
|
if(Module::isEnabled('ets_extraoptions'))
|
|
$module = Module::getInstanceByName('ets_extraoptions');
|
|
if ($module)
|
|
$module->validateAddCustomAttributeToCart($this->errors, $this->id_product);
|
|
parent::processChangeProductInCart();
|
|
if ($module && !$this->errors)
|
|
$module->postAddCustomAttributeToCart($this->id_product, $this->id_product_attribute, $this->qty, $this->customization_id);
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:14
|
|
* version: 1.1.7
|
|
*/
|
|
public function productInCartMatchesCriteria($productInCart)
|
|
{
|
|
return (
|
|
!isset($this->id_product_attribute) ||
|
|
(
|
|
$productInCart['id_product_attribute'] == $this->id_product_attribute &&
|
|
$productInCart['id_customization'] == $this->customization_id
|
|
)
|
|
) && isset($this->id_product) && $productInCart['id_product'] == $this->id_product && (!isset($productInCart['id_combination']) || $productInCart['id_combination']==(int)Tools::getValue('id_combination'));
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:24:23
|
|
* version: 1.1.7
|
|
*/
|
|
public function displayAjaxRefresh()
|
|
{
|
|
if (Configuration::isCatalogMode()) {
|
|
return;
|
|
}
|
|
ob_end_clean();
|
|
header('Content-Type: application/json');
|
|
$this->ajaxRender(json_encode([
|
|
'cart_detailed' => $this->context->smarty->fetch(_PS_MODULE_DIR_.'ets_extraoptions/views/templates/hook/checkout/cart-detailed.tpl'),
|
|
'cart_detailed_totals' => $this->render('checkout/_partials/cart-detailed-totals'),
|
|
'cart_summary_items_subtotal' => $this->render('checkout/_partials/cart-summary-items-subtotal'),
|
|
'cart_summary_subtotals_container' => $this->render('checkout/_partials/cart-summary-subtotals'),
|
|
'cart_summary_totals' => $this->render('checkout/_partials/cart-summary-totals'),
|
|
'cart_detailed_actions' => $this->render('checkout/_partials/cart-detailed-actions'),
|
|
'cart_voucher' => $this->render('checkout/_partials/cart-voucher'),
|
|
]));
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:24:23
|
|
* version: 1.1.7
|
|
*/
|
|
public function displayAjaxRefresh()
|
|
{
|
|
if (Configuration::isCatalogMode()) {
|
|
return;
|
|
}
|
|
ob_end_clean();
|
|
header('Content-Type: application/json');
|
|
$this->ajaxRender(json_encode([
|
|
'cart_detailed' => $this->context->smarty->fetch(_PS_MODULE_DIR_.'ets_extraoptions/views/templates/hook/checkout/cart-detailed.tpl'),
|
|
'cart_detailed_totals' => $this->render('checkout/_partials/cart-detailed-totals'),
|
|
'cart_summary_items_subtotal' => $this->render('checkout/_partials/cart-summary-items-subtotal'),
|
|
'cart_summary_subtotals_container' => $this->render('checkout/_partials/cart-summary-subtotals'),
|
|
'cart_summary_totals' => $this->render('checkout/_partials/cart-summary-totals'),
|
|
'cart_detailed_actions' => $this->render('checkout/_partials/cart-detailed-actions'),
|
|
'cart_voucher' => $this->render('checkout/_partials/cart-voucher'),
|
|
]));
|
|
}
|
|
}
|
|
|
|
|
|
class CartOverrideOriginal_remove64d35e835a194 extends \stdClass
|
|
{
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageShippingCost($id_carrier = null, $use_tax = true, Country $default_country = null, $product_list = null, $id_zone = null,bool $keepOrderPrices=false,$default=false)
|
|
{
|
|
if($IDzone = (int)Hook::exec('actionGetIDZoneByAddressID'))
|
|
{
|
|
$id_zone = $IDzone;
|
|
}
|
|
if (null === $product_list) {
|
|
$products = $this->getProducts(false, false, null, true);
|
|
} else {
|
|
$products = $product_list;
|
|
}
|
|
if(Module::isEnabled('ets_marketplace') && ($marketplace = Module::getInstanceByName('ets_marketplace')) && $sellers = $marketplace->checkMultiSellerProductList($products))
|
|
{
|
|
$shipping_cost = 0;
|
|
foreach($sellers as $seller)
|
|
{
|
|
$is_virtual= true;
|
|
if($seller)
|
|
{
|
|
foreach($seller as $p)
|
|
{
|
|
if(!$p['is_virtual'])
|
|
{
|
|
$is_virtual = false;
|
|
}
|
|
}
|
|
}
|
|
if(($price=parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$seller,$id_zone,$keepOrderPrices))===false && !$is_virtual)
|
|
return false;
|
|
$shipping_cost += $is_virtual ? 0 : ( $price? :0);
|
|
}
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
else {
|
|
$shipping_cost = parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$products,$id_zone,$keepOrderPrices);
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageList($flush = false)
|
|
{
|
|
if(($address_type = Tools::getValue('address_type')) && $address_type=='shipping_address')
|
|
$this->id_address_delivery = (int)Tools::getValue('id_address',$this->id_address_delivery);
|
|
$final_package_list = parent::getPackageList($flush);
|
|
if($final_package_list)
|
|
{
|
|
foreach($final_package_list as $final_packages)
|
|
{
|
|
foreach($final_packages as $final_package)
|
|
{
|
|
if(!$final_package['carrier_list'] || ($final_package['carrier_list'] && isset($final_package['carrier_list'][0]) && $final_package['carrier_list'][0]===0))
|
|
{
|
|
return array();
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
return $final_package_list;
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getDeliveryOptionList(Country $default_country = null, $flush = false)
|
|
{
|
|
$products = $this->getProducts(false, false, null, true);
|
|
$marketplace = Module::getInstanceByName('ets_marketplace');
|
|
if($marketplace->checkMultiSellerProductList($products) && $marketplace->is17 && Configuration::get('ETS_MP_ENABLE_MULTI_SHIPPING'))
|
|
{
|
|
$delivery_option_list = $marketplace->getDeliveryOptionList($default_country,$flush);
|
|
return $delivery_option_list;
|
|
}
|
|
else
|
|
{
|
|
$delivery_option_list = parent::getDeliveryOptionList($default_country,$flush);
|
|
return $marketplace->changeDeliveryOptionList($delivery_option_list);
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:13
|
|
* version: 1.1.7
|
|
*/
|
|
public $_products;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:13
|
|
* version: 1.1.7
|
|
*/
|
|
public $shouldSplitGiftProductsQuantity ;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:13
|
|
* version: 1.1.7
|
|
*/
|
|
public function applyProductCalculations($row, $shopContext, $productQuantity = null, bool $keepOrderPrices = false)
|
|
{
|
|
return parent::applyProductCalculations($row,$shopContext,$productQuantity,$keepOrderPrices);
|
|
}
|
|
/*
|
|
* module: ets_payment_with_fee
|
|
* date: 2023-08-09 04:28:09
|
|
* version: 2.4.0
|
|
*/
|
|
public function getProducts($refresh = false, $id_product = false, $id_country = null, $fullInfos = true, bool $keepOrderPrices = false,$default=false)
|
|
{
|
|
if($keepOrderPrices || $default || !Module::isEnabled('ets_extraoptions'))
|
|
{
|
|
$products = parent::getProducts($refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($products);
|
|
return $products;
|
|
}
|
|
else
|
|
{
|
|
$this->_products = Module::getInstanceByName('ets_extraoptions')->getProducts($this,$refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($this->_products);
|
|
return $this->_products;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
class CartOverrideOriginal_remove64d35e837dfea extends \stdClass
|
|
{
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageShippingCost($id_carrier = null, $use_tax = true, Country $default_country = null, $product_list = null, $id_zone = null,bool $keepOrderPrices=false,$default=false)
|
|
{
|
|
if($IDzone = (int)Hook::exec('actionGetIDZoneByAddressID'))
|
|
{
|
|
$id_zone = $IDzone;
|
|
}
|
|
if (null === $product_list) {
|
|
$products = $this->getProducts(false, false, null, true);
|
|
} else {
|
|
$products = $product_list;
|
|
}
|
|
if(Module::isEnabled('ets_marketplace') && ($marketplace = Module::getInstanceByName('ets_marketplace')) && $sellers = $marketplace->checkMultiSellerProductList($products))
|
|
{
|
|
$shipping_cost = 0;
|
|
foreach($sellers as $seller)
|
|
{
|
|
$is_virtual= true;
|
|
if($seller)
|
|
{
|
|
foreach($seller as $p)
|
|
{
|
|
if(!$p['is_virtual'])
|
|
{
|
|
$is_virtual = false;
|
|
}
|
|
}
|
|
}
|
|
if(($price=parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$seller,$id_zone,$keepOrderPrices))===false && !$is_virtual)
|
|
return false;
|
|
$shipping_cost += $is_virtual ? 0 : ( $price? :0);
|
|
}
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
else {
|
|
$shipping_cost = parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$products,$id_zone,$keepOrderPrices);
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageList($flush = false)
|
|
{
|
|
if(($address_type = Tools::getValue('address_type')) && $address_type=='shipping_address')
|
|
$this->id_address_delivery = (int)Tools::getValue('id_address',$this->id_address_delivery);
|
|
$final_package_list = parent::getPackageList($flush);
|
|
if($final_package_list)
|
|
{
|
|
foreach($final_package_list as $final_packages)
|
|
{
|
|
foreach($final_packages as $final_package)
|
|
{
|
|
if(!$final_package['carrier_list'] || ($final_package['carrier_list'] && isset($final_package['carrier_list'][0]) && $final_package['carrier_list'][0]===0))
|
|
{
|
|
return array();
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
return $final_package_list;
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getDeliveryOptionList(Country $default_country = null, $flush = false)
|
|
{
|
|
$products = $this->getProducts(false, false, null, true);
|
|
$marketplace = Module::getInstanceByName('ets_marketplace');
|
|
if($marketplace->checkMultiSellerProductList($products) && $marketplace->is17 && Configuration::get('ETS_MP_ENABLE_MULTI_SHIPPING'))
|
|
{
|
|
$delivery_option_list = $marketplace->getDeliveryOptionList($default_country,$flush);
|
|
return $delivery_option_list;
|
|
}
|
|
else
|
|
{
|
|
$delivery_option_list = parent::getDeliveryOptionList($default_country,$flush);
|
|
return $marketplace->changeDeliveryOptionList($delivery_option_list);
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:13
|
|
* version: 1.1.7
|
|
*/
|
|
public $_products;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:13
|
|
* version: 1.1.7
|
|
*/
|
|
public $shouldSplitGiftProductsQuantity ;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:13
|
|
* version: 1.1.7
|
|
*/
|
|
public function applyProductCalculations($row, $shopContext, $productQuantity = null, bool $keepOrderPrices = false)
|
|
{
|
|
return parent::applyProductCalculations($row,$shopContext,$productQuantity,$keepOrderPrices);
|
|
}
|
|
/*
|
|
* module: ets_payment_with_fee
|
|
* date: 2023-08-09 04:28:09
|
|
* version: 2.4.0
|
|
*/
|
|
public function getProducts($refresh = false, $id_product = false, $id_country = null, $fullInfos = true, bool $keepOrderPrices = false,$default=false)
|
|
{
|
|
if($keepOrderPrices || $default || !Module::isEnabled('ets_extraoptions'))
|
|
{
|
|
$products = parent::getProducts($refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($products);
|
|
return $products;
|
|
}
|
|
else
|
|
{
|
|
$this->_products = Module::getInstanceByName('ets_extraoptions')->getProducts($this,$refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($this->_products);
|
|
return $this->_products;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
class CartControllerOverrideOriginal_remove64d35e83a1edf extends \stdClass
|
|
{
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:14
|
|
* version: 1.1.7
|
|
*/
|
|
public function processChangeProductInCart()
|
|
{
|
|
|
|
$module = null;
|
|
if(Module::isEnabled('ets_extraoptions'))
|
|
$module = Module::getInstanceByName('ets_extraoptions');
|
|
if ($module)
|
|
$module->validateAddCustomAttributeToCart($this->errors, $this->id_product);
|
|
parent::processChangeProductInCart();
|
|
if ($module && !$this->errors)
|
|
$module->postAddCustomAttributeToCart($this->id_product, $this->id_product_attribute, $this->qty, $this->customization_id);
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-08 22:43:14
|
|
* version: 1.1.7
|
|
*/
|
|
public function productInCartMatchesCriteria($productInCart)
|
|
{
|
|
return (
|
|
!isset($this->id_product_attribute) ||
|
|
(
|
|
$productInCart['id_product_attribute'] == $this->id_product_attribute &&
|
|
$productInCart['id_customization'] == $this->customization_id
|
|
)
|
|
) && isset($this->id_product) && $productInCart['id_product'] == $this->id_product && (!isset($productInCart['id_combination']) || $productInCart['id_combination']==(int)Tools::getValue('id_combination'));
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:24:23
|
|
* version: 1.1.7
|
|
*/
|
|
public function displayAjaxRefresh()
|
|
{
|
|
if (Configuration::isCatalogMode()) {
|
|
return;
|
|
}
|
|
ob_end_clean();
|
|
header('Content-Type: application/json');
|
|
$this->ajaxRender(json_encode([
|
|
'cart_detailed' => $this->context->smarty->fetch(_PS_MODULE_DIR_.'ets_extraoptions/views/templates/hook/checkout/cart-detailed.tpl'),
|
|
'cart_detailed_totals' => $this->render('checkout/_partials/cart-detailed-totals'),
|
|
'cart_summary_items_subtotal' => $this->render('checkout/_partials/cart-summary-items-subtotal'),
|
|
'cart_summary_subtotals_container' => $this->render('checkout/_partials/cart-summary-subtotals'),
|
|
'cart_summary_totals' => $this->render('checkout/_partials/cart-summary-totals'),
|
|
'cart_detailed_actions' => $this->render('checkout/_partials/cart-detailed-actions'),
|
|
'cart_voucher' => $this->render('checkout/_partials/cart-voucher'),
|
|
]));
|
|
}
|
|
}
|
|
|
|
|
|
class CartOverrideOriginal_remove64d35f836a608 extends \stdClass
|
|
{
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageShippingCost($id_carrier = null, $use_tax = true, Country $default_country = null, $product_list = null, $id_zone = null,bool $keepOrderPrices=false,$default=false)
|
|
{
|
|
if($IDzone = (int)Hook::exec('actionGetIDZoneByAddressID'))
|
|
{
|
|
$id_zone = $IDzone;
|
|
}
|
|
if (null === $product_list) {
|
|
$products = $this->getProducts(false, false, null, true);
|
|
} else {
|
|
$products = $product_list;
|
|
}
|
|
if(Module::isEnabled('ets_marketplace') && ($marketplace = Module::getInstanceByName('ets_marketplace')) && $sellers = $marketplace->checkMultiSellerProductList($products))
|
|
{
|
|
$shipping_cost = 0;
|
|
foreach($sellers as $seller)
|
|
{
|
|
$is_virtual= true;
|
|
if($seller)
|
|
{
|
|
foreach($seller as $p)
|
|
{
|
|
if(!$p['is_virtual'])
|
|
{
|
|
$is_virtual = false;
|
|
}
|
|
}
|
|
}
|
|
if(($price=parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$seller,$id_zone,$keepOrderPrices))===false && !$is_virtual)
|
|
return false;
|
|
$shipping_cost += $is_virtual ? 0 : ( $price? :0);
|
|
}
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
else {
|
|
$shipping_cost = parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$products,$id_zone,$keepOrderPrices);
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageList($flush = false)
|
|
{
|
|
if(($address_type = Tools::getValue('address_type')) && $address_type=='shipping_address')
|
|
$this->id_address_delivery = (int)Tools::getValue('id_address',$this->id_address_delivery);
|
|
$final_package_list = parent::getPackageList($flush);
|
|
if($final_package_list)
|
|
{
|
|
foreach($final_package_list as $final_packages)
|
|
{
|
|
foreach($final_packages as $final_package)
|
|
{
|
|
if(!$final_package['carrier_list'] || ($final_package['carrier_list'] && isset($final_package['carrier_list'][0]) && $final_package['carrier_list'][0]===0))
|
|
{
|
|
return array();
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
return $final_package_list;
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getDeliveryOptionList(Country $default_country = null, $flush = false)
|
|
{
|
|
$products = $this->getProducts(false, false, null, true);
|
|
$marketplace = Module::getInstanceByName('ets_marketplace');
|
|
if($marketplace->checkMultiSellerProductList($products) && $marketplace->is17 && Configuration::get('ETS_MP_ENABLE_MULTI_SHIPPING'))
|
|
{
|
|
$delivery_option_list = $marketplace->getDeliveryOptionList($default_country,$flush);
|
|
return $delivery_option_list;
|
|
}
|
|
else
|
|
{
|
|
$delivery_option_list = parent::getDeliveryOptionList($default_country,$flush);
|
|
return $marketplace->changeDeliveryOptionList($delivery_option_list);
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:40:59
|
|
* version: 1.1.7
|
|
*/
|
|
public $_products;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:40:59
|
|
* version: 1.1.7
|
|
*/
|
|
public $shouldSplitGiftProductsQuantity ;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:40:59
|
|
* version: 1.1.7
|
|
*/
|
|
public function applyProductCalculations($row, $shopContext, $productQuantity = null, bool $keepOrderPrices = false)
|
|
{
|
|
return parent::applyProductCalculations($row,$shopContext,$productQuantity,$keepOrderPrices);
|
|
}
|
|
/*
|
|
* module: ets_payment_with_fee
|
|
* date: 2023-08-09 05:41:00
|
|
* version: 2.4.0
|
|
*/
|
|
public function getOrderTotal(
|
|
$withTaxes = true,
|
|
$type = Cart::BOTH,
|
|
$products = null,
|
|
$id_carrier = null,
|
|
$use_cache = false,
|
|
bool $keepOrderPrices = false,
|
|
$fee_payment = false,
|
|
$only_cart = false
|
|
){
|
|
$total = parent::getOrderTotal($withTaxes,$type,$products,$id_carrier,$use_cache,$keepOrderPrices);
|
|
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;
|
|
}
|
|
/*
|
|
* module: ets_payment_with_fee
|
|
* date: 2023-08-09 05:41:00
|
|
* version: 2.4.0
|
|
*/
|
|
public function getProducts($refresh = false, $id_product = false, $id_country = null, $fullInfos = true, bool $keepOrderPrices = false,$default=false)
|
|
{
|
|
if($keepOrderPrices || $default || !Module::isEnabled('ets_extraoptions'))
|
|
{
|
|
$products = parent::getProducts($refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($products);
|
|
return $products;
|
|
}
|
|
else
|
|
{
|
|
$this->_products = Module::getInstanceByName('ets_extraoptions')->getProducts($this,$refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($this->_products);
|
|
return $this->_products;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
class CartOverrideOriginal_remove64d35f8391540 extends \stdClass
|
|
{
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageShippingCost($id_carrier = null, $use_tax = true, Country $default_country = null, $product_list = null, $id_zone = null,bool $keepOrderPrices=false,$default=false)
|
|
{
|
|
if($IDzone = (int)Hook::exec('actionGetIDZoneByAddressID'))
|
|
{
|
|
$id_zone = $IDzone;
|
|
}
|
|
if (null === $product_list) {
|
|
$products = $this->getProducts(false, false, null, true);
|
|
} else {
|
|
$products = $product_list;
|
|
}
|
|
if(Module::isEnabled('ets_marketplace') && ($marketplace = Module::getInstanceByName('ets_marketplace')) && $sellers = $marketplace->checkMultiSellerProductList($products))
|
|
{
|
|
$shipping_cost = 0;
|
|
foreach($sellers as $seller)
|
|
{
|
|
$is_virtual= true;
|
|
if($seller)
|
|
{
|
|
foreach($seller as $p)
|
|
{
|
|
if(!$p['is_virtual'])
|
|
{
|
|
$is_virtual = false;
|
|
}
|
|
}
|
|
}
|
|
if(($price=parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$seller,$id_zone,$keepOrderPrices))===false && !$is_virtual)
|
|
return false;
|
|
$shipping_cost += $is_virtual ? 0 : ( $price? :0);
|
|
}
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
else {
|
|
$shipping_cost = parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$products,$id_zone,$keepOrderPrices);
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageList($flush = false)
|
|
{
|
|
if(($address_type = Tools::getValue('address_type')) && $address_type=='shipping_address')
|
|
$this->id_address_delivery = (int)Tools::getValue('id_address',$this->id_address_delivery);
|
|
$final_package_list = parent::getPackageList($flush);
|
|
if($final_package_list)
|
|
{
|
|
foreach($final_package_list as $final_packages)
|
|
{
|
|
foreach($final_packages as $final_package)
|
|
{
|
|
if(!$final_package['carrier_list'] || ($final_package['carrier_list'] && isset($final_package['carrier_list'][0]) && $final_package['carrier_list'][0]===0))
|
|
{
|
|
return array();
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
return $final_package_list;
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getDeliveryOptionList(Country $default_country = null, $flush = false)
|
|
{
|
|
$products = $this->getProducts(false, false, null, true);
|
|
$marketplace = Module::getInstanceByName('ets_marketplace');
|
|
if($marketplace->checkMultiSellerProductList($products) && $marketplace->is17 && Configuration::get('ETS_MP_ENABLE_MULTI_SHIPPING'))
|
|
{
|
|
$delivery_option_list = $marketplace->getDeliveryOptionList($default_country,$flush);
|
|
return $delivery_option_list;
|
|
}
|
|
else
|
|
{
|
|
$delivery_option_list = parent::getDeliveryOptionList($default_country,$flush);
|
|
return $marketplace->changeDeliveryOptionList($delivery_option_list);
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:40:59
|
|
* version: 1.1.7
|
|
*/
|
|
public $_products;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:40:59
|
|
* version: 1.1.7
|
|
*/
|
|
public $shouldSplitGiftProductsQuantity ;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:40:59
|
|
* version: 1.1.7
|
|
*/
|
|
public function applyProductCalculations($row, $shopContext, $productQuantity = null, bool $keepOrderPrices = false)
|
|
{
|
|
return parent::applyProductCalculations($row,$shopContext,$productQuantity,$keepOrderPrices);
|
|
}
|
|
/*
|
|
* module: ets_payment_with_fee
|
|
* date: 2023-08-09 05:41:00
|
|
* version: 2.4.0
|
|
*/
|
|
public function getProducts($refresh = false, $id_product = false, $id_country = null, $fullInfos = true, bool $keepOrderPrices = false,$default=false)
|
|
{
|
|
if($keepOrderPrices || $default || !Module::isEnabled('ets_extraoptions'))
|
|
{
|
|
$products = parent::getProducts($refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($products);
|
|
return $products;
|
|
}
|
|
else
|
|
{
|
|
$this->_products = Module::getInstanceByName('ets_extraoptions')->getProducts($this,$refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($this->_products);
|
|
return $this->_products;
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 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 CartControllerOverrideOriginal_remove64d35f83b5402 extends \stdClass
|
|
{
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:41:00
|
|
* version: 1.1.7
|
|
*/
|
|
public function processChangeProductInCart()
|
|
{
|
|
|
|
$module = null;
|
|
if(Module::isEnabled('ets_extraoptions'))
|
|
$module = Module::getInstanceByName('ets_extraoptions');
|
|
if ($module)
|
|
$module->validateAddCustomAttributeToCart($this->errors, $this->id_product);
|
|
parent::processChangeProductInCart();
|
|
if ($module && !$this->errors)
|
|
$module->postAddCustomAttributeToCart($this->id_product, $this->id_product_attribute, $this->qty, $this->customization_id);
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:41:00
|
|
* version: 1.1.7
|
|
*/
|
|
public function displayAjaxRefresh()
|
|
{
|
|
if (Configuration::isCatalogMode()) {
|
|
return;
|
|
}
|
|
ob_end_clean();
|
|
header('Content-Type: application/json');
|
|
$this->ajaxRender(json_encode([
|
|
'cart_detailed' => $this->context->smarty->fetch(_PS_MODULE_DIR_.'ets_extraoptions/views/templates/hook/checkout/cart-detailed.tpl'),
|
|
'cart_detailed_totals' => $this->render('checkout/_partials/cart-detailed-totals'),
|
|
'cart_summary_items_subtotal' => $this->render('checkout/_partials/cart-summary-items-subtotal'),
|
|
'cart_summary_subtotals_container' => $this->render('checkout/_partials/cart-summary-subtotals'),
|
|
'cart_summary_totals' => $this->render('checkout/_partials/cart-summary-totals'),
|
|
'cart_detailed_actions' => $this->render('checkout/_partials/cart-detailed-actions'),
|
|
'cart_voucher' => $this->render('checkout/_partials/cart-voucher'),
|
|
]));
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:41:00
|
|
* version: 1.1.7
|
|
*/
|
|
public function productInCartMatchesCriteria($productInCart)
|
|
{
|
|
return (
|
|
!isset($this->id_product_attribute) ||
|
|
(
|
|
$productInCart['id_product_attribute'] == $this->id_product_attribute &&
|
|
$productInCart['id_customization'] == $this->customization_id
|
|
)
|
|
) && isset($this->id_product) && $productInCart['id_product'] == $this->id_product && (!isset($productInCart['id_combination']) || $productInCart['id_combination']==(int)Tools::getValue('id_combination'));
|
|
}
|
|
}
|
|
|
|
|
|
class CartOverrideOriginal_remove64d35fb9b8aed extends \stdClass
|
|
{
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageShippingCost($id_carrier = null, $use_tax = true, Country $default_country = null, $product_list = null, $id_zone = null,bool $keepOrderPrices=false,$default=false)
|
|
{
|
|
if($IDzone = (int)Hook::exec('actionGetIDZoneByAddressID'))
|
|
{
|
|
$id_zone = $IDzone;
|
|
}
|
|
if (null === $product_list) {
|
|
$products = $this->getProducts(false, false, null, true);
|
|
} else {
|
|
$products = $product_list;
|
|
}
|
|
if(Module::isEnabled('ets_marketplace') && ($marketplace = Module::getInstanceByName('ets_marketplace')) && $sellers = $marketplace->checkMultiSellerProductList($products))
|
|
{
|
|
$shipping_cost = 0;
|
|
foreach($sellers as $seller)
|
|
{
|
|
$is_virtual= true;
|
|
if($seller)
|
|
{
|
|
foreach($seller as $p)
|
|
{
|
|
if(!$p['is_virtual'])
|
|
{
|
|
$is_virtual = false;
|
|
}
|
|
}
|
|
}
|
|
if(($price=parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$seller,$id_zone,$keepOrderPrices))===false && !$is_virtual)
|
|
return false;
|
|
$shipping_cost += $is_virtual ? 0 : ( $price? :0);
|
|
}
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
else {
|
|
$shipping_cost = parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$products,$id_zone,$keepOrderPrices);
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageList($flush = false)
|
|
{
|
|
if(($address_type = Tools::getValue('address_type')) && $address_type=='shipping_address')
|
|
$this->id_address_delivery = (int)Tools::getValue('id_address',$this->id_address_delivery);
|
|
$final_package_list = parent::getPackageList($flush);
|
|
if($final_package_list)
|
|
{
|
|
foreach($final_package_list as $final_packages)
|
|
{
|
|
foreach($final_packages as $final_package)
|
|
{
|
|
if(!$final_package['carrier_list'] || ($final_package['carrier_list'] && isset($final_package['carrier_list'][0]) && $final_package['carrier_list'][0]===0))
|
|
{
|
|
return array();
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
return $final_package_list;
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getDeliveryOptionList(Country $default_country = null, $flush = false)
|
|
{
|
|
$products = $this->getProducts(false, false, null, true);
|
|
$marketplace = Module::getInstanceByName('ets_marketplace');
|
|
if($marketplace->checkMultiSellerProductList($products) && $marketplace->is17 && Configuration::get('ETS_MP_ENABLE_MULTI_SHIPPING'))
|
|
{
|
|
$delivery_option_list = $marketplace->getDeliveryOptionList($default_country,$flush);
|
|
return $delivery_option_list;
|
|
}
|
|
else
|
|
{
|
|
$delivery_option_list = parent::getDeliveryOptionList($default_country,$flush);
|
|
return $marketplace->changeDeliveryOptionList($delivery_option_list);
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:40:59
|
|
* version: 1.1.7
|
|
*/
|
|
public $_products;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:40:59
|
|
* version: 1.1.7
|
|
*/
|
|
public $shouldSplitGiftProductsQuantity ;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:40:59
|
|
* version: 1.1.7
|
|
*/
|
|
public function applyProductCalculations($row, $shopContext, $productQuantity = null, bool $keepOrderPrices = false)
|
|
{
|
|
return parent::applyProductCalculations($row,$shopContext,$productQuantity,$keepOrderPrices);
|
|
}
|
|
/*
|
|
* module: ets_payment_with_fee
|
|
* date: 2023-08-09 05:41:00
|
|
* version: 2.4.0
|
|
*/
|
|
public function getProducts($refresh = false, $id_product = false, $id_country = null, $fullInfos = true, bool $keepOrderPrices = false,$default=false)
|
|
{
|
|
if($keepOrderPrices || $default || !Module::isEnabled('ets_extraoptions'))
|
|
{
|
|
$products = parent::getProducts($refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($products);
|
|
return $products;
|
|
}
|
|
else
|
|
{
|
|
$this->_products = Module::getInstanceByName('ets_extraoptions')->getProducts($this,$refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($this->_products);
|
|
return $this->_products;
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_payment_with_fee
|
|
* date: 2023-08-09 05:43:21
|
|
* version: 2.4.0
|
|
*/
|
|
public function getOrderTotal(
|
|
$withTaxes = true,
|
|
$type = Cart::BOTH,
|
|
$products = null,
|
|
$id_carrier = null,
|
|
$use_cache = false,
|
|
bool $keepOrderPrices = false,
|
|
$fee_payment = false,
|
|
$only_cart = false
|
|
){
|
|
$total = parent::getOrderTotal($withTaxes,$type,$products,$id_carrier,$use_cache,$keepOrderPrices);
|
|
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;
|
|
}
|
|
}
|
|
|
|
|
|
class CartOverrideOriginal_remove64d35fb9dca61 extends \stdClass
|
|
{
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageShippingCost($id_carrier = null, $use_tax = true, Country $default_country = null, $product_list = null, $id_zone = null,bool $keepOrderPrices=false,$default=false)
|
|
{
|
|
if($IDzone = (int)Hook::exec('actionGetIDZoneByAddressID'))
|
|
{
|
|
$id_zone = $IDzone;
|
|
}
|
|
if (null === $product_list) {
|
|
$products = $this->getProducts(false, false, null, true);
|
|
} else {
|
|
$products = $product_list;
|
|
}
|
|
if(Module::isEnabled('ets_marketplace') && ($marketplace = Module::getInstanceByName('ets_marketplace')) && $sellers = $marketplace->checkMultiSellerProductList($products))
|
|
{
|
|
$shipping_cost = 0;
|
|
foreach($sellers as $seller)
|
|
{
|
|
$is_virtual= true;
|
|
if($seller)
|
|
{
|
|
foreach($seller as $p)
|
|
{
|
|
if(!$p['is_virtual'])
|
|
{
|
|
$is_virtual = false;
|
|
}
|
|
}
|
|
}
|
|
if(($price=parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$seller,$id_zone,$keepOrderPrices))===false && !$is_virtual)
|
|
return false;
|
|
$shipping_cost += $is_virtual ? 0 : ( $price? :0);
|
|
}
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
else {
|
|
$shipping_cost = parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$products,$id_zone,$keepOrderPrices);
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageList($flush = false)
|
|
{
|
|
if(($address_type = Tools::getValue('address_type')) && $address_type=='shipping_address')
|
|
$this->id_address_delivery = (int)Tools::getValue('id_address',$this->id_address_delivery);
|
|
$final_package_list = parent::getPackageList($flush);
|
|
if($final_package_list)
|
|
{
|
|
foreach($final_package_list as $final_packages)
|
|
{
|
|
foreach($final_packages as $final_package)
|
|
{
|
|
if(!$final_package['carrier_list'] || ($final_package['carrier_list'] && isset($final_package['carrier_list'][0]) && $final_package['carrier_list'][0]===0))
|
|
{
|
|
return array();
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
return $final_package_list;
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getDeliveryOptionList(Country $default_country = null, $flush = false)
|
|
{
|
|
$products = $this->getProducts(false, false, null, true);
|
|
$marketplace = Module::getInstanceByName('ets_marketplace');
|
|
if($marketplace->checkMultiSellerProductList($products) && $marketplace->is17 && Configuration::get('ETS_MP_ENABLE_MULTI_SHIPPING'))
|
|
{
|
|
$delivery_option_list = $marketplace->getDeliveryOptionList($default_country,$flush);
|
|
return $delivery_option_list;
|
|
}
|
|
else
|
|
{
|
|
$delivery_option_list = parent::getDeliveryOptionList($default_country,$flush);
|
|
return $marketplace->changeDeliveryOptionList($delivery_option_list);
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:40:59
|
|
* version: 1.1.7
|
|
*/
|
|
public $_products;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:40:59
|
|
* version: 1.1.7
|
|
*/
|
|
public $shouldSplitGiftProductsQuantity ;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:40:59
|
|
* version: 1.1.7
|
|
*/
|
|
public function applyProductCalculations($row, $shopContext, $productQuantity = null, bool $keepOrderPrices = false)
|
|
{
|
|
return parent::applyProductCalculations($row,$shopContext,$productQuantity,$keepOrderPrices);
|
|
}
|
|
/*
|
|
* module: ets_payment_with_fee
|
|
* date: 2023-08-09 05:41:00
|
|
* version: 2.4.0
|
|
*/
|
|
public function getProducts($refresh = false, $id_product = false, $id_country = null, $fullInfos = true, bool $keepOrderPrices = false,$default=false)
|
|
{
|
|
if($keepOrderPrices || $default || !Module::isEnabled('ets_extraoptions'))
|
|
{
|
|
$products = parent::getProducts($refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($products);
|
|
return $products;
|
|
}
|
|
else
|
|
{
|
|
$this->_products = Module::getInstanceByName('ets_extraoptions')->getProducts($this,$refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($this->_products);
|
|
return $this->_products;
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_payment_with_fee
|
|
* date: 2023-08-09 05:43:21
|
|
* version: 2.4.0
|
|
*/
|
|
public function getOrderTotal(
|
|
$withTaxes = true,
|
|
$type = Cart::BOTH,
|
|
$products = null,
|
|
$id_carrier = null,
|
|
$use_cache = false,
|
|
bool $keepOrderPrices = false,
|
|
$fee_payment = false,
|
|
$only_cart = false
|
|
){
|
|
$total = parent::getOrderTotal($withTaxes,$type,$products,$id_carrier,$use_cache,$keepOrderPrices);
|
|
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;
|
|
}
|
|
}
|
|
|
|
|
|
class CartOverrideOriginal_remove64d35fba0c8d0 extends \stdClass
|
|
{
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageShippingCost($id_carrier = null, $use_tax = true, Country $default_country = null, $product_list = null, $id_zone = null,bool $keepOrderPrices=false,$default=false)
|
|
{
|
|
if($IDzone = (int)Hook::exec('actionGetIDZoneByAddressID'))
|
|
{
|
|
$id_zone = $IDzone;
|
|
}
|
|
if (null === $product_list) {
|
|
$products = $this->getProducts(false, false, null, true);
|
|
} else {
|
|
$products = $product_list;
|
|
}
|
|
if(Module::isEnabled('ets_marketplace') && ($marketplace = Module::getInstanceByName('ets_marketplace')) && $sellers = $marketplace->checkMultiSellerProductList($products))
|
|
{
|
|
$shipping_cost = 0;
|
|
foreach($sellers as $seller)
|
|
{
|
|
$is_virtual= true;
|
|
if($seller)
|
|
{
|
|
foreach($seller as $p)
|
|
{
|
|
if(!$p['is_virtual'])
|
|
{
|
|
$is_virtual = false;
|
|
}
|
|
}
|
|
}
|
|
if(($price=parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$seller,$id_zone,$keepOrderPrices))===false && !$is_virtual)
|
|
return false;
|
|
$shipping_cost += $is_virtual ? 0 : ( $price? :0);
|
|
}
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
else {
|
|
$shipping_cost = parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$products,$id_zone,$keepOrderPrices);
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageList($flush = false)
|
|
{
|
|
if(($address_type = Tools::getValue('address_type')) && $address_type=='shipping_address')
|
|
$this->id_address_delivery = (int)Tools::getValue('id_address',$this->id_address_delivery);
|
|
$final_package_list = parent::getPackageList($flush);
|
|
if($final_package_list)
|
|
{
|
|
foreach($final_package_list as $final_packages)
|
|
{
|
|
foreach($final_packages as $final_package)
|
|
{
|
|
if(!$final_package['carrier_list'] || ($final_package['carrier_list'] && isset($final_package['carrier_list'][0]) && $final_package['carrier_list'][0]===0))
|
|
{
|
|
return array();
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
return $final_package_list;
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getDeliveryOptionList(Country $default_country = null, $flush = false)
|
|
{
|
|
$products = $this->getProducts(false, false, null, true);
|
|
$marketplace = Module::getInstanceByName('ets_marketplace');
|
|
if($marketplace->checkMultiSellerProductList($products) && $marketplace->is17 && Configuration::get('ETS_MP_ENABLE_MULTI_SHIPPING'))
|
|
{
|
|
$delivery_option_list = $marketplace->getDeliveryOptionList($default_country,$flush);
|
|
return $delivery_option_list;
|
|
}
|
|
else
|
|
{
|
|
$delivery_option_list = parent::getDeliveryOptionList($default_country,$flush);
|
|
return $marketplace->changeDeliveryOptionList($delivery_option_list);
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:40:59
|
|
* version: 1.1.7
|
|
*/
|
|
public $_products;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:40:59
|
|
* version: 1.1.7
|
|
*/
|
|
public $shouldSplitGiftProductsQuantity ;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:40:59
|
|
* version: 1.1.7
|
|
*/
|
|
public function applyProductCalculations($row, $shopContext, $productQuantity = null, bool $keepOrderPrices = false)
|
|
{
|
|
return parent::applyProductCalculations($row,$shopContext,$productQuantity,$keepOrderPrices);
|
|
}
|
|
/*
|
|
* module: ets_payment_with_fee
|
|
* date: 2023-08-09 05:41:00
|
|
* version: 2.4.0
|
|
*/
|
|
public function getProducts($refresh = false, $id_product = false, $id_country = null, $fullInfos = true, bool $keepOrderPrices = false,$default=false)
|
|
{
|
|
if($keepOrderPrices || $default || !Module::isEnabled('ets_extraoptions'))
|
|
{
|
|
$products = parent::getProducts($refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($products);
|
|
return $products;
|
|
}
|
|
else
|
|
{
|
|
$this->_products = Module::getInstanceByName('ets_extraoptions')->getProducts($this,$refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($this->_products);
|
|
return $this->_products;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
class CartControllerOverrideOriginal_remove64d35fba30679 extends \stdClass
|
|
{
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:41:00
|
|
* version: 1.1.7
|
|
*/
|
|
public function processChangeProductInCart()
|
|
{
|
|
|
|
$module = null;
|
|
if(Module::isEnabled('ets_extraoptions'))
|
|
$module = Module::getInstanceByName('ets_extraoptions');
|
|
if ($module)
|
|
$module->validateAddCustomAttributeToCart($this->errors, $this->id_product);
|
|
parent::processChangeProductInCart();
|
|
if ($module && !$this->errors)
|
|
$module->postAddCustomAttributeToCart($this->id_product, $this->id_product_attribute, $this->qty, $this->customization_id);
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:41:00
|
|
* version: 1.1.7
|
|
*/
|
|
public function productInCartMatchesCriteria($productInCart)
|
|
{
|
|
return (
|
|
!isset($this->id_product_attribute) ||
|
|
(
|
|
$productInCart['id_product_attribute'] == $this->id_product_attribute &&
|
|
$productInCart['id_customization'] == $this->customization_id
|
|
)
|
|
) && isset($this->id_product) && $productInCart['id_product'] == $this->id_product && (!isset($productInCart['id_combination']) || $productInCart['id_combination']==(int)Tools::getValue('id_combination'));
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:43:21
|
|
* version: 1.1.7
|
|
*/
|
|
public function displayAjaxRefresh()
|
|
{
|
|
if (Configuration::isCatalogMode()) {
|
|
return;
|
|
}
|
|
ob_end_clean();
|
|
header('Content-Type: application/json');
|
|
$this->ajaxRender(json_encode([
|
|
'cart_detailed' => $this->context->smarty->fetch(_PS_MODULE_DIR_.'ets_extraoptions/views/templates/hook/checkout/cart-detailed.tpl'),
|
|
'cart_detailed_totals' => $this->render('checkout/_partials/cart-detailed-totals'),
|
|
'cart_summary_items_subtotal' => $this->render('checkout/_partials/cart-summary-items-subtotal'),
|
|
'cart_summary_subtotals_container' => $this->render('checkout/_partials/cart-summary-subtotals'),
|
|
'cart_summary_totals' => $this->render('checkout/_partials/cart-summary-totals'),
|
|
'cart_detailed_actions' => $this->render('checkout/_partials/cart-detailed-actions'),
|
|
'cart_voucher' => $this->render('checkout/_partials/cart-voucher'),
|
|
]));
|
|
}
|
|
}
|
|
|
|
|
|
class CartControllerOverrideOriginal_remove64d35fba545ba extends \stdClass
|
|
{
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:41:00
|
|
* version: 1.1.7
|
|
*/
|
|
public function processChangeProductInCart()
|
|
{
|
|
|
|
$module = null;
|
|
if(Module::isEnabled('ets_extraoptions'))
|
|
$module = Module::getInstanceByName('ets_extraoptions');
|
|
if ($module)
|
|
$module->validateAddCustomAttributeToCart($this->errors, $this->id_product);
|
|
parent::processChangeProductInCart();
|
|
if ($module && !$this->errors)
|
|
$module->postAddCustomAttributeToCart($this->id_product, $this->id_product_attribute, $this->qty, $this->customization_id);
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:41:00
|
|
* version: 1.1.7
|
|
*/
|
|
public function productInCartMatchesCriteria($productInCart)
|
|
{
|
|
return (
|
|
!isset($this->id_product_attribute) ||
|
|
(
|
|
$productInCart['id_product_attribute'] == $this->id_product_attribute &&
|
|
$productInCart['id_customization'] == $this->customization_id
|
|
)
|
|
) && isset($this->id_product) && $productInCart['id_product'] == $this->id_product && (!isset($productInCart['id_combination']) || $productInCart['id_combination']==(int)Tools::getValue('id_combination'));
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:43:21
|
|
* version: 1.1.7
|
|
*/
|
|
public function displayAjaxRefresh()
|
|
{
|
|
if (Configuration::isCatalogMode()) {
|
|
return;
|
|
}
|
|
ob_end_clean();
|
|
header('Content-Type: application/json');
|
|
$this->ajaxRender(json_encode([
|
|
'cart_detailed' => $this->context->smarty->fetch(_PS_MODULE_DIR_.'ets_extraoptions/views/templates/hook/checkout/cart-detailed.tpl'),
|
|
'cart_detailed_totals' => $this->render('checkout/_partials/cart-detailed-totals'),
|
|
'cart_summary_items_subtotal' => $this->render('checkout/_partials/cart-summary-items-subtotal'),
|
|
'cart_summary_subtotals_container' => $this->render('checkout/_partials/cart-summary-subtotals'),
|
|
'cart_summary_totals' => $this->render('checkout/_partials/cart-summary-totals'),
|
|
'cart_detailed_actions' => $this->render('checkout/_partials/cart-detailed-actions'),
|
|
'cart_voucher' => $this->render('checkout/_partials/cart-voucher'),
|
|
]));
|
|
}
|
|
}
|
|
|
|
|
|
class CartOverrideOriginal_remove64d36015216cf extends \stdClass
|
|
{
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageShippingCost($id_carrier = null, $use_tax = true, Country $default_country = null, $product_list = null, $id_zone = null,bool $keepOrderPrices=false,$default=false)
|
|
{
|
|
if($IDzone = (int)Hook::exec('actionGetIDZoneByAddressID'))
|
|
{
|
|
$id_zone = $IDzone;
|
|
}
|
|
if (null === $product_list) {
|
|
$products = $this->getProducts(false, false, null, true);
|
|
} else {
|
|
$products = $product_list;
|
|
}
|
|
if(Module::isEnabled('ets_marketplace') && ($marketplace = Module::getInstanceByName('ets_marketplace')) && $sellers = $marketplace->checkMultiSellerProductList($products))
|
|
{
|
|
$shipping_cost = 0;
|
|
foreach($sellers as $seller)
|
|
{
|
|
$is_virtual= true;
|
|
if($seller)
|
|
{
|
|
foreach($seller as $p)
|
|
{
|
|
if(!$p['is_virtual'])
|
|
{
|
|
$is_virtual = false;
|
|
}
|
|
}
|
|
}
|
|
if(($price=parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$seller,$id_zone,$keepOrderPrices))===false && !$is_virtual)
|
|
return false;
|
|
$shipping_cost += $is_virtual ? 0 : ( $price? :0);
|
|
}
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
else {
|
|
$shipping_cost = parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$products,$id_zone,$keepOrderPrices);
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageList($flush = false)
|
|
{
|
|
if(($address_type = Tools::getValue('address_type')) && $address_type=='shipping_address')
|
|
$this->id_address_delivery = (int)Tools::getValue('id_address',$this->id_address_delivery);
|
|
$final_package_list = parent::getPackageList($flush);
|
|
if($final_package_list)
|
|
{
|
|
foreach($final_package_list as $final_packages)
|
|
{
|
|
foreach($final_packages as $final_package)
|
|
{
|
|
if(!$final_package['carrier_list'] || ($final_package['carrier_list'] && isset($final_package['carrier_list'][0]) && $final_package['carrier_list'][0]===0))
|
|
{
|
|
return array();
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
return $final_package_list;
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getDeliveryOptionList(Country $default_country = null, $flush = false)
|
|
{
|
|
$products = $this->getProducts(false, false, null, true);
|
|
$marketplace = Module::getInstanceByName('ets_marketplace');
|
|
if($marketplace->checkMultiSellerProductList($products) && $marketplace->is17 && Configuration::get('ETS_MP_ENABLE_MULTI_SHIPPING'))
|
|
{
|
|
$delivery_option_list = $marketplace->getDeliveryOptionList($default_country,$flush);
|
|
return $delivery_option_list;
|
|
}
|
|
else
|
|
{
|
|
$delivery_option_list = parent::getDeliveryOptionList($default_country,$flush);
|
|
return $marketplace->changeDeliveryOptionList($delivery_option_list);
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:40:59
|
|
* version: 1.1.7
|
|
*/
|
|
public $_products;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:40:59
|
|
* version: 1.1.7
|
|
*/
|
|
public $shouldSplitGiftProductsQuantity ;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:40:59
|
|
* version: 1.1.7
|
|
*/
|
|
public function applyProductCalculations($row, $shopContext, $productQuantity = null, bool $keepOrderPrices = false)
|
|
{
|
|
return parent::applyProductCalculations($row,$shopContext,$productQuantity,$keepOrderPrices);
|
|
}
|
|
/*
|
|
* module: ets_payment_with_fee
|
|
* date: 2023-08-09 05:41:00
|
|
* version: 2.4.0
|
|
*/
|
|
public function getProducts($refresh = false, $id_product = false, $id_country = null, $fullInfos = true, bool $keepOrderPrices = false,$default=false)
|
|
{
|
|
if($keepOrderPrices || $default || !Module::isEnabled('ets_extraoptions'))
|
|
{
|
|
$products = parent::getProducts($refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($products);
|
|
return $products;
|
|
}
|
|
else
|
|
{
|
|
$this->_products = Module::getInstanceByName('ets_extraoptions')->getProducts($this,$refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($this->_products);
|
|
return $this->_products;
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_payment_with_fee
|
|
* date: 2023-08-09 05:44:52
|
|
* version: 2.4.0
|
|
*/
|
|
public function getOrderTotal(
|
|
$withTaxes = true,
|
|
$type = Cart::BOTH,
|
|
$products = null,
|
|
$id_carrier = null,
|
|
$use_cache = false,
|
|
bool $keepOrderPrices = false,
|
|
$fee_payment = false,
|
|
$only_cart = false
|
|
){
|
|
$total = parent::getOrderTotal($withTaxes,$type,$products,$id_carrier,$use_cache,$keepOrderPrices);
|
|
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;
|
|
}
|
|
}
|
|
|
|
|
|
class CartOverrideOriginal_remove64d3601545917 extends \stdClass
|
|
{
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageShippingCost($id_carrier = null, $use_tax = true, Country $default_country = null, $product_list = null, $id_zone = null,bool $keepOrderPrices=false,$default=false)
|
|
{
|
|
if($IDzone = (int)Hook::exec('actionGetIDZoneByAddressID'))
|
|
{
|
|
$id_zone = $IDzone;
|
|
}
|
|
if (null === $product_list) {
|
|
$products = $this->getProducts(false, false, null, true);
|
|
} else {
|
|
$products = $product_list;
|
|
}
|
|
if(Module::isEnabled('ets_marketplace') && ($marketplace = Module::getInstanceByName('ets_marketplace')) && $sellers = $marketplace->checkMultiSellerProductList($products))
|
|
{
|
|
$shipping_cost = 0;
|
|
foreach($sellers as $seller)
|
|
{
|
|
$is_virtual= true;
|
|
if($seller)
|
|
{
|
|
foreach($seller as $p)
|
|
{
|
|
if(!$p['is_virtual'])
|
|
{
|
|
$is_virtual = false;
|
|
}
|
|
}
|
|
}
|
|
if(($price=parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$seller,$id_zone,$keepOrderPrices))===false && !$is_virtual)
|
|
return false;
|
|
$shipping_cost += $is_virtual ? 0 : ( $price? :0);
|
|
}
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
else {
|
|
$shipping_cost = parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$products,$id_zone,$keepOrderPrices);
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageList($flush = false)
|
|
{
|
|
if(($address_type = Tools::getValue('address_type')) && $address_type=='shipping_address')
|
|
$this->id_address_delivery = (int)Tools::getValue('id_address',$this->id_address_delivery);
|
|
$final_package_list = parent::getPackageList($flush);
|
|
if($final_package_list)
|
|
{
|
|
foreach($final_package_list as $final_packages)
|
|
{
|
|
foreach($final_packages as $final_package)
|
|
{
|
|
if(!$final_package['carrier_list'] || ($final_package['carrier_list'] && isset($final_package['carrier_list'][0]) && $final_package['carrier_list'][0]===0))
|
|
{
|
|
return array();
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
return $final_package_list;
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getDeliveryOptionList(Country $default_country = null, $flush = false)
|
|
{
|
|
$products = $this->getProducts(false, false, null, true);
|
|
$marketplace = Module::getInstanceByName('ets_marketplace');
|
|
if($marketplace->checkMultiSellerProductList($products) && $marketplace->is17 && Configuration::get('ETS_MP_ENABLE_MULTI_SHIPPING'))
|
|
{
|
|
$delivery_option_list = $marketplace->getDeliveryOptionList($default_country,$flush);
|
|
return $delivery_option_list;
|
|
}
|
|
else
|
|
{
|
|
$delivery_option_list = parent::getDeliveryOptionList($default_country,$flush);
|
|
return $marketplace->changeDeliveryOptionList($delivery_option_list);
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:40:59
|
|
* version: 1.1.7
|
|
*/
|
|
public $_products;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:40:59
|
|
* version: 1.1.7
|
|
*/
|
|
public $shouldSplitGiftProductsQuantity ;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:40:59
|
|
* version: 1.1.7
|
|
*/
|
|
public function applyProductCalculations($row, $shopContext, $productQuantity = null, bool $keepOrderPrices = false)
|
|
{
|
|
return parent::applyProductCalculations($row,$shopContext,$productQuantity,$keepOrderPrices);
|
|
}
|
|
/*
|
|
* module: ets_payment_with_fee
|
|
* date: 2023-08-09 05:41:00
|
|
* version: 2.4.0
|
|
*/
|
|
public function getProducts($refresh = false, $id_product = false, $id_country = null, $fullInfos = true, bool $keepOrderPrices = false,$default=false)
|
|
{
|
|
if($keepOrderPrices || $default || !Module::isEnabled('ets_extraoptions'))
|
|
{
|
|
$products = parent::getProducts($refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($products);
|
|
return $products;
|
|
}
|
|
else
|
|
{
|
|
$this->_products = Module::getInstanceByName('ets_extraoptions')->getProducts($this,$refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($this->_products);
|
|
return $this->_products;
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_payment_with_fee
|
|
* date: 2023-08-09 05:44:52
|
|
* version: 2.4.0
|
|
*/
|
|
public function getOrderTotal(
|
|
$withTaxes = true,
|
|
$type = Cart::BOTH,
|
|
$products = null,
|
|
$id_carrier = null,
|
|
$use_cache = false,
|
|
bool $keepOrderPrices = false,
|
|
$fee_payment = false,
|
|
$only_cart = false
|
|
){
|
|
$total = parent::getOrderTotal($withTaxes,$type,$products,$id_carrier,$use_cache,$keepOrderPrices);
|
|
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;
|
|
}
|
|
}
|
|
|
|
|
|
class CartOverrideOriginal_remove64d3601569992 extends \stdClass
|
|
{
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageShippingCost($id_carrier = null, $use_tax = true, Country $default_country = null, $product_list = null, $id_zone = null,bool $keepOrderPrices=false,$default=false)
|
|
{
|
|
if($IDzone = (int)Hook::exec('actionGetIDZoneByAddressID'))
|
|
{
|
|
$id_zone = $IDzone;
|
|
}
|
|
if (null === $product_list) {
|
|
$products = $this->getProducts(false, false, null, true);
|
|
} else {
|
|
$products = $product_list;
|
|
}
|
|
if(Module::isEnabled('ets_marketplace') && ($marketplace = Module::getInstanceByName('ets_marketplace')) && $sellers = $marketplace->checkMultiSellerProductList($products))
|
|
{
|
|
$shipping_cost = 0;
|
|
foreach($sellers as $seller)
|
|
{
|
|
$is_virtual= true;
|
|
if($seller)
|
|
{
|
|
foreach($seller as $p)
|
|
{
|
|
if(!$p['is_virtual'])
|
|
{
|
|
$is_virtual = false;
|
|
}
|
|
}
|
|
}
|
|
if(($price=parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$seller,$id_zone,$keepOrderPrices))===false && !$is_virtual)
|
|
return false;
|
|
$shipping_cost += $is_virtual ? 0 : ( $price? :0);
|
|
}
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
else {
|
|
$shipping_cost = parent::getPackageShippingCost($id_carrier,$use_tax,$default_country,$products,$id_zone,$keepOrderPrices);
|
|
if($default || !Module::isEnabled('ets_shippingcost'))
|
|
return $shipping_cost;
|
|
if(Module::isEnabled('ets_shippingcost'))
|
|
Module::getInstanceByName('ets_shippingcost')->getPackageShippingCost($id_carrier,$use_tax,$shipping_cost);
|
|
return $shipping_cost;
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getPackageList($flush = false)
|
|
{
|
|
if(($address_type = Tools::getValue('address_type')) && $address_type=='shipping_address')
|
|
$this->id_address_delivery = (int)Tools::getValue('id_address',$this->id_address_delivery);
|
|
$final_package_list = parent::getPackageList($flush);
|
|
if($final_package_list)
|
|
{
|
|
foreach($final_package_list as $final_packages)
|
|
{
|
|
foreach($final_packages as $final_package)
|
|
{
|
|
if(!$final_package['carrier_list'] || ($final_package['carrier_list'] && isset($final_package['carrier_list'][0]) && $final_package['carrier_list'][0]===0))
|
|
{
|
|
return array();
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
return $final_package_list;
|
|
}
|
|
/*
|
|
* module: ets_marketplace
|
|
* date: 2023-08-08 04:28:58
|
|
* version: 3.6.4
|
|
*/
|
|
public function getDeliveryOptionList(Country $default_country = null, $flush = false)
|
|
{
|
|
$products = $this->getProducts(false, false, null, true);
|
|
$marketplace = Module::getInstanceByName('ets_marketplace');
|
|
if($marketplace->checkMultiSellerProductList($products) && $marketplace->is17 && Configuration::get('ETS_MP_ENABLE_MULTI_SHIPPING'))
|
|
{
|
|
$delivery_option_list = $marketplace->getDeliveryOptionList($default_country,$flush);
|
|
return $delivery_option_list;
|
|
}
|
|
else
|
|
{
|
|
$delivery_option_list = parent::getDeliveryOptionList($default_country,$flush);
|
|
return $marketplace->changeDeliveryOptionList($delivery_option_list);
|
|
}
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:40:59
|
|
* version: 1.1.7
|
|
*/
|
|
public $_products;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:40:59
|
|
* version: 1.1.7
|
|
*/
|
|
public $shouldSplitGiftProductsQuantity ;
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:40:59
|
|
* version: 1.1.7
|
|
*/
|
|
public function applyProductCalculations($row, $shopContext, $productQuantity = null, bool $keepOrderPrices = false)
|
|
{
|
|
return parent::applyProductCalculations($row,$shopContext,$productQuantity,$keepOrderPrices);
|
|
}
|
|
/*
|
|
* module: ets_payment_with_fee
|
|
* date: 2023-08-09 05:41:00
|
|
* version: 2.4.0
|
|
*/
|
|
public function getProducts($refresh = false, $id_product = false, $id_country = null, $fullInfos = true, bool $keepOrderPrices = false,$default=false)
|
|
{
|
|
if($keepOrderPrices || $default || !Module::isEnabled('ets_extraoptions'))
|
|
{
|
|
$products = parent::getProducts($refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($products);
|
|
return $products;
|
|
}
|
|
else
|
|
{
|
|
$this->_products = Module::getInstanceByName('ets_extraoptions')->getProducts($this,$refresh,$id_product,$id_country,$fullInfos,$keepOrderPrices);
|
|
$custom_payment = Module::getInstanceByName('ets_payment_with_fee');
|
|
$custom_payment->getProductsPaypal($this->_products);
|
|
return $this->_products;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
class CartControllerOverrideOriginal_remove64d360158e0c4 extends \stdClass
|
|
{
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:41:00
|
|
* version: 1.1.7
|
|
*/
|
|
public function processChangeProductInCart()
|
|
{
|
|
|
|
$module = null;
|
|
if(Module::isEnabled('ets_extraoptions'))
|
|
$module = Module::getInstanceByName('ets_extraoptions');
|
|
if ($module)
|
|
$module->validateAddCustomAttributeToCart($this->errors, $this->id_product);
|
|
parent::processChangeProductInCart();
|
|
if ($module && !$this->errors)
|
|
$module->postAddCustomAttributeToCart($this->id_product, $this->id_product_attribute, $this->qty, $this->customization_id);
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:41:00
|
|
* version: 1.1.7
|
|
*/
|
|
public function productInCartMatchesCriteria($productInCart)
|
|
{
|
|
return (
|
|
!isset($this->id_product_attribute) ||
|
|
(
|
|
$productInCart['id_product_attribute'] == $this->id_product_attribute &&
|
|
$productInCart['id_customization'] == $this->customization_id
|
|
)
|
|
) && isset($this->id_product) && $productInCart['id_product'] == $this->id_product && (!isset($productInCart['id_combination']) || $productInCart['id_combination']==(int)Tools::getValue('id_combination'));
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:44:52
|
|
* version: 1.1.7
|
|
*/
|
|
public function displayAjaxRefresh()
|
|
{
|
|
if (Configuration::isCatalogMode()) {
|
|
return;
|
|
}
|
|
ob_end_clean();
|
|
header('Content-Type: application/json');
|
|
$this->ajaxRender(json_encode([
|
|
'cart_detailed' => $this->context->smarty->fetch(_PS_MODULE_DIR_.'ets_extraoptions/views/templates/hook/checkout/cart-detailed.tpl'),
|
|
'cart_detailed_totals' => $this->render('checkout/_partials/cart-detailed-totals'),
|
|
'cart_summary_items_subtotal' => $this->render('checkout/_partials/cart-summary-items-subtotal'),
|
|
'cart_summary_subtotals_container' => $this->render('checkout/_partials/cart-summary-subtotals'),
|
|
'cart_summary_totals' => $this->render('checkout/_partials/cart-summary-totals'),
|
|
'cart_detailed_actions' => $this->render('checkout/_partials/cart-detailed-actions'),
|
|
'cart_voucher' => $this->render('checkout/_partials/cart-voucher'),
|
|
]));
|
|
}
|
|
}
|
|
|
|
|
|
class CartControllerOverrideOriginal_remove64d36015b36ef extends \stdClass
|
|
{
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:41:00
|
|
* version: 1.1.7
|
|
*/
|
|
public function processChangeProductInCart()
|
|
{
|
|
|
|
$module = null;
|
|
if(Module::isEnabled('ets_extraoptions'))
|
|
$module = Module::getInstanceByName('ets_extraoptions');
|
|
if ($module)
|
|
$module->validateAddCustomAttributeToCart($this->errors, $this->id_product);
|
|
parent::processChangeProductInCart();
|
|
if ($module && !$this->errors)
|
|
$module->postAddCustomAttributeToCart($this->id_product, $this->id_product_attribute, $this->qty, $this->customization_id);
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:41:00
|
|
* version: 1.1.7
|
|
*/
|
|
public function productInCartMatchesCriteria($productInCart)
|
|
{
|
|
return (
|
|
!isset($this->id_product_attribute) ||
|
|
(
|
|
$productInCart['id_product_attribute'] == $this->id_product_attribute &&
|
|
$productInCart['id_customization'] == $this->customization_id
|
|
)
|
|
) && isset($this->id_product) && $productInCart['id_product'] == $this->id_product && (!isset($productInCart['id_combination']) || $productInCart['id_combination']==(int)Tools::getValue('id_combination'));
|
|
}
|
|
/*
|
|
* module: ets_extraoptions
|
|
* date: 2023-08-09 05:44:52
|
|
* version: 1.1.7
|
|
*/
|
|
public function displayAjaxRefresh()
|
|
{
|
|
if (Configuration::isCatalogMode()) {
|
|
return;
|
|
}
|
|
ob_end_clean();
|
|
header('Content-Type: application/json');
|
|
$this->ajaxRender(json_encode([
|
|
'cart_detailed' => $this->context->smarty->fetch(_PS_MODULE_DIR_.'ets_extraoptions/views/templates/hook/checkout/cart-detailed.tpl'),
|
|
'cart_detailed_totals' => $this->render('checkout/_partials/cart-detailed-totals'),
|
|
'cart_summary_items_subtotal' => $this->render('checkout/_partials/cart-summary-items-subtotal'),
|
|
'cart_summary_subtotals_container' => $this->render('checkout/_partials/cart-summary-subtotals'),
|
|
'cart_summary_totals' => $this->render('checkout/_partials/cart-summary-totals'),
|
|
'cart_detailed_actions' => $this->render('checkout/_partials/cart-detailed-actions'),
|
|
'cart_voucher' => $this->render('checkout/_partials/cart-voucher'),
|
|
]));
|
|
}
|
|
}
|