Jump to content
deep-silver

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

Recommended Posts

Steven

 

You need to import the sql statement into your database using Phpmyadmin or cpanel or whatever flavor of MSQL management that your server or host uses.

 

Thanks David for the response!

 

Ok, I tried to follow the steps for the SQL, its my first time and I dont have any training so I think I did it right, I browsed the Rows that were there just to get an idea and seems like everything is well. Looks good.

 

But I only have one question how do I do this step:

 

 

 

 

Thats the only part I havent been able to figure out <_<

 

Thanks in advanced!

 

Steve

Share this post


Link to post
Share on other sites

Forget it! I did it! WOW! I cant believe it! Amazing and I'm new at this stuff! WOW!!

 

Thanks for the help David! Appreciate it! =D

Edited by Chronoz

Share this post


Link to post
Share on other sites

*sigh* <_<

 

Im having a problem now

 

In the my admin panel under Modules/Order Total Modules I cant install the Points Redeemptions, I click on the install and the page refreshes and it stays with the "+ install" icon and I check my shopping cart and it doesnt appear.

 

I redid this step only thinking that this has to do with that part, I might be wrong.

 

Any ideas?

 

Thanks in advanced!

 

 

 

ADMIN STEP = 1.   open admin/orders.php
This will add a quick pending points conformation check box.
To be used when confirming order or updating order status.
This option will only show up when there are pending points for that order
and only if Auto Credit Pending Points is set to "false".

**note that this step has 2 parts**

Find... (start at aprox. line 54 to 55)

		$customer_notified = '1';
	  }

... and add after.....

######## Points/Rewards Module V2.00 BOF ##################

	  if ((isset($HTTP_POST_VARS['confirm_points']) && ($HTTP_POST_VARS['confirm_points'] == 'on'))||(isset($HTTP_POST_VARS['delete_points']) && ($HTTP_POST_VARS['delete_points'] == 'on'))) {
			$comments = ENTRY_CONFIRMED_POINTS  . $comments;

		$customer_query = tep_db_query("SELECT customer_id, points_pending from " . TABLE_CUSTOMERS_POINTS_PENDING . " WHERE points_status = 1 AND points_type = 'SP' AND orders_id = '" . $oID . "'");
		$customer_points = tep_db_fetch_array($customer_query);
		if (tep_db_num_rows($customer_query)) {
		  if (tep_not_null(POINTS_AUTO_EXPIRES)){
			$expire  = date('Y-m-d', strtotime('+ '. POINTS_AUTO_EXPIRES .' month'));
			tep_db_query("UPDATE " . TABLE_CUSTOMERS . " SET customers_shopping_points = customers_shopping_points + '". $customer_points['points_pending'] ."', customers_points_expires = '". $expire ."' WHERE customers_id = '". (int)$customer_points['customer_id'] ."'");
		  } else {
			tep_db_query("UPDATE " . TABLE_CUSTOMERS . " SET customers_shopping_points = customers_shopping_points + '". $customer_points['points_pending'] ."' WHERE customers_id = '". (int)$customer_points['customer_id'] ."'");
		  }

		  if (isset($HTTP_POST_VARS['delete_points']) && ($HTTP_POST_VARS['delete_points'] == 'on')) {
			tep_db_query("DELETE FROM " . TABLE_CUSTOMERS_POINTS_PENDING . " WHERE orders_id = '" . $oID . "' AND points_type = 'SP' LIMIT 1");
		  }
		  if (isset($HTTP_POST_VARS['confirm_points']) && ($HTTP_POST_VARS['confirm_points'] == 'on')) {
			  tep_db_query("UPDATE " . TABLE_CUSTOMERS_POINTS_PENDING . " SET points_status = 2 WHERE orders_id = '" . $oID . "' AND points_type = 'SP' LIMIT 1");
		  }
		}
	  }
######## Points/Rewards Module V2.00 EOF ##################

still at the same file .

Find... (aprox. line 340)

		<td valign="top"><?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?></td>

... and add after.....

