Merge branch 'ticket-14974-refundvoucher'

This commit is contained in:
Michael RICOIS 2017-12-04 11:13:24 +01:00
commit 208863c779

View File

@ -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;
}