Correction anomalie 0000006 soumise le 18/11/2019 : Problème montant total à 0€ (paiement Paypal) sur génération de facture en masse (pdf)
This commit is contained in:
@@ -420,30 +420,28 @@ class Cart extends CartCore
|
||||
$order_total += $shipping_fees + $wrapping_fees;
|
||||
}
|
||||
}//else
|
||||
$id_defaultgroup = Db::getInstance()->executeS('SELECT id_default_group FROM ' . _DB_PREFIX_ . 'customer WHERE id_customer = ' . (int) Context::getContext()->customer->id);
|
||||
if(is_array($id_defaultgroup))
|
||||
{
|
||||
$id_defaultgroup = $id_defaultgroup[0]['id_default_group'];
|
||||
}
|
||||
$sql = 'SELECT price FROM `' . _DB_PREFIX_ . 'installmentpayment_group` WHERE id_group=' . (int) $id_defaultgroup;
|
||||
$data = Db::getInstance()->getRow($sql);
|
||||
if(!empty($data)){
|
||||
$order_total = $order_total - ($order_total * (100 - $data['price']) / 100);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if ((int) Configuration::get('ACOMPTE_TYPE') == 1) {
|
||||
if ($order_total > (float) Configuration::get('ACOMPTE_PERCENTAGE')) {
|
||||
$order_total = (float) Configuration::get('ACOMPTE_PERCENTAGE');
|
||||
|
||||
if (Module::isEnabled('installmentpayment')) {
|
||||
$id_defaultgroup = Db::getInstance()->executeS('SELECT id_default_group FROM ' . _DB_PREFIX_ . 'customer WHERE id_customer = ' . (int)Context::getContext()->customer->id);
|
||||
if (is_array($id_defaultgroup)) {
|
||||
$id_defaultgroup = $id_defaultgroup[0]['id_default_group'];
|
||||
}
|
||||
$sql = 'SELECT price FROM `' . _DB_PREFIX_ . 'installmentpayment_group` WHERE id_group=' . (int)$id_defaultgroup;
|
||||
$data = Db::getInstance()->getRow($sql);
|
||||
if (!empty($data) && ($data['price'] != '')) {
|
||||
$order_total = $order_total - ($order_total * (100 - $data['price']) / 100);
|
||||
} else {
|
||||
if ((int)Configuration::get('ACOMPTE_TYPE') == 1) {
|
||||
if ($order_total > (float)Configuration::get('ACOMPTE_PERCENTAGE')) {
|
||||
$order_total = (float)Configuration::get('ACOMPTE_PERCENTAGE');
|
||||
}
|
||||
} else {
|
||||
$order_total = $order_total - ($order_total * (100 - Configuration::get('ACOMPTE_PERCENTAGE')) / 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($page_name == 'installmentpayment' || (isset(Context::getContext()->cookie->installmentpayment_id_order) && !empty(Context::getContext()->cookie->installmentpayment_id_order))) {
|
||||
if ($page_name == 'installmentpayment' || (isset(Context::getContext()->cookie->installmentpayment_id_order) && !empty(Context::getContext()->cookie->installmentpayment_id_order))) {
|
||||
if (Tools::getValue('select') != '') {
|
||||
Context::getContext()->cookie->__set('installmentpayment_id_order', (int) Tools::getValue('select'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user