Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


Recommended Posts

i seem to have the contribution installed correctly although i am too having the issue with PayPal, the total is correct so all the points are calculating. the only problem i am having is that the points are not removed from the customer account after it is been used and the new points have not been added. now i can manually change the points in ADMIN but this can be a big job. when using bank deposit the points system is perfect. it is only having issues with PayPal standard.

 

Any help or ideas would be great.

 

i did try the code previously listed in the thread although i got errors when trying to add the points to the PayPal_standard.php files.

 

i don't really need to have the points show in PayPal but i do need them to calculate on my site.

 

Thanking you again.

 

 

This is a recurring issue, unfortunately. Here is the reason it's not working.

 

As I understand it, some payment methods (e.g. Paypal and some credit card processing companies) communicate the order payment amount to the payment engine first - the payment engine being on their site.

 

Next, it updates your OSC store with the order - IF it was successful. In this regard, the payment engine tends to ignore checkout_process.php - which is where you will find your P&R code.

 

Therefore, what you have to do is find a way to tell the payment engine (e.g. paypal) to process the points as long as the transaction was successful - when it updates your OSC store.

 

Essentially, that is what the P&R code in checkout_process.php file does - which is why it works with bank transfer or any other static payment module you may use (like COD etc).

 

There have been several people - way back in this forum (on pages 60 ish I think) who managed to develop the code so that it will work in Paypal IPN. When Paypal IPN processes a successful transaction, it updates P&R and adds the Points Redeemed bit to the order etc.

 

For myself, I just upgraded from Paypal Payments Standard to Paypal IPN in order to make it work with P&R !! Perhaps a little extreme, but now it works fine with Paypal IPN!

 

Unfortunately, I use a credit card processing company that do the same as Paypal Standard - and I have yet to find a fix for it myself - so I update those transactions manually which is a bit annoying.

 

The alternative is to find a way to tell Paypal Standard how to do the above - maybe someone here has that code? If so would they please share it.

 

Other than that, you could consider posting the job on www.elance.com for say $50 I'm sure you'll get it sorted.

 

Cheers

Solio

Link to comment
Share on other sites

Has your ISP upgraded php from v4 to v5?

 

Shop Admin >> Tools >> Server info

 

nope its still the same.....

 

Database: MySQL 4.1.22-standard

HTTP Server: Zeus/4.3

PHP Version: 4.4.9 (Zend: 1.3.0)

 

 

so im at a loss *shrugs*

Link to comment
Share on other sites

Hi there,

 

I don't know if this question has already been asked before, but I want to create a page called 'checkout_overview.php' between the shopping cart and the checkout_shipping page.

 

Within this page I would like to show the items the customer wants to buy plus I want to let the customer choose to select his points on THIS page.

 

Everything is working fine, but the main problem is, is that checkout_confirmation.php can't find the points discount because it is originally taken from the checkout_payment page which in my case is two pages later.

 

Does anyone know how to get the information from checkout_overview to checkout_confirmation without using checkout_payment for this?

 

Kind regards,

 

Marcus

Link to comment
Share on other sites

Hey! I just installed this mod and am pretty excited! I did notice however going through my test that any gift vouchure balance isn't showing in the checkout as it normally would? Did I mess up a code somewhere, has anyone else gone through this?

Link to comment
Share on other sites

I am still having this same problem as quoated below

 

Hi again.

 

I am having problems and I really need to sort them to open up my store with points and rewards.

 

Basically, there are no points being deducted from the order total on the checkout confirmation page and therefore the price is not being reduced nor the points deducted.

 

I noticed the following from a page back...

 

 

 

Notice the image shows the rewards module in the order totals module in the admin control. This does not appear here on my store, what could I have done wrong, is it a database thing? I believe this may be the cause, am I right and does anyone know the fix for this?

 

Thanks...

 

I need to know what file would be responsible for displaying the rewards module in the order total module section in admin control - as it is current not displayed there and I think this is the problem. I have gone back through the installation and cannot find any problems.

 

Thanks again...

Link to comment
Share on other sites

I am still having this same problem as quoated below

 

I need to know what file would be responsible for displaying the rewards module in the order total module section in admin control - as it is current not displayed there and I think this is the problem. I have gone back through the installation and cannot find any problems.

 

Thanks again...

 

 

Without seeing your installation it's impossible to tell. If you think it could be a database thing, I would suggest you return to a previous working version, and try again.

 

The files you are looking for are all in the package.

 

My advice is to install the last release from Deep Silver (the author) as it seems the most stable.

Link to comment
Share on other sites

Bug found.

In a very rare case where full amount is covered by point and shipping tax and regular items tax are separated

the order total is not rounded correctly and you will be returned to payment page asking you to choose payment method.

to fix it

open catalog/includes/languages/english/modules/order_total/ot_redemptions.php

find this at line no.37

$order->info['total'] = $order->info['total'] - tep_calc_shopping_pvalue($customer_shopping_points_spending);

and replace with this.

$order->info['total'] = number_format($order->info['total'] - tep_calc_shopping_pvalue($customer_shopping_points_spending), 4);

in a normal cases you won't see any different.

Link to comment
Share on other sites

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

 

Thanks,

Andrea

 

I have had the same problem and cannot figure it out but do know that if you do not restrict points for minimum purchase amount it goes away. Novis that i am

Link to comment
Share on other sites

I found the solution to my problem by trial and error. What caused my problem was a bug in the minimum order value within the Points/Rewards configuration. Setting the value for it to nothing fixed it, but I wanted to use the minimum value, so the fix was to look at /includes/functions/redemptions.php - Look at line 336 and change it to read:

 

global $cart, $currencies, $order;

 

Thanks to the person that posted the above solutions to the minimum value bug.

 

Thanyou again and again I have been going nuts tryiing, I am a novice and you guys are amazing thankyou. If any one can tell me now how to get around the check out when points are used to bring to zero without a payment method that would be great or is there another way.

Link to comment
Share on other sites

This is a recurring issue, unfortunately. Here is the reason it's not working.

 

As I understand it, some payment methods (e.g. Paypal and some credit card processing companies) communicate the order payment amount to the payment engine first - the payment engine being on their site.

 

Next, it updates your OSC store with the order - IF it was successful. In this regard, the payment engine tends to ignore checkout_process.php - which is where you will find your P&R code.

 

Therefore, what you have to do is find a way to tell the payment engine (e.g. paypal) to process the points as long as the transaction was successful - when it updates your OSC store.

 

Essentially, that is what the P&R code in checkout_process.php file does - which is why it works with bank transfer or any other static payment module you may use (like COD etc).

 

There have been several people - way back in this forum (on pages 60 ish I think) who managed to develop the code so that it will work in Paypal IPN. When Paypal IPN processes a successful transaction, it updates P&R and adds the Points Redeemed bit to the order etc.

 

For myself, I just upgraded from Paypal Payments Standard to Paypal IPN in order to make it work with P&R !! Perhaps a little extreme, but now it works fine with Paypal IPN!

 

Unfortunately, I use a credit card processing company that do the same as Paypal Standard - and I have yet to find a fix for it myself - so I update those transactions manually which is a bit annoying.

 

The alternative is to find a way to tell Paypal Standard how to do the above - maybe someone here has that code? If so would they please share it.

 

Other than that, you could consider posting the job on www.elance.com for say $50 I'm sure you'll get it sorted.

 

Cheers

Solio

 

Hi,

I have paypal standard installed which im having all the same probs with having to add and delete the points manually.

 

you mentioned that paypal IPN works with this contrib....how do you go about upgrading to that and do you have to change anything with your paypal account?

 

thanks

Link to comment
Share on other sites

Hi,

I have paypal standard installed which im having all the same probs with having to add and delete the points manually.

 

you mentioned that paypal IPN works with this contrib....how do you go about upgrading to that and do you have to change anything with your paypal account?

 

thanks

 

 

It was a while ago that I upgraded, so can't remember how hard it was - you'll have to do the reading ! Here's some pointers: BACK UP FIRST !

 

http://www.oscommerce.com/forums/index.php?showtopic=179917

 

http://www.oscommerce.com/forums/index.php?showtopic=333691

 

Also, as mentioned in my last post, IPN ignores checkout_process.php, so any code that you may have added to checkout_process.php (from contributions such as the points & Rewards code) has to be added to IPN too.

 

There are posts relevant to that issue a few pages back - but here's pone post - you'll have to double check it's the latest:

http://www.oscommerce.com/forums/index.php?sho...p;#entry1329338

 

 

BACK UP FIRST !

Good luck

Link to comment
Share on other sites

it would be nice if i could edit my posts, rather than post so many redundant replies :rolleyes:

 

i believe i solved my problem!

 

the code in includes/modules/payment/paypal_ipn.php was:

#### Points/Rewards Module V2.00 balance customer points BOF ####
	  if ((USE_POINTS_SYSTEM == 'true') && (USE_REDEEM_SYSTEM == 'true')) {
// customer pending points added 
		if (($order->info['total'] > 0) && (get_award_discounted($order) == true)) {
		  $points_toadd = get_points_toadd($order);
		  $points_comment = 'TEXT_DEFAULT_COMMENT';
		  $points_type = 'SP';
		  if ((get_redemption_awards($customer_shopping_points_spending) == true) && ($points_toadd >0)) {
			tep_add_pending_points($customer_id, $insert_id, $points_toadd, $points_comment, $points_type);
		  }
		}
// customer referral points added 
		if ((tep_session_is_registered('customer_referral')) && (tep_not_null(USE_REFERRAL_SYSTEM))) {
		 $points_toadd = USE_REFERRAL_SYSTEM;
		 $points_comment = 'TEXT_DEFAULT_REFERRAL';
		 $points_type = 'RF';
		 tep_add_pending_points($customer_referral, $insert_id, $points_toadd, $points_comment, $points_type);
		}
// customer shoppping points account balanced 
		if ($customer_shopping_points_spending) {
		  tep_redeemed_points($customer_id, $insert_id, $customer_shopping_points_spending);
		}
	  }
