I've searched around for an extension that allows me to set the maximum reward points usable for each purchase, but have not found any. My store is already using OC's default reward point system version 1.5.2.1.
Hopefully this is a small job for someone. I'm willing to pay, let me know if you are interested and PM me a quote. Or if anyone knows how I can get this done with just some code changes, I'd really appreciate your help.
Hopefully this is a small job for someone. I'm willing to pay, let me know if you are interested and PM me a quote. Or if anyone knows how I can get this done with just some code changes, I'd really appreciate your help.
Hey,
Happy to do this for you - you're looking at about $30USD - PM if you are interested. It would by having an option in the Settings where you can specify the max. reward points that can be used per order.
I'm happy to develop the extension and install it on a server of mine for you to view and test before making payment.
Regards
Happy to do this for you - you're looking at about $30USD - PM if you are interested. It would by having an option in the Settings where you can specify the max. reward points that can be used per order.
I'm happy to develop the extension and install it on a server of mine for you to view and test before making payment.
Regards
Open up catalog/controller/cart.phpyarac wrote:I've searched around for an extension that allows me to set the maximum reward points usable for each purchase, but have not found any. My store is already using OC's default reward point system version 1.5.2.1.
Hopefully this is a small job for someone. I'm willing to pay, let me know if you are interested and PM me a quote. Or if anyone knows how I can get this done with just some code changes, I'd really appreciate your help.
find
Code: Select all
if ($this->request->post['reward'] > $points_total) {
$this->error['warning'] = sprintf($this->language->get('error_maximum'), $points_total);
}
Code: Select all
if ($this->request->post['reward'] > 10) {
$this->error['warning'] = $this->language->get('error_reward_points');
}
find
Code: Select all
$_['error_reward'] = 'Warning: Please enter the amount of reward points to use!';
Code: Select all
$_['error_reward_points'] = 'Warning: You cannot use more than 10 reward points!';

change the '10' to a number you wish to set it as.
The above does the job, but the $30USD would make it a vqmod/extension, and allow the user to set the "Reward limit" in the admin section (as opposed to having to set it in code).
The above quick fix is sufficient if what I mentioned is not required.
Regards
The above quick fix is sufficient if what I mentioned is not required.
Regards
it should be pretty similar in OC 2 too (not confirmed). Try searching the files for similar lines
hi for version 2.0.2.0
Find this in catalog/controller/checkout/reward.php
Change the points_total=0
then The Points_total <= $product['points'];
Like this
I use 200 as maximum usage of points every order.
you can set your own amount, just remember to change the + (plus) to < (lessthan sign).
You will see 2 set of codes in catalog/controller/checkout/reward.php
in public function reward() {
and public function index() {
change them Both
Find this in catalog/controller/checkout/reward.php
Code: Select all
$points_total = 0;
foreach ($this->cart->getProducts() as $product) {
if ($product['points']) {
$points_total += $product['points'];
}
}
Change the points_total=0
then The Points_total <= $product['points'];
Like this
Code: Select all
$points_total = 200;
foreach ($this->cart->getProducts() as $product) {
if ($product['points']) {
$points_total <= $product['points'];
}
}
I use 200 as maximum usage of points every order.
you can set your own amount, just remember to change the + (plus) to < (lessthan sign).
You will see 2 set of codes in catalog/controller/checkout/reward.php
in public function reward() {
and public function index() {
change them Both
Set a max points allowed in opencart ver 3.0.2
I did some work but here it is...I hope I am able to help someone out.
To change the max reward points in ver 3.0.2:
1. Go to catalog/controller/extension/total/reward.php
2. Look for:
if ($this->request->post['reward'] > $points_total) {
$json['error'] = sprintf($this->language->get('error_maximum'), $points_total);
}
3. Add this right below it (I use 50 points as the max on my site but you can change to your choice of max points):
if ($this->request->post['reward'] > 50) {
$json['error'] = sprintf($this->language->get('error_maximum'));
}
4. Save the file.
5. Then go to catalog/language/en-gb/extension/total/reward.php
6. Add this in the (error section) below. Again remember to change the 50 to your choice of max points:
$_['error_maximum'] = 'Warning: The maximum number of points that can be applied is 50!';
7. Save it and upload.
8. Test it and voila!
I really hope this helps somebody out because it took me a looong while to figure this out, especially since I am not a developer pasae.
I did some work but here it is...I hope I am able to help someone out.
To change the max reward points in ver 3.0.2:
1. Go to catalog/controller/extension/total/reward.php
2. Look for:
if ($this->request->post['reward'] > $points_total) {
$json['error'] = sprintf($this->language->get('error_maximum'), $points_total);
}
3. Add this right below it (I use 50 points as the max on my site but you can change to your choice of max points):
if ($this->request->post['reward'] > 50) {
$json['error'] = sprintf($this->language->get('error_maximum'));
}
4. Save the file.
5. Then go to catalog/language/en-gb/extension/total/reward.php
6. Add this in the (error section) below. Again remember to change the 50 to your choice of max points:
$_['error_maximum'] = 'Warning: The maximum number of points that can be applied is 50!';
7. Save it and upload.
8. Test it and voila!
I really hope this helps somebody out because it took me a looong while to figure this out, especially since I am not a developer pasae.
Who is online
Users browsing this forum: paulfeakins and 5 guests