Get discount use in order
This commit is contained in:
parent
2437dd9d04
commit
78aefa4f1b
@ -42,8 +42,12 @@ class Ant_Refund_Discount extends Module
|
||||
if ($this->debuglog) file_put_contents(_PS_ROOT_DIR_.'/log/ant_refund_discount.log', 'Discount : '.$orderParams->total_discounts."\n");
|
||||
if ($this->debuglog) file_put_contents(_PS_ROOT_DIR_.'/log/ant_refund_discount.log', print_r($params, 1), FILE_APPEND);
|
||||
|
||||
// Select if a discount is associated to the order
|
||||
$nbDiscount = Db::getInstance()->getValue("SELECT count(*) AS nb FROM `"._DB_PREFIX_."order_discount` od
|
||||
WHERE od.`id_order`=".(int)$orderParams->id);
|
||||
|
||||
// If we have no discount
|
||||
if ($orderParams->total_discounts == 0) {
|
||||
if ($nbDiscount == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user