Jump to content



Latest News: (loading..)

* * * * * 12 votes

### POINTS AND REWARDS MODULE V1.00 ###


  • Please log in to reply
2124 replies to this topic

#21   ondriab

ondriab
  • Members
  • 5 posts
  • Real Name:Andrea

Posted 03 June 2005 - 03:29 AM

ninini01, on Jun 1 2005, 06:45 AM, said:

Error when I open my_points.php
Warning: Missing argument 1 for tep_get_shopping_points() in /usr/local/apache/htdocs/evabijoux/includes/functions/redemptions.php on line 17

Fatal error: Call to undefined function: tep_count_pending_rows() in /usr/local/apache/htdocs/evabijoux/my_points.php on line 72

<{POST_SNAPBACK}>


I am having the same problem also. Anyone figure it out yet?

Thanks,
Andrea

#22   deep-silver

deep-silver
  • Members
  • 353 posts
  • Real Name:DEEP SILVER ACCESSORY Ben Zukrel
  • Location:Yamagata City / Japan

Posted 03 June 2005 - 03:46 AM

To all of you trying to install this.
I just want to tell you that i worked hard for this and the sceenshots provided
are not something that i drow, those are reall sceenshoots on a fresh install.
so i wanted to share this with oscommerce Community.
I will try to do my best to try to help people with this module but, please don't just post an error . Please make sure you give as much information as possible. like php,sql,server fresh install or not.
Its seem like it works for some shops and give a hard time to some others the best way is to test it on a fresh install and not to modify yours, see how it goes and if it works for you then you should give it a try.(if you want).
To all out there that worry about the YEN shown on this module its just a word you can change it with whatever you want its really DONT matter the real count is in the value box so if your value box say 0.1 and your currency set to $, the Exchange Rates will show :     Awards : $1.00 = 1  point(s)    Redeem : 1  point(s) = $0.10 in the admin page so if you still care that it say YEN and not DOLLAR then go ahead in change this word in redemptions.sql(line 36 and 37)before  execute the statements.
(some modified shop maybe need to work this out so it will function well)
there are maybe some bugs or whatever makes it go wrong i eally don't know since i tested it on my pc and friends shop. i made this for a friend of mine. she needed it for her live shop located in japan.(i've been asked not to give the site name).
When i live shop will be ready i will post the links to it here.
till then don't rush( you waited so long for such a module so wait just a little more)
This mod as just uploaded and considers as beta, like any other modules out there people fix bugs or try to improve or just ajust it to thier need.)
Just keep it on a small fire come back once in a while and check the forum for
some usefull infromation and then maybe when you see enough seccessfull install posted here that the right time to install it.
Remember - - - "STRESSED" spelled backwards "DESSERTS"

#23   Z06BAIT

Z06BAIT
  • Members
  • 472 posts
  • Real Name:Z06BAIT
  • Gender:Male

Posted 03 June 2005 - 04:27 AM

deep-silver, on Jun 2 2005, 10:46 PM, said:

To all of you trying to install this.
I just want to tell you that i worked hard for this and the sceenshots provided
are not something that i drow, those are reall sceenshoots on a fresh install.
so i wanted to share this with oscommerce Community.
I will try to do my best to try to help people with this module but, please don't just post an error . Please make sure you give as much information as possible. like php,sql,server fresh install or not.
Its seem like it works for some shops and give a hard time to some others the best way is to test it on a fresh install and not to modify yours, see how it goes and if it works for you then you should give it a try.(if you want).
To all out there that worry about the YEN shown on this module its just a word you can change it with whatever you want its really DONT matter the real count is in the value box so if your value box say 0.1 and your currency set to $, the Exchange Rates will show :     Awards : $1.00 = 1  point(s)    Redeem : 1  point(s) = $0.10 in the admin page so if you still care that it say YEN and not DOLLAR then go ahead in change this word in redemptions.sql(line 36 and 37)before  execute the statements.
(some modified shop maybe need to work this out so it will function well)
there are maybe some bugs or whatever makes it go wrong i eally don't know since i tested it on my pc and friends shop. i made this for a friend of mine. she needed it for her live shop located in japan.(i've been asked not to give the site name).
When i live shop will be ready i will post the links to it here.
till then don't rush( you waited so long for such a module so wait just a little more)
This mod as just uploaded and considers as beta, like any other modules out there people fix bugs or try to improve or just ajust it to thier need.)
Just keep it on a small fire come back once in a while and check the forum for
some usefull infromation and then maybe when you see enough seccessfull install posted here that the right time to install it.

