Skip to content

Commit

Permalink
Incorrect Comparision condition
Browse files Browse the repository at this point in the history
I later tested and realized in some conditions when user uses all of his reward points this conditon fails to work.
  • Loading branch information
DrSinghDMD committed Nov 3, 2015
1 parent 5c4e325 commit 70a451c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion upload/catalog/model/total/reward.php
Expand Up @@ -65,7 +65,7 @@ public function confirm($order_info, $order_total) {

$this->load->model('account/customer');

if ($this->model_account_customer->getRewardTotal($order_info['customer_id']) > $points) {
if ($this->model_account_customer->getRewardTotal($order_info['customer_id']) >= $points) {
$this->db->query("INSERT INTO " . DB_PREFIX . "customer_reward SET customer_id = '" . (int)$order_info['customer_id'] . "', order_id = '" . (int)$order_info['order_id'] . "', description = '" . $this->db->escape(sprintf($this->language->get('text_order_id'), (int)$order_info['order_id'])) . "', points = '" . (float)-$points . "', date_added = NOW()");
} else {
return $this->config->get('config_fraud_status_id');
Expand Down

0 comments on commit 70a451c

Please sign in to comment.