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

Reward Points Module for ZC v13x

Locked

Views: 472,148

Results 41 to 60 of 2,476
This thread is locked. New replies are disabled.
19 Apr 2008, 6:29 PM
#41
berserker avatar

berserker

Totally Zenned

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

Reward Points Module for ZC v13x

pinetreecandles:

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. :(

Same here. By the way, how do you send someone points?

19 Apr 2008, 9:32 PM
#42
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

Hmmm.

Trying to install on my local site and I get this error when trying to access admin

1146 Table 'nortsandones.reward_status_track' doesn't exist
in:
[SELECT ph.
, o.orders_status FROM reward_status_track ph, orders o WHERE ph.orders_id=o.orders_id AND ph.date 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 renamed the custom folder to the same as mine, and then uploaded both the admin and includes. But as soon as I try and do anyting in Admin, it throws up the above error. ?

What steps did I miss ?

Norts And Ones
Norts And Ones

19 Apr 2008, 9:44 PM
#43
rasyr avatar

rasyr

Zen Follower

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

Re: Reward Points Module for ZC v13x

Berserker:

Same here. By the way, how do you send someone points?

If you, as admin, want to give a person some points (beyond what they earn), the go to Admin|Customers|Reward Points, and then find and edit the customer.

My boss gave everybody on our store 1000 points to begin with (and then I had another 83 that I need to give even more to) -- i.e. every got 1000 points, those who had purchased more than $500 since 2002 (I have the records from the old online store, pre-zen) got additional points - equal to 2x the dollar amount that they spent.

So for the "everybody gets 1000 points, I did a sql statement and ran it and then have been working on editing the others since then.

19 Apr 2008, 9:45 PM
#44
rasyr avatar

rasyr

Zen Follower

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

Re: Reward Points Module for ZC v13x

Mike_Dean:

Hmmm.

Trying to install on my local site and I get this error when trying to access admin

1146 Table 'nortsandones.reward_status_track' doesn't exist
in:
[SELECT ph.
, o.orders_status FROM reward_status_track ph, orders o WHERE ph.orders_id=o.orders_id AND ph.date 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 renamed the custom folder to the same as mine, and then uploaded both the admin and includes. But as soon as I try and do anyting in Admin, it throws up the above error. ?

What steps did I miss ?

Mike, read back through this thread

Basically, that is an issue with the sql file and IF you have a DB prefix in use.

19 Apr 2008, 10:10 PM
#45
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

Rasyr:

Mike, read back through this thread

Basically, that is an issue with the sql file and IF you have a DB prefix in use.

Thanks,

I'm not using a prefix, my db is nortandones not xxx_nortsandones.

What am I supposed to be renaming the following file to ?

*Rename reward_points_functions.php to reward_points_functions.xxx *

Norts And Ones
Norts And Ones

19 Apr 2008, 10:22 PM
#46
hem avatar

hem

Totally Zenned

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

Re: Reward Points Module for ZC v13x

Rasyr:

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

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

Nice work Rasyr- I'll refactor the code to use subtotal. There's another instance in class.reward_points.php which looks like it's causing the other issue you flagged.

Regarding the email thing- It should not matter if you have email turned off- the notifier should still be called. I'll look at using another notifier.

Don't worry- we'll get the issues worked out- thanks again.

Andrew

Andrew Moore
Omnicia Agile Development
www.omnicia.com

19 Apr 2008, 10:26 PM
#47
rasyr avatar

rasyr

Zen Follower

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

Re: Reward Points Module for ZC v13x

Mike_Dean:

Thanks,

I'm not using a prefix, my db is nortandones not xxx_nortsandones.

What am I supposed to be renaming the following file to ?

*Rename reward_points_functions.php to reward_points_functions.xxx *

The prefix isn't on the DB name, it is on the DB table names. (i.e. the configuration table might be names zen_configuration).

You can look inside your includes/configure.php file to see if the store thinks you are using a DB Prefix -- for a line that says something like:

define('DB_PREFIX', 'zen_');

It it isn't that you need to rename the sql file, it is that you **may **need to make changes to it and rerun it (if your DB is using a prefix).

Here is the post that I was referring to finding -- http://www.zen-cart.com/forum/showpost.php?p=543257&postcount=19

I don't think that you need to be renaming that file you are listing at all.

19 Apr 2008, 10:34 PM
#48
rasyr avatar

rasyr

Zen Follower

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

Re: Reward Points Module for ZC v13x

hem:

Nice work Rasyr- I'll refactor the code to use subtotal. There's another instance in class.reward_points.php which looks like it's causing the other issue you flagged.

Regarding the email thing- It should not matter if you have email turned off- the notifier should still be called. I'll look at using another notifier.

Don't worry- we'll get the issues worked out- thanks again.

Cool beans!!!

19 Apr 2008, 10:37 PM
#49
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

Rasyr:

The prefix isn't on the DB name, it is on the DB table names. (i.e. the configuration table might be names zen_configuration).

You can look inside your includes/configure.php file to see if the store thinks you are using a DB Prefix -- for a line that says something like:

It it isn't that you need to rename the sql file, it is that you **may **need to make changes to it and rerun it (if your DB is using a prefix).

Here is the post that I was referring to finding -- http://www.zen-cart.com/forum/showpost.php?p=543257&postcount=19

I don't think that you need to be renaming that file you are listing at all.

Thanks Rasyr, appreciate your help on this,

Ok..

I checked the file as you suggested and it's as follows.

define('DB_PREFIX', '');

So we can assume that there is no prefix..

The problem is, that I can't even run the sql file to begin with.

I uploaded the files, and then when I try and enter the Admin CP, thats when I get the error, so I can't even run the sql to begin with, so modifying the sql is not going to help ?

Sorry....

Norts And Ones
Norts And Ones

19 Apr 2008, 10:45 PM
#50
hem avatar

hem

Totally Zenned

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

Re: Reward Points Module for ZC v13x

Mike_Dean:

Thanks,

I'm not using a prefix, my db is nortandones not xxx_nortsandones.

What am I supposed to be renaming the following file to ?

*Rename reward_points_functions.php to reward_points_functions.xxx *

Exactly as it shows- change the extension to 'xxx'- that will stop it causing the error until you can do the SQL table rename.

Andrew

Andrew Moore
Omnicia Agile Development
www.omnicia.com

19 Apr 2008, 10:48 PM
#51
rasyr avatar

rasyr

Zen Follower

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

Re: Reward Points Module for ZC v13x

And.... Paypal - Customer did not get the points that he should have had added into the Pending list (let alone the Earned).

So, the problem with Paypal customers not being awarded their points is happening with me as well.

We use Paypal IPN.

19 Apr 2008, 10:51 PM
#52
rasyr avatar

rasyr

Zen Follower

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

Re: Reward Points Module for ZC v13x

Mike_Dean:

Thanks Rasyr, appreciate your help on this,

Ok..

I checked the file as you suggested and it's as follows.

define('DB_PREFIX', '');

So we can assume that there is no prefix..

The problem is, that I can't even run the sql file to begin with.

I uploaded the files, and then when I try and enter the Admin CP, thats when I get the error, so I can't even run the sql to begin with, so modifying the sql is not going to help ?

Sorry....

Ahh.. do what Hem says right after your last post (I had missed somebody being told that earlier apparently).

Which sql file did you run the first time? And did you have the module installed before this (from your comments, it sounds like no).

19 Apr 2008, 11:05 PM
#53
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

Rasyr:

Ahh.. do what Hem says right after your last post (I had missed somebody being told that earlier apparently).

Which sql file did you run the first time?

NONE !!!!....... I cant even run an sql file to begin with.... as I cant get into my Admin CP
(as posted three times...)

This is my first attempt at using this particular mod, as I was waiting for it to come out of Beta... So I haven't tried running it before, or uploaded any sql files associated with this mod before

(Excuse my apparent frustration...)

I tried that thanks Andrew, and it still throws up the same error.

1146 Table 'nortsandones.reward_status_track' doesn't exist
in:
[SELECT ph.*, o.orders_status FROM reward_status_track ph, orders o WHERE ph.orders_id=o.orders_id AND ph.dateIf 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.

Even tried renaming it completely to just bob.php and no luck..

What else could possibly be wrong.

Steps taken..

Renamed the custom file in your includes files to similate that of my custom template correct ?

Uploaded the admin and include folders. correct ?

I've uploaded plenty of mods and to be honest, this is the first that has not worked.. Thank god I'm doing it on my local site.

I really want to get this working as it (looks) like a great Mod.

Norts And Ones
Norts And Ones

19 Apr 2008, 11:10 PM
#54
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

Ok.. got it..!!

I just completely removed the rewards_points_functions.php file

Then I was able to get into Admin CP and I've put that file back. so Now I'll take the next step and see how I go..

Perserverence sure does pay off..

Norts And Ones
Norts And Ones

19 Apr 2008, 11:26 PM
#55
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

ok..
Next issues...

Now getting the following error when I try to enter the Rewards Points section under Customers in Admin

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 'SELECT SUM(rp.reward_points) FROM reward_status_track rp WHERE cp.customers_id=r' at line 1
in:
[UPDATE reward_customer_points cp, reward_status_track rp SET cp.reward_points=cp.reward_points+IFNULL(SELECT SUM(rp.reward_points) FROM reward_status_track rp WHERE cp.customers_id=rp.customers_id AND rp.status=0 AND rp.dateIf 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.

Norts And Ones
Norts And Ones

19 Apr 2008, 11:55 PM
#56
imperialis avatar

imperialis

Zen Follower

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

Re: Reward Points Module for ZC v13x

pinetreecandles:

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.

Where do I find my prefix?
20 Apr 2008, 12:04 AM
#57
hem avatar

hem

Totally Zenned

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

Re: Reward Points Module for ZC v13x

Mike_Dean:

Ok.. got it..!!

I just completely removed the rewards_points_functions.php file

Then I was able to get into Admin CP and I've put that file back. so Now I'll take the next step and see how I go..

Perserverence sure does pay off..

The trick is to change the extension- anything but php should do

Andrew

Andrew Moore
Omnicia Agile Development
www.omnicia.com

20 Apr 2008, 12:05 AM
#58
hem avatar

hem

Totally Zenned

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

Re: Reward Points Module for ZC v13x

imperialis:

Where do I find my prefix?

If this is the first time you've installed the mod, just run the new.sql under Admin->Tools->Install SQL Patch

Andrew

Andrew Moore
Omnicia Agile Development
www.omnicia.com

20 Apr 2008, 12:10 AM
#59
hem avatar

hem

Totally Zenned

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

Re: Reward Points Module for ZC v13x

Mike_Dean:

ok..
Next issues...

Now getting the following error when I try to enter the Rewards Points section under Customers in Admin

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 'SELECT SUM(rp.reward_points) FROM reward_status_track rp WHERE cp.customers_id=r' at line 1
in:
[UPDATE reward_customer_points cp, reward_status_track rp SET cp.reward_points=cp.reward_points+IFNULL(SELECT SUM(rp.reward_points) FROM reward_status_track rp WHERE cp.customers_id=rp.customers_id AND rp.status=0 AND rp.dateIf 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.

Mike- reload admin/includes/functions/extra_functions/reward_points_functions.php- It looks like something (possibly Notepad) has stuck in an unwanted line break.

Andrew

Andrew Moore
Omnicia Agile Development
www.omnicia.com

20 Apr 2008, 12:29 AM
#60
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

hem:

Mike- reload admin/includes/functions/extra_functions/reward_points_functions.php- It looks like something (possibly Notepad) has stuck in an unwanted line break.

Thanks Andrew.

Took a while but I got there..
:smile:

Norts And Ones
Norts And Ones