<{POST_SNAPBACK}>


To make sure everyone knows this is a beta project and that there are errors ... please upload the contribution again and in the subject screen ... please enter the URL for support (this topic) and warn users to read the support link before installing this.  Please rename your contribution to *Points & Rewards Module BETA*

Thanks.
Remember what the Bible says: He who is without sin, cast the first rock. And I shall smoketh it.

#24   deep-silver

deep-silver
  • Members
  • 353 posts
  • Real Name:DEEP SILVER ACCESSORY Ben Zukrel
  • Location:Yamagata City / Japan

Posted 03 June 2005 - 06:31 AM

To make sure everyone knows this is a beta project and that maybe there are errors, bugs or god knows what.
The zip uploaded in oscommerce contributions site  only contain this *Points & Rewards Module BETA* with ONLY files needed.
I've setup a test shop in order for you to test this module, please pay respact and try not to spend long time logedin so others can test it as well.
Products shown are for demonstrational purposes, any products purchased will not be delivered nor will the customer be billed and no mail will sent in or out via this site.. Any information seen on these products is to be treated as fictional.
To test the customer side please use...

http://www.deep-silver.com/shop/

E-Mail Address: test@test.com
Password: users
to test the admin use this link
http://www.deep-silver.com/shop/admin/

if you like it you will be able to downloaded from the test site
and here.....
http://www.deep-silver.com/oscommerce/poin...eward_v1.00.zip

Please note that the test shop is there for short time only.(untill end of Jun.2005)
sorry evryone.
Remember - - - "STRESSED" spelled backwards "DESSERTS"

#25   Z06BAIT

Z06BAIT
  • Members
  • 472 posts
  • Real Name:Z06BAIT
  • Gender:Male

Posted 03 June 2005 - 08:31 AM

Ok it looks like this works fine on a stock osC store.  To find out where the problem lies with a modified store, please everyone, JUST POST WHAT CONTRIBUTIONS YOU HAVE ON YOUR STORE.

Well start nipping away at this as this is a really nice contribution!
Remember what the Bible says: He who is without sin, cast the first rock. And I shall smoketh it.

#26   deep-silver

deep-silver
  • Members
  • 353 posts
  • Real Name:DEEP SILVER ACCESSORY Ben Zukrel
  • Location:Yamagata City / Japan

Posted 03 June 2005 - 10:15 AM

Thank you for your time and afford.
Now when the test shop is on and runing well (I hope.) i can try to help and do my best the most importent is that anybody who download this make sure to get the full version from my site and to check to make sure no errors accure while downloading the zip. some people get broken files from some resons.
I'm sorry but I had to limit the admin section and I'm sure that you understand.
I don't know how much longer i can keep this test site on since it bring lots of traffic to my site. so the sever load is slow. also people making change to admin section while others trying the customer side test and thats make a lot of mass
with the points result and i think that you know what i mean.
Thank you again.
DEEP SILVER
Remember - - - "STRESSED" spelled backwards "DESSERTS"

#27   fatmcgav

fatmcgav
  • Members
  • 173 posts
  • Real Name:G Williams

Posted 03 June 2005 - 12:45 PM

Right - i've found the cause of the problems:

A) Missing Functions Problem:
The included file in catalog/includes/functions/redemptions.php is missing the necessary functions - if u replace it with the one from the full install dload from http://www.deep-silver.com/oscommerce/poin...eward_v1.00.zip then it will fix the missing functions problem.

B) Parse error problem with checkout_confirmation.php:
This is caused by leaving in a line that shouldnt be left in, that is overlooked in the install instructions...
When you make the second edit in checkout_confirmation.php, the instructions should read:

Quote

Find this.... (start at aprox. line no.55)

  if ( ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) { 

  tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL'));
  }

..and replace it with this.......

