Page 1 of 2 12 LastLast
Results 1 to 10 of 2475

Hybrid View

  1. #1
    Join Date
    Jan 2012
    Posts
    89
    Plugin Contributions
    0

    Default Re: Reward Points Module- Live Release now available.

    Quote Originally Posted by SeanLoberg View Post
    v1.5 version: http://www.zen-cart.com/downloads.php?do=file&id=704

    Feature Question: the rewards program allows the automatic expiration of PENDING points by setting a future expiration in days:

    admin > config > rewards points config > Delete Old Reward Transactions Period = 30 days (for example below)

    For example, a customer buys product, receives 1000 points that are PENDING until the order has shipped, triggering the 1000 points to move from PENDING to EARNED. If the order does not ship in 30 days, the PENDING points expire. No problem, tested and works fine.

    What I want to do is expire EARNED points in 30 days. For example, a customer buys product, receives 1000 points that are PENDING. The the order is shipped, triggering the 1000 points to move from PENDING to EARNED. If the customer does not use/redeem the EARNED 1000 points in 30 days, the EARNED points automatically expire. A "Use 'em or Loose'em" scenario.

    Does this feature exist in the Mod? If not, any pointers on how to create this function ... Help greatly appreciated!
    I don't think you will get an answer to your question because I asked the same question perhaps a month or two ago, I think the module is not setup for that so I got one of my family members write me a code which I run daily, it's not the perfect way but itworks, you could set it up as a cron job if you like to run it daily, here is the code below:

    <?php

    try {
    $dbh = new PDO("mysql:host=localhost;dbname=DATABASE_NAME", 'DATABASE_NAME_Points', '1qwer13');

    $Totalquery = "Update reward_customer_points
    SET reward_points = 0.00
    Where customers_id not in (select customers_id from reward_status_track)";


    $Totalstmt = $dbh->prepare($Totalquery);
    $Totalstmt ->execute();

    echo 'Total Task Completed';

    }
    catch(PDOException $e)
    {
    echo $e->getMessage();
    }

    ?>

    Basically when you set up your reward points module pending points to expire in 30 days, the reward_status_track table keeps only 30 days of records so what the code does if it's not in the track table then it sets the points to Zero.

    You have to run this daily though, if not then the deleted records will be lost and won't be able to zero the reward points that are older than 30 days.

    I am sure some people here could make it much better and full proof and run it as a cron job.

    I am not an expert in code writing but was able to figure things out to solve my problem.

    Hope this helps,

  2. #2
    Join Date
    Aug 2012
    Posts
    23
    Plugin Contributions
    0

    Default Re: Reward Points Module- Live Release now available.

    Hi all!

    First off.... great contribution!

    Could some one help me get the value of the points to show on the products info page?

    i.e. 100 points worth £1.00

    Thanks in advance :o)
    We Fix Information Technology - we're making I.T. simple!
    www.wefixitonline.co.uk

  3. #3
    Join Date
    Jun 2012
    Posts
    23
    Plugin Contributions
    0

    Default Re: Reward Points Module- Live Release now available.

    Hi,

    Thanks for this great module, just wondering if it is possible for me to rename 'Reward points' to something else that i want it to be? I don't seems to find any solution to this in the thread.

    Thanks in advance! (:

  4. #4
    Join Date
    Jun 2012
    Posts
    23
    Plugin Contributions
    0

    Default Re: Reward Points Module- Live Release now available.

    Quote Originally Posted by lovets View Post
    Hi,

    Thanks for this great module, just wondering if it is possible for me to rename 'Reward points' to something else that i want it to be? I don't seems to find any solution to this in the thread.

    Thanks in advance! (:
    Have figured out. Thanks (:

  5. #5
    Join Date
    Jan 2012
    Location
    New England
    Posts
    238
    Plugin Contributions
    0

    Default Re: Reward Points Module- Live Release now available.

    So tell us how you did it!

  6. #6
    Join Date
    Nov 2012
    Posts
    3
    Plugin Contributions
    0

    Default Re: Reward Points Module- Live Release now available.

    Firstly, sorry if this has been covered in this thread already, I did search but couldn't find what I was looking for.

    What I'm trying to achieve is this:

    1. Have a category of products that you can purchase and receive reward points for (as normal) but can't be purchased with reward points.
    2. Have a second category of products that you can only buy with reward points.

    So far I haven't been able to find an obvious way to stop certain products from being purchased with reward points (that would be a start).

    Any advice on how I might achieve this, pointers on where I should be hooking into the API etc?

    Cheers.

  7. #7
    Join Date
    Oct 2012
    Posts
    13
    Plugin Contributions
    0

    Default Re: Reward Points Module- Live Release now available.

    Quote Originally Posted by SKWebDev View Post
    Firstly, sorry if this has been covered in this thread already, I did search but couldn't find what I was looking for.

    What I'm trying to achieve is this:

    1. Have a category of products that you can purchase and receive reward points for (as normal) but can't be purchased with reward points.
    2. Have a second category of products that you can only buy with reward points.

    So far I haven't been able to find an obvious way to stop certain products from being purchased with reward points (that would be a start).

    Any advice on how I might achieve this, pointers on where I should be hooking into the API etc?

    Cheers.
    I would also like to know this..

    Like I want customers to get points from everything they buy, but customers can only use their points on a certain category of product. A category that is specifically for using points. Maybe for in-stock items I am trying to get rid of to make room for new stock.

    -------
    Alternatively, I am going to assume it cannot handle something like
    http://www.thinkgeek.com/geekpoints/

  8. #8
    Join Date
    Jun 2006
    Posts
    298
    Plugin Contributions
    0

    Default Re: Reward Points Module- Live Release now available.

    Quote Originally Posted by Coins2012 View Post
    I don't think you will get an answer to your question because I asked the same question perhaps a month or two ago, I think the module is not setup for that so I got one of my family members write me a code which I run daily, it's not the perfect way but itworks, you could set it up as a cron job if you like to run it daily, here is the code below:

    <?php

    try {
    $dbh = new PDO("mysql:host=localhost;dbname=DATABASE_NAME", 'DATABASE_NAME_Points', '1qwer13');

    $Totalquery = "Update reward_customer_points
    SET reward_points = 0.00
    Where customers_id not in (select customers_id from reward_status_track)";


    $Totalstmt = $dbh->prepare($Totalquery);
    $Totalstmt ->execute();

    echo 'Total Task Completed';

    }
    catch(PDOException $e)
    {
    echo $e->getMessage();
    }

    ?>

    Basically when you set up your reward points module pending points to expire in 30 days, the reward_status_track table keeps only 30 days of records so what the code does if it's not in the track table then it sets the points to Zero.

    You have to run this daily though, if not then the deleted records will be lost and won't be able to zero the reward points that are older than 30 days.

    I am sure some people here could make it much better and full proof and run it as a cron job.

    I am not an expert in code writing but was able to figure things out to solve my problem.

    Hope this helps,
    I need points to expire 90 days after they are earned.

    This code is a good start, but I can see a problem...

    Say we want rewards to expire at 90 days.
    Day 1: Customer places order. Earns 100 points.
    Day 30: Customer places another order. Earns 100 points.
    Day 90: Only 100 points should be removed, not all of their points, which is what this code would do.

    Has anyone determined how to properly remove earned points after a certain time period?

  9. #9
    Join Date
    Jun 2006
    Posts
    298
    Plugin Contributions
    0

    Default Re: Reward Points Module- Live Release now available.

    Quote Originally Posted by abcisme View Post
    I need points to expire 90 days after they are earned.

    This code is a good start, but I can see a problem...

    Say we want rewards to expire at 90 days.
    Day 1: Customer places order. Earns 100 points.
    Day 30: Customer places another order. Earns 100 points.
    Day 90: Only 100 points should be removed, not all of their points, which is what this code would do.

    Has anyone determined how to properly remove earned points after a certain time period?
    Ok, I am not a programmer, so I am taking a stab in the dark at this.. but looking at the housekeeping function, if I create a subset for housekeeping which specifies earned points instead of pending points.. then switched the housekeeping function to reflect rewards_points instead of pending_points, it should work to remove any earned points instead of pending points. Right?

    So pending points will switch to earned after the sunrise period, then be removed after the housekeeping period... Does this look correct?

    Code:
    function CleanupRewardPointHistory()
    {
        global $db,$messageStack;
        
        $subset="IFNULL((SELECT SUM(rp.reward_points) FROM ".TABLE_REWARD_STATUS_TRACK." rp WHERE cp.customers_id=rp.customers_id AND rp.status='".STATUS_PENDING."' AND rp.date<NOW()-INTERVAL %s DAY),0)";
    $subset2="IFNULL((SELECT SUM(rp.reward_points) FROM ".TABLE_REWARD_STATUS_TRACK." rp WHERE cp.customers_id=rp.customers_id AND rp.status='".STATUS_PROCESSED."' AND rp.date<NOW()-INTERVAL %s DAY),0)";
        $sunrise_subset=sprintf($subset,REWARD_POINTS_SUNRISE_PERIOD);
        $housekeeping_subset=sprintf($subset2,REWARD_POINTS_HOUSEKEEPING);
        
        if(REWARD_POINTS_SUNRISE_PERIOD>0)
         if($db->Execute("UPDATE ".TABLE_REWARD_CUSTOMER_POINTS." cp, ".TABLE_REWARD_STATUS_TRACK." rp SET cp.reward_points=cp.reward_points+".$sunrise_subset.",cp.pending_points=cp.pending_points-".$sunrise_subset." WHERE cp.customers_id=rp.customers_id;"))
          $db->Execute("UPDATE ".TABLE_REWARD_STATUS_TRACK." SET status=".STATUS_PROCESSED." WHERE status=".STATUS_PENDING." AND date<NOW()-INTERVAL ".REWARD_POINTS_SUNRISE_PERIOD." DAY;");
         
        if(REWARD_POINTS_HOUSEKEEPING>0)
         if($db->Execute("UPDATE ".TABLE_REWARD_CUSTOMER_POINTS." cp, ".TABLE_REWARD_STATUS_TRACK." rp SET cp.reward_points=cp.reward_points-".$housekeeping_subset." WHERE cp.customers_id=rp.customers_id;"))
    
          $db->Execute("DELETE FROM ".TABLE_REWARD_STATUS_TRACK." WHERE date<NOW()-INTERVAL ".(int)REWARD_POINTS_HOUSEKEEPING." DAY;");
    }

  10. #10
    Join Date
    Jan 2014
    Posts
    32
    Plugin Contributions
    0

    Default Re: Reward Points Module- Live Release now available.

    Hi,

    in my site, when i change attributes the points dont change, please take a look: 66.147.242.164/~kiteaddi

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v139h Reward Points module display order totals including reward points
    By irsarahbean in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 23 Jun 2013, 01:19 AM
  2. Reward points module : 0 points earned
    By jonnyboy22 in forum Addon Payment Modules
    Replies: 5
    Last Post: 5 Jun 2012, 09:52 AM
  3. Reward Points module- points not calculated correctly
    By cpoet in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 9 Sep 2010, 05:02 PM
  4. Reward Points Module - Hide message when 0 points offered
    By expresso in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 11 Dec 2008, 06:58 PM
  5. Experimental Reward Points Module
    By precursor999 in forum Addon Payment Modules
    Replies: 7
    Last Post: 2 Apr 2007, 09:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg