Post by zionhealth » Sun Feb 17, 2019 9:20 am

I would appreciate some assistance with understanding the Opencart rewards system in v2.3.0.2. I am confused as to how the reward point dollar amount is calculated?

I understand that the reward is based on a per product basis. As an example, we have a product which sales for 7.99.
In the rewards tab of the product, we set the "Points" to 799 (points needed to buy this item)
In each "Customer Group" section, for this product, we enter 26 (points received for each purchase)

Below was taken from an order that we received this weekend. The customer bought 5 items, each priced at 7.99 (Subtotal below 39.95). The customer had 1642 reward points on their reward account. Checkout calculated those 1642 reward points to have a dollar amount of -28.82, which was deducted from the order amount. The customer paid 12.13 for the order.

Sub-Total $39.95
Reward Points (1624) $-28.82
Free Shipping $0.00
CA Tax $1.00
Total $12.13

What we don't understand, is how the reward point dollar amount (28.82) was calculated?

New member


Tue Oct 18, 2016 8:12 am

Post by straightlight » Sun Feb 17, 2019 11:20 pm

In system/library/cart/cart.php file:

Code: Select all

'points'          => ($product_query->row['points'] ? ($product_query->row['points'] + $option_points) * $cart['quantity'] : 0),
Then, gets recalculated in your catalog/model/extension/total/reward.php file:

Code: Select all

$points_total = 0;

				foreach ($this->cart->getProducts() as $product) {
					if ($product['points']) {
						$points_total += $product['points'];

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.

Programmer / Opencart Tester

Legendary Member


Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 17 guests