##### Points/Rewards  Module v1.00 check for error BOF #######
//force customers to select other payment method if the points total not enogh to cover the cost.
// if ( ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) {
   if ( (is_array($payment_modules->modules)) && (sizeof($payment_modules->modules) > 1) && (!is_object($$payment)) && ($customer_shopping_points_spending * REDEEM_POINT_VALUE < $order->info['total'] ) || (is_object($$payment) && ($$payment->enabled == false)) ) {
    tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL'));
  }
// customer can't use points over the order total         
   if ($customer_shopping_points_spending * REDEEM_POINT_VALUE > $order->info['total']) {
       $customer_shopping_points_spending = 0;
    tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(REDEEM_SYSTEM_ERROR_POINTS_OVER), 'SSL'));
  }
########  Points/Rewards  Module v1.00 EOF #################*/

Note the bolded line, which is actually commented out in the copy section...

So, for anybody who's already got this contrib installed, but not working, search for
if ( ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) {
and remove the first instance of it...

I'm going to add these changes to the files and instructions and upload it so that we've got a working copy uploaded.

Hope this solves the problems that most of u r getting.

Cheers
Fatmcgav

#28   fatmcgav

fatmcgav
  • Members
  • 173 posts
  • Real Name:G Williams

Posted 03 June 2005 - 12:57 PM

POINTS AND REWARDS MODULE v1.2 - WORKING has now been uploaded, this is simply a fixed version including the correct redemptions.php file and a slight edit to the install instructions to fix the parse error experienced with checkout_confirmation.php

HTH

Cheers
Fatmcgav

#29   Z06BAIT

Z06BAIT
  • Members
  • 472 posts
  • Real Name:Z06BAIT
  • Gender:Male

Posted 03 June 2005 - 01:40 PM

ninini01, on Jun 1 2005, 09:45 AM, said:

Error when I open my_points.php
Warning: Missing argument 1 for tep_get_shopping_points() in /usr/local/apache/htdocs/evabijoux/includes/functions/redemptions.php on line 17

Fatal error: Call to undefined function: tep_count_pending_rows() in /usr/local/apache/htdocs/evabijoux/my_points.php on line 72

<{POST_SNAPBACK}>



Still getting this error with the 1.2 update.  Followed instructions and downloaded the redemptions.php file and copied over.  nothing.  :(
Remember what the Bible says: He who is without sin, cast the first rock. And I shall smoketh it.

#30   SambaMambo

SambaMambo
  • Members
  • 60 posts
  • Real Name:SambaMambo
  • Gender:Male
  • Location:France

Posted 03 June 2005 - 01:45 PM

fatmcgav, on Jun 3 2005, 01:57 PM, said:

POINTS AND REWARDS MODULE v1.2 - WORKING has now been uploaded, this is simply a fixed version including the correct redemptions.php file and a slight edit to the install instructions to fix the parse error experienced with checkout_confirmation.php

HTH

Cheers
Fatmcgav

<{POST_SNAPBACK}>


someone has tested it?
is it working ?
:-"

i dont want to broke my shop again ...
and thx to fatmcgav for the efforts and for the currency "change"  ;)


Also, i notice that in the readme file there is a little mistake.
-- Files to Modify in catalog section --------------

    catalog/account.php
    catalog/checkout_confirmation.php
    catalog/checkout_payment.php
    catalog/checkout_process.php
    catalog/create_account.php
    catalog/create_account_success.php
    catalog/logoff.php
    catalog/includes/application_top.php
    catalog/includes/database_tables.php
    catalog/includes/filenames.php
    catalog/includes/boxes/information.php
    catalog/includes/languages/english.php
    catalog/includes/languages/english/account.php
    catalog/includes/languages/english/checkout_payment.php
    catalog/includes/languages/english/create_account_success.php
    
********* Edit files in  catalog section ***************

Logoff.php isnt modified...

#31   Z06BAIT

Z06BAIT
  • Members
  • 472 posts
  • Real Name:Z06BAIT
  • Gender:Male

Posted 03 June 2005 - 01:51 PM

It works completely.  I did several test purchases.  The only error I get is:

Error when I open my_points.php
Warning: Missing argument 1 for tep_get_shopping_points() in /usr/local/apache/htdocs/evabijoux/includes/functions/redemptions.php on line 17

Fatal error: Call to undefined function: tep_count_pending_rows() in /usr/local/apache/htdocs/evabijoux/my_points.php on line 72

and that's when you are the customer trying to view how many points you have earned under my account.
Remember what the Bible says: He who is without sin, cast the first rock. And I shall smoketh it.

#32   fatmcgav

fatmcgav
  • Members
  • 173 posts
  • Real Name:G Williams

Posted 03 June 2005 - 01:57 PM

Young Tae Byun, on Jun 3 2005, 02:51 PM, said:

It works completely.  I did several test purchases.  The only error I get is:

Error when I open my_points.php
Warning: Missing argument 1 for tep_get_shopping_points() in /usr/local/apache/htdocs/evabijoux/includes/functions/redemptions.php on line 17

Fatal error: Call to undefined function: tep_count_pending_rows() in /usr/local/apache/htdocs/evabijoux/my_points.php on line 72

and that's when you are the customer trying to view how many points you have earned under my account.

<{POST_SNAPBACK}>

Hmm, u got a pm about this un :D

#33   amspo

amspo
  • Members
  • 25 posts
  • Real Name:Rainer Amend

Posted 03 June 2005 - 01:57 PM

hello,

i have the same problem:

Error when I open my_points.php
Warning: Missing argument 1 for tep_get_shopping_points() in /usr/local/apache/htdocs/evabijoux/includes/functions/redemptions.php on line 17

Fatal error: Call to undefined function: tep_count_pending_rows() in /usr/local/apache/htdocs/evabijoux/my_points.php on line 72


regards
rainer


PHP Version: 4.3.11
MySQL 4.0.24

#34   fatmcgav

fatmcgav
  • Members
  • 173 posts
  • Real Name:G Williams

Posted 03 June 2005 - 02:04 PM

Woopsie, looks like i put the wrong redemptions.php file in  :blush:  :blush:  :'(

The correct code is:
<?php
/*
  $Id: redemptions.php, v 1.10 2005/05/21 10:11:22 dgw_ Exp $
  http://www.deep-silver.com

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2005 osCommerce

  Released under the GNU General Public License
*/


// fetches the shopping points the customer currently has
  function tep_get_shopping_points($id = '', $check_session = true) {
    global $customer_id;

    if (is_numeric($id) == false) {
      if (tep_session_is_registered('customer_id')) {
        $id = $customer_id;
      } else {
        return 0;
      }
    }

    if ($check_session == true) {
      if ( (tep_session_is_registered('customer_id') == false) || ($id != $customer_id) ) {
        return 0;
      }
    }

	$points_query = tep_db_query("select customers_shopping_points from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$id . "'");
    $points = tep_db_fetch_array($points_query);

    return $points['customers_shopping_points'];
  }

  
// sets the shopping points the customer currently has
  function tep_set_shopping_points($points, $customer_id) {
   
	tep_db_query("update " . TABLE_CUSTOMERS . " set customers_shopping_points = '" . (int)$points . "' where customers_id = '" . (int)$customer_id . "'");
  }

  function tep_calc_shopping_pvalue($points) {
   
	return((float)$points * (float)REDEEM_POINT_VALUE);
  }

// fetches the pending rows the customer currently has
  function tep_count_pending_rows($id = '', $check_session = true) {
    global $customer_id;

    if (is_numeric($id) == false) {
      if (tep_session_is_registered('customer_id')) {
        $id = $customer_id;
      } else {
        return 0;
      }
    }

    if ($check_session == true) {
      if ( (tep_session_is_registered('customer_id') == false) || ($id != $customer_id) ) {
        return 0;
      }
    }

    $rows_check_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS_POINTS_PENDING . " where customer_id = '" . (int)$id . "'");
    $rows_check = tep_db_fetch_array($rows_check_query);

    return $rows_check['total'];
  }
    
// fetches the products restriction if enabled.
    function get_points_redemption_rules($customer_id, $order) {
      
     if (REDEMPTION_RESTRICTION == 'true') {  
      
      for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
  if (!(substr($order->products[$i]['model'], 0, 10) == RESTRICTION_MODEL)) {
 	 return false;
  }
   }

        return true;
        
      } else {
        return false;
      }
    }

