Merge branch 'fix-loyalty' into develop

This commit is contained in:
Marion Muszynski 2016-09-14 12:22:23 +02:00
commit 995e23ccd0

View File

@ -247,8 +247,8 @@ class Loyalty extends Module
if (Tools::isSubmit('submitUpdateLoyaltyOrders'))
{
$this->updateLoyaltyOrders();
echo $this->displayConfirmation($this->l('Loyalty Orders updated.'));
$count_orders = $this->updateLoyaltyOrders();
echo $this->displayConfirmation($count_orders.' '.$this->l('Loyalty Orders updated.'));
}
}
@ -415,7 +415,6 @@ class Loyalty extends Module
<div class="clear center">
<input type="submit" style="margin-top:20px" name="submitUpdateLoyaltyOrders" id="submitUpdateLoyaltyOrders" value="'.$this->l(' Update Loyalty Orders ').'" class="button" />
</div>
</fieldset>
</form>';
return $html;
@ -426,6 +425,7 @@ class Loyalty extends Module
include_once(dirname(__FILE__).'/LoyaltyStateModule.php');
include_once(dirname(__FILE__).'/LoyaltyModule.php');
$count_orders = 0;
foreach (Db::getInstance()->ExecuteS('
SELECT lo.`id_order`, oh.`id_order_state`
FROM `'._DB_PREFIX_.'loyalty` lo
@ -448,8 +448,9 @@ class Loyalty extends Module
}
}
$loyalty->save();
$count_orders++;
}
return true;
return $count_orders;
}
public static function recurseCategoryForInclude($id_obj, $indexedCategories, $categories, $current, $id_category = 1, $id_category_default = NULL, $has_suite = array())