Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OC2.3.1] reward points not added to returning customer #3161

Closed
beifloyd opened this Issue Jul 4, 2015 · 4 comments

Comments

Projects
None yet
3 participants
@beifloyd
Copy link

beifloyd commented Jul 4, 2015

this is what's happening:

  • returning customer buys a product and uses it's reward points to partially pay for it.
  • reward points are deducted=discount applied to the order.
  • when I go to process the order in the back end, the reward points button is ALREADY red (showing remove reward points)
  • Looking at the points history for the specific customer, no new points have been added. Correct points have been deducted and used for the order but new points not added.
  • This can be confirmed by checking the points in the DB, (with phpmyadmin)
  • In addition, clicking on the red button has no effect, it will change the button to green and clicking on it again will switch it back to red. No changes in the DB.

no other issues detected so far.

@danijelGombac

This comment has been minimized.

Copy link
Contributor

danijelGombac commented Jul 4, 2015

The error is in public function getTotalCustomerRewardsByOrderId query in customer.php model where is checking for all rewards points. Add to the end AND points > 0.

@beifloyd

This comment has been minimized.

Copy link
Author

beifloyd commented Jul 4, 2015

Do you mean the line 503 in admin\model\sale\customer.php should be like this

public function getTotalCustomerRewardsByOrderId($order_id) {
$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "customer_reward WHERE order_id = '" . (int)$order_id . "' AND points > 0");

@danijelGombac

This comment has been minimized.

Copy link
Contributor

danijelGombac commented Jul 4, 2015

Yes

@beifloyd

This comment has been minimized.

Copy link
Author

beifloyd commented Jul 4, 2015

alright, I'll add a pull request linked to this.

beifloyd added a commit to beifloyd/opencart that referenced this issue Jul 4, 2015

danielkerr added a commit that referenced this issue Aug 14, 2015

@danielkerr danielkerr closed this Aug 14, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.