// this function sets the customers Pending points
  function tep_add_pending_points($ordernum, $customer_id, $insert_id,$points_toadd) {
	
    $points_awarded = $points_toadd * POINTS_PER_AMOUNT_PURCHASE;
      
    $sql_data_array = array('unique_id' => '',
                            'customer_id' => $customer_id,
                            'orders_id' => $insert_id,
                            'points_pending' => $points_awarded,
                            'date_added' => 'now()', 
                            'comment' => 'TEXT_DEFAULT_COMMENT', 
                            'status' => 1);
                            
    tep_db_perform(TABLE_CUSTOMERS_POINTS_PENDING, $sql_data_array);
  }


// this function sets the new signup customers welcome points
  function tep_add_welcome_points($customer_id) {
	
    $welcome_points = NEW_SIGNUP_POINT_AMOUNT;
      
	tep_db_query('update '. TABLE_CUSTOMERS . ' set customers_shopping_points = customers_shopping_points + '. $welcome_points . ' where customers_id = '. (int)$customer_id);          
  }

?>

Appologies again, and i'll get the correct one uploaded now...

Cheers
Fatmcgav

#35   Z06BAIT

Z06BAIT
  • Members
  • 472 posts
  • Real Name:Z06BAIT
  • Gender:Male

Posted 03 June 2005 - 02:05 PM

