Results 1 to 10 of 2475

Hybrid View

  1. #1
    Join Date
    Aug 2008
    Posts
    38
    Plugin Contributions
    0

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

    I have tried searching this rather large thread for answers, but none of my key words get a result. So here goes.

    I just installed this module on my cart. My business has been in operation for 2 years now, and I have a lot of loyal customers. I would like to give my existing customers reward points to match the orders that they have made. Is there a simple way to do this?

    Thanks

    Sharni

  2. #2
    Join Date
    Feb 2007
    Location
    Pennsylvania
    Posts
    834
    Plugin Contributions
    0

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

    Quote Originally Posted by Sharni View Post
    I have tried searching this rather large thread for answers, but none of my key words get a result. So here goes.

    I just installed this module on my cart. My business has been in operation for 2 years now, and I have a lot of loyal customers. I would like to give my existing customers reward points to match the orders that they have made. Is there a simple way to do this?

    Thanks

    Sharni



    I couldn't find an answer, so I wrote one. Here is the code. You should copy this code and create a .php file with it. Place that file on your web server and replace the top line for connections with your own DB connection info. Execute the script by accessing it through your browser.

    I have our sunrises period in the admin set to 31 so I wrote this to check whether the order is older than 30 days. You may adjust this to meet your needs.

    This comes with NO warranty or guarantee. It did exactly what I needed it to though. The rewards points module creates 3 tables, one of which is only used to track the reward ratio of different categories, products, groups etc. . .

    The additional two tables are what's important here. These tables are properly addressed in my lil' script.

    Enjoy! John

    BACKUP YOUR DB!!!

    PHP Code:

    <?php
    // hour minute second month day year

    require 'connections.php';
    $sunrises = (30 24 60 60); //days x hours x minutes x seconds
    $now time();
    $issue_rewards = array();
    $query mysql_query("SELECT * FROM orders_total WHERE class ='ot_subtotal'");

    $cID '';
    $date '';

    while(
    $row mysql_fetch_assoc($query)){
        
        
    $updates = array();
        
    $query2 mysql_query("SELECT * FROM orders_status_history WHERE orders_id ='$row[orders_id]'");
        while(
    $row2 mysql_fetch_assoc($query2)){
            
            
    $updates[] = $row2['orders_status_id'];
        }
        
        if(
    in_array('3'$updates) && !in_array('5'$updates) && !in_array('6'$updates) && !in_array('111'$updates) && !in_array('107'$updates) && !in_array('109'$updates)){
        
    $round_val round($row['value'], PHP_ROUND_HALF_DOWN);
        
    //2008-01-18 18:16:51
    $o_get_date_time mysql_query("SELECT * FROM orders WHERE orders_id ='$row[orders_id]'");
        while(
    $this_date_time mysql_fetch_assoc($o_get_date_time)){
        
    $dt_parts explode(' '$this_date_time['date_purchased']);
        
    $dt_date $dt_parts[0];
        
    $dt_time $dt_parts[1];
        
    $cID $this_date_time['customers_id'];
        
    $date $this_date_time['date_purchased'];
        }
        
        
    $d_parts explode('-'$dt_date);
        
    $mo $d_parts[1]; $da $d_parts[2]; $yr $d_parts[0];
        
    $t_parts explode(':'$dt_time);
        
    $hr $t_parts[0]; $mn $t_parts[1]; $se $t_parts[2]; 
        
    $odate_secs mktime($hr$mn$se$mo$da$yr);
        
    //$recompile = $yr.'-'.$mo.'-'.$da.' '. $hr.':'.$mn.':'.$se;//testing here
        

        
    $date_math $now $odate_secs;
        if(
    $date_math $sunrises){
        
    //insert these points as pending
            
    echo $count ": OK! Order ID: " $row['orders_id'] . '  Will Get: ' $round_val ' ' $recompile ' PENDING<br />';
            
            
    mysql_query("INSERT INTO reward_status_track (rewards_id,customers_id,orders_id,date,reward_points,status) VALUES ('',$cID,$row[orders_id],'$date',$round_val,'0')") or die(mysql_error());
            
    $exisitng_check mysql_query("SELECT * FROM reward_customer_points WHERE customers_id ='$cID'") or die(mysql_error());
            
    $exis_chk_nums mysql_num_rows($exisitng_check);
            if(
    $exis_chk_nums 1){
            
    mysql_query("INSERT INTO reward_customer_points (customers_id,reward_points,pending_points) VALUES ($cID,'0',$round_val)") or die(mysql_error());
            }else{
                while(
    $existing_record mysql_fetch_assoc($exisitng_check)){
                
    //$existing_rp = $existing_record['reward_points'];
                
    $existing_pp $existing_record['pending_points'];
                }
                
    //$new_rp = $existing_rp + $round_val;
                
    $new_pp $existing_pp $round_val;
                
    mysql_query("UPDATE reward_customer_points SET pending_points=$new_pp WHERE customers_id=$cID") or die(mysql_error());
            }
        }else{
        
    //insert these points as earned
            
    echo $count ": OK! Order ID: " $row['orders_id'] . '  Will Get: ' $round_val ' ' $recompile ' EARNED!<br />';
            
                    
            
    mysql_query("INSERT INTO reward_status_track (rewards_id,customers_id,orders_id,date,reward_points,status) VALUES ('',$cID,$row[orders_id],'$date',$round_val,'1')") or die(mysql_error());
            
    $exisitng_check mysql_query("SELECT * FROM reward_customer_points WHERE customers_id ='$cID'") or die(mysql_error());
            
    $exis_chk_nums mysql_num_rows($exisitng_check);
            if(
    $exis_chk_nums 1){
            
    mysql_query("INSERT INTO reward_customer_points (customers_id,reward_points,pending_points) VALUES ($cID,$round_val,'0')") or die(mysql_error());
        }else{
                while(
    $existing_record mysql_fetch_assoc($exisitng_check)){
                
    $existing_rp $existing_record['reward_points'];
                
    //$existing_pp = $existing_record['pending_points'];
                
    }
                
    $new_rp $existing_rp $round_val;
                
    //$new_pp = $existing_pp + $round_val;
                
    mysql_query("UPDATE reward_customer_points SET reward_points=$new_rp WHERE customers_id=$cID") or die(mysql_error());
            }
        
        
        }

    }


    }    
    ?>

  3. #3
    Join Date
    Jan 2009
    Posts
    45
    Plugin Contributions
    0

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

    I find folow code but I dont what is in connections.php (replace the top line for connections with your own DB connection info).

    Please help
    Quote Originally Posted by bumba000 View Post
    PHP Code:
    <?php
    // hour minute second month day year

    require 'connections.php';
    $sunrises = (30 24 60 60); //days x hours x minutes x seconds
    $now time();
    $issue_rewards = array();
    $query mysql_query("SELECT * FROM orders_total WHERE class ='ot_subtotal'");
    etc...

  4. #4
    Join Date
    Jan 2009
    Posts
    45
    Plugin Contributions
    0

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

    Hello, I need help :)

    example
    now is set - 5000 points = 5%
    10000 points = 10%
    etc...

    = customer had 10500 points and he used them = he get 10% and He left 500 points. ....

    but I need if customer have 10000 points he will be added to the group with 10% discount and over and over and last added points will have the expiration of 365 days

    is it set or is it possible to extend it?

  5. #5
    Join Date
    Jul 2011
    Posts
    7
    Plugin Contributions
    0

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

    Hi,

    I have installed the reward module and everything worked fine. I made a test order and received pending points. After changing the status to dispatched the points were moved to earned points. I then made a 2nd order and successfully redeemed the points but noticed I didn't get any points for the 2nd order.
    I have tried to make a lot of test orders as a different customer, when I put an item to the shopping basket I can see a number of points for products in basket. However, when I place an order I receive no points at all.
    I have tried all different settings (point status single/advance etc.) but cannot get it work. I get no error message at all. Please help as I have no idea what to do now.
    I can't see to find Reward Point Mod Diagnostic Tool anywhere. The link http://www.omnicia.com/rpd.zip doesn't work though.

    Thanks a lot

  6. #6
    Join Date
    Jan 2009
    Posts
    45
    Plugin Contributions
    0

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

    I've got it, please help me how can I limiting the deduction of bonus points after use?

  7. #7
    Join Date
    Jul 2011
    Posts
    7
    Plugin Contributions
    0

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

    Quote Originally Posted by Lopi View Post
    I've got it, please help me how can I limiting the deduction of bonus points after use?
    You can add or subtract points in Customer / Rewards Points

  8. #8
    Join Date
    Jul 2011
    Posts
    7
    Plugin Contributions
    0

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

    Quote Originally Posted by lovelyland View Post
    Hi,

    I have installed the reward module and everything worked fine. I made a test order and received pending points. After changing the status to dispatched the points were moved to earned points. I then made a 2nd order and successfully redeemed the points but noticed I didn't get any points for the 2nd order.
    I have tried to make a lot of test orders as a different customer, when I put an item to the shopping basket I can see a number of points for products in basket. However, when I place an order I receive no points at all.
    I have tried all different settings (point status single/advance etc.) but cannot get it work. I get no error message at all. Please help as I have no idea what to do now.
    I can't see to find Reward Point Mod Diagnostic Tool anywhere. The link http://www.omnicia.com/rpd.zip doesn't work though.

    Thanks a lot
    Sorted.
    I had the reward points display module (in order total) turned off. When I turned it on it worked fine.
    However, for some reason I can't have the two modules (reward points and reward points discount) in use together.
    When I turn one module on the other one is automatically disabled. Any idea why?

 

 

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