Forums / All Other Contributions/Addons / Reward Points Module for ZC v13x

Reward Points Module for ZC v13x

Locked

Views: 472,061

Results 21 to 40 of 2,476
This thread is locked. New replies are disabled.
19 Apr 2008, 8:41 AM
#21
hem avatar

hem

Totally Zenned

Join Date:
Sep 2007
Location:
Dublin, Ireland
Posts:
1,281
Plugin Contributions:
5

Reward Points Module for ZC v13x

fiji:

In the stylesheet_reward.css , delete "width:20em;" in the first label.inputLabel.:smartalec:

Fiji

That'll work- but be aware it will screw up the formating of the Redeem Point display in the checkout.

Andrew

Andrew Moore
Omnicia Agile Development
www.omnicia.com

19 Apr 2008, 8:47 AM
#22
mike_dean avatar

mike_dean

Totally Zenned

Join Date:
Feb 2006
Location:
Central Coast, NSW, Australia
Posts:
531
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

NullMind:

And BTW, my site is live and running the contribution .. if anybody wishes to check it out :)

http://rcnut.com/Reward-Points-FAQ-ezp-16

http://rcnut.com/

Off topic in know, but had to comment...

Very Nice site.... and a well written FAQ..

Norts And Ones
Norts And Ones

19 Apr 2008, 11:02 AM
#23
imperialis avatar

imperialis

Zen Follower

Join Date:
Apr 2008
Posts:
123
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

hem:

See the earlier post in this thread regarding the bug with the update.sql file. If this is the first time you've installed the mod then run new.sql not update.sql

Instructions to bypass this bug:

  1. Go to folder \admin\includes\functions\extra_functions\
  1. Rename reward_points_functions.php to reward_points_functions.xxx
  1. You can now access the Admin CP
  1. Go to Tools->Install SQL PAtch
  1. Enter the following SQL: RENAME TABLE reward_points_history TO reward_status_track
  1. Then rename reward_points_functions.xxx back to reward_points_functions.php

Note: This will not work if you use prefixes on your database. In this case either run new.sql or rename the table using phpmysql

I did what you said and I get this error
1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SQL: RENAME TABLE reward_points_history TO reward_status_track' at line 1
in:
[SQL: RENAME TABLE reward_points_history TO reward_status_track ;]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

I am new to zencart so i could have done anything wrong

19 Apr 2008, 12:14 PM
#24
pinetreecandles avatar

pinetreecandles

Zen Follower

Join Date:
Feb 2008
Location:
West Virginia
Posts:
135
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

imperialis:

I did what you said and I get this error
1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SQL: RENAME TABLE reward_points_history TO reward_status_track' at line 1
in:
[SQL: RENAME TABLE reward_points_history TO reward_status_track ;]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

I am new to zencart so i could have done anything wrong

If you use a prefix in your table names (iE mine is zen_) then you would need to change that SQL statement to read:

RENAME TABLE `zen_reward_point_history` TO `zen_reward_status_track`;

If your prefix is different you just replace zen_ with yours. Then run it. It should make the change then.

Zen Cart: 1.3.8a
PHP: 5.2.4
MySQL: 5.0.45

Pine Tree Candles

19 Apr 2008, 12:15 PM
#25
rasyr avatar

rasyr

Zen Follower

Join Date:
Aug 2006
Posts:
233
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

Something odd......

IF I try to place an order using Reward Points, and I ALSO try to use a Gift Certificate as well (if the GC amount is not higher than entire order), it requires me to select a billing method. If the GC and the Redeem amounts are (combined) more than the entire order, it still requires me to select a payment method.

However, if I try to place the order with JUST a Gift Certificate, and the GC amount is larger than the order, then I don't have to select a payment method.

So... whatever it doing the check as to whether payment method is required to be select isn't including the amount to be redeemed in it.

Also -- regarding my issue with Rewards Points and the redeeming applying towards shipping....

I found the following code in ot_rewards_points.php -- in the process() function

if(isset($_SESSION['redeem_value']))
{
$points_redeeming=GetCustomersRewardPoints($_SESSION['customer_id']);
if(REWARD_POINTS_REDEEM_MAXIMUM>0 && $points_redeeming>REWARD_POINTS_REDEEM_MAXIMUM)
$points_redeeming=REWARD_POINTS_REDEEM_MAXIMUM;

  	$redeem_ratio=GetRedeemRatio($_SESSION['customer_id']);
  	$points_worth=$points_redeeming*$redeem_ratio;
  	$order_total = $order->info['total'];

  	if($points_worth>$order_total)
  	{
  		$points_worth=$order_total;
  		$points_redeeming=zen_round($points_worth/$redeem_ratio,2);
  	}

  	$order->info['total']=zen_round($order->info['total']-$points_worth, 2);
  	
  	$this->output[] = array('title' => MODULE_ORDER_TOTAL_REWARD_POINTS_VALUE,
  							'text' => '-'.$currencies->format($points_worth),
  							'value' => $points_worth);
  							
  	$_SESSION['redeem_value']=$points_redeeming;
  }

I have marked the two lines that I consider important in color-- the lines which show that the file is working on the Order Total, not on the Order Subtotal, which is what I am needing.

Wait! I just NOW (while writing this) figured out, that if I change $order->info['total'] to $order->info['subtotal'] in the Blue line, then that limits the number of points redeemed to be no more than the Subtotal, and thus, it will solve my issue about redeeming points also discounting the shipping.

I also have the problem where folks whose orders are being changed from Pending to Paid are not updating and moving the points from Pending to Earned. However I also had the admin email notification turned off, so I have set it to an email address I created just for it, and turned it on in the Configuration area, so maybe that will get the points to change properly.

This is a great module!! And I am loving it immensely!! :clap: I just hope you can help get my other issues worked out. :D

19 Apr 2008, 12:51 PM
#26
pinetreecandles avatar

pinetreecandles

Zen Follower

Join Date:
Feb 2008
Location:
West Virginia
Posts:
135
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

Look at the image I posted. The Total = Subtotal + Shipping - Reward Point

I had thought it was (and am wanting it to be)

Total = (Subtotal - Reward Point) + Shipping

So, if I have an $8.50 book, and Shipping costs $3.13 and I have 1000 Reward Points, that my final total is $3.13, NOT $1.63 (as shown in the image I posted)

I see what you mean now. I never noticed that before. All my testing I never had the amount to redeem exceed the subtotal. Good catch.

I'm not a coder so I'm not sure what the side effects will be on changing the code from: $order_total = $order->info['total']; to ```
$order_total = $order->info['subtotal'];


 I guess that's what test sites are for :smile:

Zen Cart: 1.3.8a
PHP: 5.2.4
MySQL: 5.0.45

Pine Tree Candles

19 Apr 2008, 12:55 PM
#27
pinetreecandles avatar

pinetreecandles

Zen Follower

Join Date:
Feb 2008
Location:
West Virginia
Posts:
135
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

Rasyr:

I also have the problem where folks whose orders are being changed from Pending to Paid are not updating and moving the points from Pending to Earned. However I also had the admin email notification turned off, so I have set it to an email address I created just for it, and turned it on in the Configuration area, so maybe that will get the points to change properly.

You need the email turned on. I always forget to turn it on, on my local test site and when I do, it wont award points or change points when a status change is made from admin without it on. I think andy said some where that it's hooked to the email function so it needs to be on. I maybe wrong, but it works for me if it is.

Zen Cart: 1.3.8a
PHP: 5.2.4
MySQL: 5.0.45

Pine Tree Candles

19 Apr 2008, 1:09 PM
#28
rasyr avatar

rasyr

Zen Follower

Join Date:
Aug 2006
Posts:
233
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

pinetreecandles:

I see what you mean now. I never noticed that before. All my testing I never had the amount to redeem exceed the subtotal. Good catch.

I'm not a coder so I'm not sure what the side effects will be on changing the code from: $order_total = $order->info['total']; to ```
$order_total = $order->info['subtotal'];


From the looks of the code, the blue line sets a variable which is then used to determin how many Reward Points are redeemed. I didn't see it used anywhere else in that function (and since it was declared inside the function, that makes it a local variable, not a global).

As for email -- I turned it on, and setup an account to catch the notifications. And after doing that, I had a person place an order, earning himself 88 RP -- he paid with a CC, not Paypal -- so this isn't a Paypal issue.

Anyways, the new account received the notification email just fine. But the RP were not moved from Pending to Earned (sunrise is set to zero). 

I did test and manually changing the Order Status did get the points to move from Pending to Earned.
19 Apr 2008, 1:23 PM
#29
pinetreecandles avatar

pinetreecandles

Zen Follower

Join Date:
Feb 2008
Location:
West Virginia
Posts:
135
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

Rasyr:

As for email -- I turned it on, and setup an account to catch the notifications. And after doing that, I had a person place an order, earning himself 88 RP -- he paid with a CC, not Paypal -- so this isn't a Paypal issue.

Anyways, the new account received the notification email just fine. But the RP were not moved from Pending to Earned (sunrise is set to zero).

I did test and manually changing the Order Status did get the points to move from Pending to Earned.

Have you tested it using check or money order? That is how I have tested it and it works that way. I have not done it any other way on my test site since it's local and I can't get my other payments to work local. Also how are your triggers set? In other words, what status change is needed to move it from Pending to Earned?