<!-- // Points/Rewards Module V2.00 check_box_bof //-->
<?php
 $p_status_query = tep_db_query("SELECT points_status FROM " . TABLE_CUSTOMERS_POINTS_PENDING . " WHERE points_status = 1 AND points_type = 'SP' AND orders_id = '" . $oID . "'");
 if (tep_db_num_rows($p_status_query)) {
echo '<tr><td class="main"><b>' . ENTRY_NOTIFY_POINTS . '</b> ' . ENTRY_QUE_POINTS . tep_draw_checkbox_field('confirm_points', '', false) . ' ' . ENTRY_QUE_DEL_POINTS . tep_draw_checkbox_field('delete_points', '', false) . '  </td></tr>';
 }
?>
<!-- // Points/Rewards Module V2.00 check_box_eof //-->

Edited by Chronoz

Share this post


Link to post
Share on other sites

Bump, tried again today and I still cant install it, thats weird.

 

I thought that problem could be that I was xfered to a SSL server but I was able to install it the first time I did it, then I removed everything and did it again and in the mean time I was xfering pages to the SSL server (includes/configure.php) but I dont think that has to do with anything.

 

Any ideas what this could be?

Share this post


Link to post
Share on other sites

Steven

 

The only thing I can think of is this.

 

Start over with a complete new install

 

Run that Sql statement through phpmyadmin

 

Then redo all those steps.

 

DO NOT use the installer. The fact that you did try that to begin with may be why you are having problems.

 

But yes if it was me I would go back to the shop the way it was before you tried installing this and start over again.

 

David

 

Bump, tried again today and I still cant install it, thats weird.

 

I thought that problem could be that I was xfered to a SSL server but I was able to install it the first time I did it, then I removed everything and did it again and in the mean time I was xfering pages to the SSL server (includes/configure.php) but I dont think that has to do with anything.

 

Any ideas what this could be?

Share this post


Link to post
Share on other sites
read up the thread, the fix for your problem is there ..or wait a few day for an upcoming release that should include all latest bug fix given on this forum

 

Took me forever to find this - at least it is fixed now and my cart shows the correct totals on the order confirmation page, rather than a negative total which looked very happy, but I wasn't!

 

Thanks Phocea for fixing the big.

 

You mentioned that you were going to upload a new release - but that was 2 years ago!!

 

I'm just following you up :-) It would be great if the new release was there.....

 

I have written updated instructions that I will post.

 

Regards

Sol

Share this post


Link to post
Share on other sites
Hi

Ive installed this and love it but... There is always a but. I need it to remember the referer and the contribute regarding this didnt work 4 me it had a sql error. Does anyone know how to fix this or have a differnt option to remember the referer or how i can find out the referer of new customers?

Thanks

Broadbill

 

 

Hello

 

I would like this feature too.

 

I tried the mySQL file which broke my site and had to spend 40 minutes fixing my DB !!!

 

 

here is the BAD sql code in-case anyone wants to try to fix it?

 

	ALTER TABLE `customers` ADD `customer_referral` INTEGER NOT NULL DEFAULT '0';
INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES ('', 'Save referrer', 'KEEP_REFERRER_ID', 'true', 'Save the customer referrer and do not ask the customer again?', '22', '26', NOW(), NOW(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),');

 

BUT, all's well that ends well!

 

STILL, I would like to put the referral on the front page.

 

Anybody ??

 

Broadbill did you get it working?

 

Regds

Sol

Edited by ssnb

Share this post


Link to post
Share on other sites

When I tried to uninstall everything and my whole website got messed up and the database went to the garbage, so I redid everything and now my only problem is that under Modules/Order Total the Redemption Points is not even there as before I couldnt install it and now its not there. <_<

 

I checked everything, I might be missing something but I have no idea what it is!

 

Any ideas David?

Share this post


Link to post
Share on other sites

Steven

 

With you redoing everything step by step and still not seeing it I have to say without seeing everything for myself I am kind of at a loss to tell you where to look. Maybe someone else can jump on this thread and help you.

 

Have you had any success installing any other addons?

 

When I tried to uninstall everything and my whole website got messed up and the database went to the garbage, so I redid everything and now my only problem is that under Modules/Order Total the Redemption Points is not even there as before I couldnt install it and now its not there. <_<

 

I checked everything, I might be missing something but I have no idea what it is!

 

Any ideas David?

Share this post


Link to post
Share on other sites
Steven

 

With you redoing everything step by step and still not seeing it I have to say without seeing everything for myself I am kind of at a loss to tell you where to look. Maybe someone else can jump on this thread and help you.

 

Have you had any success installing any other addons?

 

 

Yea, I've done a template for the site, Meta Tags, and Thumb images.

 

I'm going to double check the catalog part, but I know for sure the admin part is perfect because I doubled checked that already.

 

If you want David I can give you my info and you can hop on and check it out aswell, if you want to, if not no worries. I'll PM you the info. Let me know! :D

 

Thanks for all your help!

 

Steven

Share this post


Link to post
Share on other sites

What I'm goin to do is start a fresh website and add everything that is in the folder called modified files and then add the other files

 

See how that goes!

Share this post


Link to post
Share on other sites

Would it have to do with me making my website under: www.mysite.com instead of www.mysite.com/catalog?

 

When I did it with www.mysite.com/catalog I was able to at least see the +install button under my Admin page

 

And now that I make it www.mysite.com everything is fine besides the fact that I cant even see the +install button.

 

I doubt but just to throw an idea that popped up

Share this post


Link to post
Share on other sites

You cant used the modifed files.

 

I tried replacing the files that I have now, I cant access my admin page.

 

I remade a database and before I installed the oscommerce RC2 I replaced the files then installed, I cant acccess admin nor catalog, I get error messages

 

No good

Share this post


Link to post
Share on other sites

Steven

 

You can install OsCommerce in either a sub directory such as /catalog or in your root directory and it will work fine. You just have to make sure you coorect the paths in your configure files.

 

But what has me bugged is this +install button you are talking about. The only play I remember seeing any type of install button is in the payment modules.

 

Would it have to do with me making my website under: www.mysite.com instead of www.mysite.com/catalog?

 

When I did it with www.mysite.com/catalog I was able to at least see the +install button under my Admin page

 

And now that I make it www.mysite.com everything is fine besides the fact that I cant even see the +install button.

 

I doubt but just to throw an idea that popped up

Share this post


Link to post
Share on other sites

Chances are the included modified files are for a different version of OSC...

 

Just to be sure are on the same page I hope that you are using points and rewards v20d-corrected + french version? That is the one that I used and everything went pretty well as expected.

 

You cant used the modifed files.

 

I tried replacing the files that I have now, I cant access my admin page.

 

I remade a database and before I installed the oscommerce RC2 I replaced the files then installed, I cant acccess admin nor catalog, I get error messages

 

No good

Share this post


Link to post
Share on other sites
But what has me bugged is this +install button you are talking about. The only play I remember seeing any type of install button is in the payment modules.

 

Yeap thats the one im talking about

 

 

 

 

Chances are the included modified files are for a different version of OSC...

 

Just to be sure are on the same page I hope that you are using points and rewards v20d-corrected + french version? That is the one that I used and everything went pretty well as expected.

 

Ill download the +french cuz Im using another one

 

Thanks for the tips!

 

But you did mention:

You just have to make sure you coorect the paths in your configure files.
What do you mean by that?

 

Thanks!

 

Appreciate your help! :D

Share this post


Link to post
Share on other sites

Ok, I just did it in www.mysite.com... works fine, but it was the very first thing i did!

 

Made a new database

Uploaded the Oscommerce RC2

Installed it

Went straight to my phpadmin and follwed the SQL steps

Then I went to the ADMIN part and made sure that under Modules I had the +install button

was there!

 

This is how I did it when I made it under www.mysite.com/catalog

 

And when I had trouble it was when I had other add ons installed already

Share this post


Link to post
Share on other sites
Ok finally made a fix so the payment method is set to null if there is enough point to cover the full order, this avoid to have to still go throught a payment gateway even so the order is free...

IMPORTANT NOTE

You will also need to make the modification as explained in my last 2 posts for this to work. the previous code change was required to allow the points required for an order to be calculated correctly if you have other deduction taking place before the point and reward order_total module.

It also fix negative amount order if you have enough points to cover the order total amount.

 

Credit goes to the Coupon and Gift Voucher contribution author since I haev simply mimic the logic they used. So if you have the contibution installed you will recognise a lot of the code below:

 

In checkout_confirmation.php

 

after

// load the selected payment module
 require(DIR_WS_CLASSES . 'payment.php');
   if ($point_covers) $payment=''; // Points and Rewards
 $payment_modules = new payment($payment);

 

 

and

 

 

  ##### Points/Rewards Module V2.00 check for error BOF #######
 if (isset($HTTP_POST_VARS['customer_shopping_points_spending']) && USE_REDEEM_SYSTEM == 'true') {
   if (isset($HTTP_POST_VARS['customer_shopping_points_spending'])&&tep_calc_shopping_pvalue($customer_shopping_points_spending) < $order->info['total'] && !is_object($$payment)) {
     tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(REDEEM_SYSTEM_ERROR_POINTS_NOT), 'SSL'));
   } else {
   if (!tep_session_is_registered('customer_shopping_points_spending'))
     tep_session_register('customer_shopping_points_spending');
   }
 }
 if (isset($HTTP_POST_VARS['customer_referred']) && tep_not_null($HTTP_POST_VARS['customer_referred'])) {
   $valid_referral_query = tep_db_query("SELECT customers_id FROM " . TABLE_CUSTOMERS . " WHERE customers_email_address = '" . $HTTP_POST_VARS['customer_referred'] . "'");
$valid_referral = tep_db_fetch_array($valid_referral_query);
   if (!tep_db_num_rows($valid_referral_query)) {
     tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(REFERRAL_ERROR_NOT_FOUND), 'SSL'));
   }
   if ($HTTP_POST_VARS['customer_referred'] == $order->customer['email_address']) {
     tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(REFERRAL_ERROR_SELF), 'SSL'));
   } else {
     $customer_referral = $valid_referral['customers_id'];
     if (!tep_session_is_registered('customer_referral')) tep_session_register('customer_referral');
   }
 }