It works now.  :D

Fantastic contribution.  Should be named Contrib of the Year!
Remember what the Bible says: He who is without sin, cast the first rock. And I shall smoketh it.

#36   amspo

amspo
  • Members
  • 25 posts
  • Real Name:Rainer Amend

Posted 03 June 2005 - 02:22 PM

It's great ...  :D

#37   fatmcgav

fatmcgav
  • Members
  • 173 posts
  • Real Name:G Williams

Posted 03 June 2005 - 02:27 PM

Young Tae Byun, on Jun 3 2005, 03:05 PM, said:

It works now.  :D

Fantastic contribution.  Should be named Contrib of the Year!

<{POST_SNAPBACK}>



amspo, on Jun 3 2005, 03:22 PM, said:

It's great ...  :D

<{POST_SNAPBACK}>

Glad it fixed the problem :D:D

And yeh, it is a great contrib....

#38   Tamsyn

Tamsyn
  • Members
  • 32 posts
  • Real Name:Tamsyn Spooner

Posted 03 June 2005 - 02:30 PM

Does anyone have the Credit Class Contributuion installed with this?

I've got points being added and showing up in the account ok.

I can't redeem them though. There is no box on the checkout_payment.php page.

#39   Tamsyn

Tamsyn
  • Members
  • 32 posts
  • Real Name:Tamsyn Spooner

Posted 03 June 2005 - 02:32 PM

SambaMambo, on Jun 3 2005, 02:45 PM, said:

Also, i notice that in the readme file there is a little mistake.
-- Files to Modify in catalog section --------------

    catalog/account.php
    catalog/checkout_confirmation.php
    catalog/checkout_payment.php
    catalog/checkout_process.php
    catalog/create_account.php
    catalog/create_account_success.php
    catalog/logoff.php
    catalog/includes/application_top.php
    catalog/includes/database_tables.php
    catalog/includes/filenames.php
    catalog/includes/boxes/information.php
    catalog/includes/languages/english.php
    catalog/includes/languages/english/account.php
    catalog/includes/languages/english/checkout_payment.php
    catalog/includes/languages/english/create_account_success.php
   
********* Edit files in  catalog section ***************

Logoff.php isnt modified...

<{POST_SNAPBACK}>



In the install instructions, this bit:

G.   open catalog/checkout_process.php
Clear sessions used at checkout if by any chance they still active.

Find... (aprox. line 275)

  tep_session_unregister('comments');
  
... and add after.....

  tep_session_unregister('customer_shopping_points');// Points/Rewards  Module v1.00
  tep_session_unregister('customer_shopping_points_spending');// Points/Rewards  Module v1.00


should refer to logoff.php

#40 ONLINE   burt

burt

    Code Monkey

  • Community Team
  • 7,734 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEV/on

Posted 03 June 2005 - 02:36 PM

Does this contribution allow to pay part by Points and part by other Method in the same order ?
eBooks / Templates

Warning: My posts may contain Horsemeat.