#### Points/Rewards Module V2.00 balance customer points EOF ####*/

 

 

 

 

i changed it to:

#### Points/Rewards Module V2.1rc2a balance customer points BOF ####
 if ((USE_POINTS_SYSTEM == 'true') && (USE_REDEEM_SYSTEM == 'true')) {
// customer pending points added 
  if ($order->info['total'] > 0) {
	  $points_toadd = get_points_toadd($order);
	  $points_comment = 'TEXT_DEFAULT_COMMENT';
	  $points_type = 'SP';
	  if ((get_redemption_awards($customer_shopping_points_spending) == true) && ($points_toadd >0)) {
		  tep_add_pending_points($customer_id, $insert_id, $points_toadd, $points_comment, $points_type);
	  }
  }
// customer referral points added 
  if ((tep_session_is_registered('customer_referral')) && (tep_not_null(USE_REFERRAL_SYSTEM))) {
	  $referral_twice_query = tep_db_query("select unique_id from " . TABLE_CUSTOMERS_POINTS_PENDING . " where orders_id = '". (int)$insert_id ."' and points_type = 'RF' limit 1");
	  if (!tep_db_num_rows($referral_twice_query)) {
		  $points_toadd = USE_REFERRAL_SYSTEM;
		  $points_comment = 'TEXT_DEFAULT_REFERRAL';
		  $points_type = 'RF';
		  tep_add_pending_points($customer_referral, $insert_id, $points_toadd, $points_comment, $points_type);
	  }
  }
// customer shoppping points account balanced 
  if ($customer_shopping_points_spending) {
	  tep_redeemed_points($customer_id, $insert_id, $customer_shopping_points_spending);
  }
 }
#### Points/Rewards Module V2.1rc2a balance customer points EOF ####*/

 

 

 

and everything now works as it should.

thank you again, deep-silver, for taking the time to release this update. :)

can someone please advise where i have to place this code in the paypal_ipn.php file, i have been trying all different things all night and can not get it right.

Thanks in advance!

 

Ben

Link to comment
Share on other sites

hii.

I installed this mod everythings working fine except that the order total is not showing correct amount .

what can be the problem ?

also is there a way that I make customer to use either points or discount coupon ??

please reply fast ..I need it urgently.

Link to comment
Share on other sites

hii.

I installed this mod everythings working fine except that the order total is not showing correct amount .

what can be the problem ?

also is there a way that I make customer to use either points or discount coupon ??

please reply fast ..I need it urgently.

 

Have you tried to move the order settings in admin to see if you can make it work properly?

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Link to comment
Share on other sites

yes I have changed the order in admin as

0 for dis 1 for redm 2,3,4 for subtotal,tax etc and 6 for total

but total displays incorrect value only if I select checkbox to add points in checkout_payment.php

else it shows correct value

Link to comment
Share on other sites

yes I have changed the order in admin as

0 for dis 1 for redm 2,3,4 for subtotal,tax etc and 6 for total

but total displays incorrect value only if I select checkbox to add points in checkout_payment.php

else it shows correct value

 

It seems you set it up wrong! Explain exactly what you have for each module. So far I think you have this:

 

#1 = points

#2

#3

#4 = subtotal

#5 = tax

#6 = total

 

How have you set it up? Copy my chart above to explain it.

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Link to comment
Share on other sites

here's my sort order:

 

#0 = discount coupon

--- = free gifts(empty)

--- = low order(empty)

#1 = sub-total

#2 = shipping

#3 = tax

#4 = points redeem

#5 = total

 

Try this:

 

#1 = sub-total

#2 = shipping

#3 = tax

#4 = points redeem

#5 = discount coupon

#6 = total

 

I am assuming the error occurs only when discount coupons have been applied.... If the order does not work then let me know which coupon contribution have you used, provide a link.

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Link to comment
Share on other sites

even this does not solve my problem

 

here's page at checkout

 

total price of products is $63.48

Sub-Total: $57.13

Per Item (Best Way): $0.05

Points Redeemed: -$2.12

Discount Coupon 1 applied: -$6.35

Total: $0.04

 

please check it here's the link of my site currently its on our server.

 

http://prowebdesignsolutions.com/sulbha/

username: [email protected]

password : asasas

http://prowebdesignsolutions.com/sulbha/admin

username : admin

password : admin

Link to comment
Share on other sites

I don't normally do this kind of thing but I am taking a look as I have some time on my hands... hold on and I'll get back to you. What doesn't help is when people add lots of contributions to a template which is what I think your store is at first glance.

Edited by chooch

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Link to comment
Share on other sites

Ok I think I have found three possible reasons why it may be happening, but there's definitely a problem.

 

I will try to look in to this later when I have time and I will get back to you if I solve it.

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...