// 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)) && (!$point_covers) || (is_object($$payment) && ($$payment->enabled == false)) ) {
    tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL'));
  }
########  Points/Rewards Module V2.00 EOF #################*/

 

Can you clarify where this is wrong?

Edited by ssnb

Share this post


Link to post
Share on other sites

Ok I found a flaw, I thought I had it down, but it was too good to be true, heres a SS

 

redemtions.jpg

 

 

Even though under Configuration/Points/RewardsV2.00 in my admin panel I have the Enable customers to Redeem points at checkout? selected at True it still doesnt appear when I check out an item, any help?

Edited by Chronoz

Share this post


Link to post
Share on other sites

I got it!

 

When i check out, it appears the option now, what it was was the following:

 

The Auto expire points and reminder HAVE to be in blank if you dont want to use them, I had them set to 0

 

duh!

Share this post


Link to post
Share on other sites

Ok, I have question on how to use this add-on:

 

I have a policy where if they have 120 points then can redeem 6$ and if they have 400 points they can redeem 20$ but how can I set it up where as if they had 400 points and they only wanted to spend 120 points?

 

Also how can I only make them choose between 120 and 400?

 

Is that even posible with this add on?

 

thanks

 

Steven

Share this post


Link to post
Share on other sites

Sounds like you are about all set then....

 

I got it!

 

When i check out, it appears the option now, what it was was the following:

 

The Auto expire points and reminder HAVE to be in blank if you dont want to use them, I had them set to 0

 

duh!

Share this post


Link to post
Share on other sites

The only way this works is you specify how much the points are worth and then when the user checks out they will have the option to use points if they have it available. If they choose to use points they can only use max points that are available. Another words they cannot specifiy how many points they want to use. If I understand correctly they used to be able to with an older version of this addon but not with the version you are using. Although you may be able to use some of the old code from the older versions and set up what you want to do.

 

 

Ok, I have question on how to use this add-on:

 

I have a policy where if they have 120 points then can redeem 6$ and if they have 400 points they can redeem 20$ but how can I set it up where as if they had 400 points and they only wanted to spend 120 points?

 

Also how can I only make them choose between 120 and 400?

 

Is that even posible with this add on?

 

thanks

 

Steven

Share this post


Link to post
Share on other sites
I got it!

 

When i check out, it appears the option now, what it was was the following:

 

The Auto expire points and reminder HAVE to be in blank if you dont want to use them, I had them set to 0

 

duh!

 

 

Interesting - I don't have to do this with mine - it is set to

 

Auto Expires Points 6

Points Expires Auto Remainder 30

 

So why would yours be different?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×