I guess I will have to setup a test account on the online server so I can test this with my other payment options before I make the changes to the live store.

Zen Cart: 1.3.8a
PHP: 5.2.4
MySQL: 5.0.45

Pine Tree Candles

19 Apr 2008, 2:14 PM
#30
rasyr avatar

rasyr

Zen Follower

Join Date:
Aug 2006
Posts:
233
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

The only methods of payment on the Store are via Credit Card (we use Linkpoint), and Paypal (and nobody has paid using Paypal since we implemented this).

As for the triggers, I used the Advanced and they are set as follows:

Pend: [Pending, Canceled] Earn: [Paid, Shipped, Update,
Printed]

And I have the Order Status of "Testing" set to "Ignore"

Completed CC orders are set to "Paid" (same for completed Paypal Orders -- Paypal only remains "Pending" if the person uses echeck, which takes several days to process before the money is released into the account).

(note: and yes, I am on a live store...)

19 Apr 2008, 3:05 PM
#31
berserker avatar

berserker

Totally Zenned

Join Date:
May 2006
Posts:
712
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

hem:

That'll work- but be aware it will screw up the formating of the Redeem Point display in the checkout.

Is there any other way to sort it out without messing anything?

19 Apr 2008, 3:07 PM
#32
berserker avatar

berserker

Totally Zenned

Join Date:
May 2006
Posts:
712
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

Rasyr:

Paypal (and nobody has paid using Paypal since we implemented this).

That's good to know! I guess i'll stick with credit/debit card for my site.

19 Apr 2008, 3:29 PM
#33
rasyr avatar

rasyr

Zen Follower

Join Date:
Aug 2006
Posts:
233
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

Berserker:

That's good to know! I guess i'll stick with credit/debit card for my site.

I only implemented this module on our store yesterday afternoon. :D

I won't know about Paypal working until somebody makes a purchase using it.

19 Apr 2008, 3:44 PM
#34
berserker avatar

berserker

Totally Zenned

Join Date:
May 2006
Posts:
712
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

How do you set up how much is a point worth? For example, 1 point = 2 pence?

19 Apr 2008, 3:51 PM
#35
meltdown avatar

meltdown

Totally Zenned

Join Date:
Jun 2006
Location:
My family and I live in Brighton, England
Posts:
947
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

Berserker:

How do you set up how much is a point worth? For example, 1 point = 2 pence?

I like the way RCnut clarified it in his FAQ's:

Points and Values
Currently, for every £1.00 spent at RC NUT you'll earn 1.00 point. Each point is worth £0.02 off a future purchase.
For example:
Product Cost: £250.00
Value of Points Earned: £5.00

19 Apr 2008, 4:00 PM
#36
berserker avatar

berserker

Totally Zenned

Join Date:
May 2006
Posts:
712
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

MeltDown:

I like the way RCnut clarified it in his FAQ's:

I know but I don't know how to set that up

19 Apr 2008, 4:12 PM
#37
berserker avatar

berserker

Totally Zenned

Join Date:
May 2006
Posts:
712
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

What does the #rewardWrapper control? I changed some of it but can see any of the changes.

19 Apr 2008, 4:28 PM
#38
pinetreecandles avatar

pinetreecandles

Zen Follower

Join Date:
Feb 2008
Location:
West Virginia
Posts:
135
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

Berserker:

I know but I don't know how to set that up

The redeem value is set in admin>Customers>Group Reward Redeem. You can set it globally or create a group and set it for that group.

Zen Cart: 1.3.8a
PHP: 5.2.4
MySQL: 5.0.45

Pine Tree Candles

19 Apr 2008, 5:37 PM
#39
rasyr avatar

rasyr

Zen Follower

Join Date:
Aug 2006
Posts:
233
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

MeltDown:

I like the way RCnut clarified it in his FAQ's:

So did I. I even went ahead and created my own FAQ that is **HEAVILY **inspired by the one Nullmind did for his site.

http://shop.ironcrown.com/index.php?main_page=reward_points_faq

19 Apr 2008, 6:14 PM
#40
pinetreecandles avatar

pinetreecandles

Zen Follower

Join Date:
Feb 2008
Location:
West Virginia
Posts:
135
Plugin Contributions:
0

Re: Reward Points Module for ZC v13x

Rasyr:

So did I. I even went ahead and created my own FAQ that is **HEAVILY **inspired by the one Nullmind did for his site.

http://shop.ironcrown.com/index.php?main_page=reward_points_faq

Mine pales in comparison to his. Well done:clap: I guess I will have to revist mine and give it it's own page since atm it's buried with my other FAQ's. :(

Zen Cart: 1.3.8a
PHP: 5.2.4
MySQL: 5.0.45

Pine Tree Candles