Jump to content
deep-silver

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

Recommended Posts

Hello:

 

I just downloaded this contribute from OSC when I open the file there was only one file included

 

I followed the link from the board to try to download the entire file and I received a error

 

The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.

If you could supply me with the proper link this would be great I am anxious to try this contribute

 

Your help in this matter is greatly appreciated

 

Thank you in advance-Frank

Share this post


Link to post
Share on other sites
in catalog/checkout_confirmation.php Try this line instead:

 

FIND:

if (isset($HTTP_POST_VARS['customer_shopping_points_spending'])&&$currencies->($customer_shopping_points_spending)) < ($order->info['total']) && !is_object($$payment)) {

 

REPLACE WITH:

if (isset($HTTP_POST_VARS['customer_shopping_points_spending'])&&$currencies->format(tep_calc_shopping_pvalue($customer_shopping_points_spending)) < $currencies->format($order->info['total']) && !is_object($$payment)) {

 

 

If you have CCGV(credit class and gift voucher) installed you need to also add a fix by phoeca and texmax.:

 

Your solution was only part complete and worked if you did not have a discount coupon of any sort .

However if you have CCGV installed or any other order_total module installed, the points are not calculated properly.

What is basically happening is that the points required are estimated at checkout_payment. if any order total module add or substract amount, we then need to recalculate the number of points required.

To do this the following changed are needed:

 

in includes/functions/redemptions.php: in the method function points_selection() change:

FIND:

             $max_points = $order->info['total']/REDEEM_POINT_VALUE > POINTS_MAX_VALUE ? POINTS_MAX_VALUE : $order->info['total']/REDEEM_POINT_VALUE;

             $max_points = $customer_shopping_points > $max_points ? $max_points : $customer_shopping_points;

 

REPLACE WITH

             $max_points = calculate_required_points($order->info['total'], $customer_shopping_points);

             //$max_points = $order->info['total']/REDEEM_POINT_VALUE > POINTS_MAX_VALUE ? POINTS_MAX_VALUE : $order->info['total']/REDEEM_POINT_VALUE;

             //$max_points = $customer_shopping_points > $max_points ? $max_points : $customer_shopping_points;

 

 

in includes/functions/redemptions.php:

FIND:

function referral_input() {

 

ADD ABOVE:

// Calculate the number of points needed to cover an amount

function calculate_required_points($amount, $cust_shop_points) {

    $max_allowed = $amount/REDEEM_POINT_VALUE > POINTS_MAX_VALUE ? POINTS_MAX_VALUE : $amount/REDEEM_POINT_VALUE;

    $max_allowed = $cust_shop_points > $max_allowed ? $max_allowed : $cust_shop_points;

    

    return $max_allowed;

}

 

Finally in the file includes/modules/order_total/ot_redemptions.php

 

FIND:

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

 

REPLACE WITH:

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

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

 

 

I tested this and the beauty of it is that we can now put the ot_redemptions module anywhere we want in the order total sequence depending on what we want to achieve.

With CCGV, I personnaly put it after the coupon deduction but before the gift voucher one...

 

 

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

FIND

require(DIR_WS_CLASSES . 'payment.php');

 

ADD AFTER

  if ($point_covers) $payment=''; // Points and Rewards

 

 

FIND:

if ( ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) )

ADD THIS TO THAT LINE

&& (!$point_covers)

 

If you have already made the change on this line with

&& (!$customer_shopping_points_spending)

you can change this bit only with

&& (!$point_covers)

 

In checkout_payment.php

AFTER:

// avoid hack attempts during the checkout procedure by checking the internal cartID

  if (isset($cart->cartID) && tep_session_is_registered('cartID')) {

    if ($cart->cartID != $cartID) {

      tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));

    }

  }

 

 

ADD

if(tep_session_is_registered('point_covers')) tep_session_unregister('point_covers');  // Points and Rewards

 

In checkout_process.php

AFTER

// load selected payment module

  require(DIR_WS_CLASSES . 'payment.php');

ADDif ($point_covers) $payment=''; //Points and Rewards

 

AFTER

  tep_session_unregister('comments');

ADD

   if(tep_session_is_registered('point_covers')) tep_session_unregister('point_covers'); // Point and Rewards

 

In modules/functions/redemption.php

AFTER

function calculate_required_points($amount, $cust_shop_points) {

(if you do not find this line of code then read the IMPORTANT NOTE at the top of this post)

 

ADD

global $order, $point_covers;

 

 

AFTER

$max_allowed = $cust_shop_points > $max_allowed ? $max_allowed : $cust_shop_points;

ADD

    if ($order->info['total'] - $max_allowed <= 0 ) {

        if(!tep_session_is_registered('point_covers')) tep_session_register('point_covers');

        $point_covers = true;

        } else {

            if(tep_session_is_registered('point_covers')) tep_session_unregister('point_covers');

    }

Thats it, i think idid not forget anything.

If you run into trouble let me know ... as soon as this is prooved bug free I will repackage it in the main release stream of Points and Rewards, unlesss deep-silver wants to do it !!

 

 

ALL Credit goes to:Phocea && Texmaxx

 

 

Does anyone care? Did this help anyone? Did this hurt anyone?

Share this post


Link to post
Share on other sites

Hi all,

 

I have installed the POINTS AND REWARDS MODULE v20d.

 

I get this message at checkout

 

** Points value are not enough to cover the cost of your purchase. Please select another payment method **

 

The user has enough points to pay the goods. I have turned on all options postage/tax etc.

 

Any help would be great as it seems so close to be working.

 

Regards

Warwick

Share this post


Link to post
Share on other sites

Dear Sir,

 

I have one problem with my redemption mod.

 

all the images and buttons are not visible on my site after the installation rest everything is working fine

 

can anyone please help me with this

 

thanks

 

and waiting for your help

Share this post


Link to post
Share on other sites

hi guys,

 

really like the look of this contribution - and the support/development it seems to be getting! :thumbsup:

 

only question at this point is whether anyone has successfuly had it working with a CRE Loaded version of OSC ..?

 

cheers ..

Share this post


Link to post
Share on other sites

If you have installed my two fixes above, there is another change. This change fixes a problem where the points were incorrectly totaled and an error resulted: ** Points value are not enough to cover the cost of your purchase. Please select another payment method **.

 

in catalog/includes/functions/redemptions.php:

 

CHANGE:

if ($order->info['total'] - $max_allowed <=0 ) {

 

TO:

if ($order->info['total'] - (tep_calc_shopping_pvalue($max_allowed)) <=0 ) {

 

The original line was comparing points to dollars not points dollar value to dollars.

 

lildog

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


Kebicards- Unique Baby Gift IdeasKebicards

Share this post


Link to post
Share on other sites

If you installed the mods from my last 3 posts here is another fix. This fixes a payment module bug which did not deselect the payment module when the points was enough to pay for the order.

 

In catalog/checkout_confirmation.php

CHANGE:

  if ($point_covers) $payment=''; // Points and Rewards

 

TO:

// if there are enough points AND the customer used them

if ($point_covers && isset($HTTP_POST_VARS['customer_shopping_points_spending'])) $payment=''; // Points and Rewards

 

 

the variable $point_covers just reflects if there are enough points on the account to pay for the order.

Share this post


Link to post
Share on other sites

Hello,

I installed the contribution and it seemed to work fine at first. When I get on checkout_payment.php I am asked whether I want to use my points or not and I can fill the box with the number of points I want to use. Then I click on "Continue" and I get on checkout_confirmation.php. And on this page, the cost of my basket does not change at all. So where do my points go then ?

After I order, I go check on my product information page how many points I have left. And I indeed have less points which means the points I wanted to use were debited. Except I spent as much money as id I did not have any, so what's the point ?

I checked on the admin configuration panel and everything seems to be fine.

Does anyone have any explanation for that ?

Any help would be very welcome.

Thank you very much !

Share this post


Link to post
Share on other sites

Sorry to crash the thread a little, but..

 

I have been looking at running a rewards scheme but not as a discount, rather as a redemption against a list of goodies. I don't want customers to use points as cash but I would like them to be able to redeem them separately and add their chosen reward item to their order. I think this works better for business customers because often the person placing the order isn't spending their own money - so freebies are better than discounts.

 

Does this contribution allow me to do this (and turn off the discount system)?

 

 

Thanks.

 

R.

Share this post


Link to post
Share on other sites

Great contribution.

 

I would need some modification though. How can the "Points and Rewards Module" be altered to get the points necessary for spending from an affiliate program/shop.

 

To clarify: The customer earns points by spending money at an other shop/company. Those points (from that database) can be then spend in my shop (the customer has to provide his/her account information i.e. customer number and pin [this data will not stored in my database] at checkout). I have the parameters of the other database and access requirements for checking if enough points are available etc.

 

Can anybody please provide some help or refer me to someone who might help me out.

 

 

Thank you in advance.

Share this post


Link to post
Share on other sites

i have a strange problem with de the referral system in points reward 2.0.

This is what the FAQ says "When we receive your referred friends completed and approved order, we will reward your Points account with 20 points .

The more first time orders we receive from your referrals, the more reward points you will receive."

 

but when you place an order for the second, third time you still can earn the points as it was the first time order.

that is not the idea after the refferal system i thought.

 

is there someone who has solved this yet?? i don't know enough from php :blush:

 

regards,

Jan


Dreams can come true, if you help them a littlebit

Share this post


Link to post
Share on other sites
i have a strange problem with de the referral system in points reward 2.0.

This is what the FAQ says "When we receive your referred friends completed and approved order, we will reward your Points account with 20 points .

The more first time orders we receive from your referrals, the more reward points you will receive."

 

but when you place an order for the second, third time you still can earn the points as it was the first time order.

that is not the idea after the refferal system i thought.

 

is there someone who has solved this yet?? i don't know enough from php :blush:

 

regards,

Jan

 

solution:

 

In catalog/checkout_payment.php

 

Find

 

<?php

if ((USE_POINTS_SYSTEM == 'true') && (USE_REDEEM_SYSTEM == 'true')) {

echo points_selection();

if (tep_not_null(USE_REFERRAL_SYSTEM)) {

echo referral_input();

}

}

?>

 

Replace -

 

<?php

$orders_total = tep_count_customer_orders();

 

if ((USE_POINTS_SYSTEM == 'true') && (USE_REDEEM_SYSTEM == 'true')) {

echo points_selection();

 

if (tep_not_null(USE_REFERRAL_SYSTEM)) {

if ($orders_total < 1) {

echo referral_input();

}

}

}

?>


Dreams can come true, if you help them a littlebit

Share this post


Link to post
Share on other sites

There is a fix submitted that addressies this...referrals once on the ### POINTS AND REWARDS MODULE V1.00 ### page.

 

solution:

 

In catalog/checkout_payment.php

 

Find

 

<?php

if ((USE_POINTS_SYSTEM == 'true') && (USE_REDEEM_SYSTEM == 'true')) {

echo points_selection();

if (tep_not_null(USE_REFERRAL_SYSTEM)) {

echo referral_input();

}

}

?>

 

Replace -

 

<?php

$orders_total = tep_count_customer_orders();

 

if ((USE_POINTS_SYSTEM == 'true') && (USE_REDEEM_SYSTEM == 'true')) {

echo points_selection();

 

if (tep_not_null(USE_REFERRAL_SYSTEM)) {

if ($orders_total < 1) {

echo referral_input();

}

}

}

?>

Share this post


Link to post
Share on other sites

Is the full version called v20d-corrected.zip?

 

Just i have found a few versions on the contribution page thats all!

 

 

Also will it work by its self or do i need another contribution added first?

 

I have just a standard store at the moment using postal order and cheque for payment!

 

 

Thanks,

 

 

andy

Share this post


Link to post
Share on other sites

Hi there, I am hoping someone has a fix to my issue with the points and rewards v2.

 

It is working except for the fact that although it states points used and comes off the order correctly it does NOT remove the points from their account. This only happens when they use pay pal.

 

So if they use money order those I can see were redeemed, but with 95% of the people using paypal I have a problem. their points are accumulating and they aren't showing up as redeemed so I can't go in and manually fix the ones that have used points.

 

Anyone have this issue and fixed it?? would love some help thanks

Share this post


Link to post
Share on other sites
Hi All,

 

I have installed this contribution.

My problem is, when I choose the options to use my points to pay for a product, and then get taken over to checkout_confirmation.php the normal price of the product still shows, as if the points are not being used.

 

Ive tried all things, and my register_globals is ON.

 

What can I do to fix this?

 

Thanks,

 

Matt Evans

New Zealand.

 

anyone got a fix for this? I have the exact same issue. The initial fix mentioned in the register globals off thread did actually make the discount show up on the checkout confirmation page, but of course it didn't add it to the order and many other functions.

 

If anyone could even point me at the right code to be looking at that would be helpful. This seems like a MAJOR problem with this contribution. I have gone through this tread and seen it brought up many times and always ignored.

Share this post


Link to post
Share on other sites

In fact I do not use and rewards 2.0 like discount couponn, and that makes me a problem in the calculation of the points…

 

Example:

 

Article X = 15 points

 

If the customer buys this article without using of point, that goes and it will have 15 points…

 

If Article X = 15 points and that customer uses for example 232 points to buy it, article X will bring back 4 points instead of 15 points for him…

 

I tested without the contribution discount coupon and that goes well, but if it there with contribution discount coupon or CCGV, the calculation of the points is bad…

 

 

(sorry for my bad english)

Share this post


Link to post
Share on other sites

Okay, I'm not sure what the reason is, but I have mine set to issue 50 "welcome" points to each new customer. The points are showing up in Admin as valid points, however, it isn't showing up for the customer.

 

I tested it by signing up as a new customer, and it doesn't show up when I place an order, and isn't showing up in the customer account. But I see it on the Admin side as valid customer points.

 

I also have the CGV add-on as well. My site is highly modified, so I don't know what the problem is.

 

Anyone know a fix?

Share this post


Link to post
Share on other sites

I have gone through the 73 pages, and i did not find any solution to the pending issue in relation to the Register_Globals ON/OFF effect on Checkout_confirmation.php. Am I right? Who is taking up the challenge ?

 

a desparate OsCommerce-fan

Share this post


Link to post
Share on other sites

Dear All,

 

Thanks to Deep Sliver, this Module is fantastic.

 

 

I have the same question as jameswoo has encountered.

 

Here is his question:

"Could i set a special redemption table instead of using the current redemption method (1 point redem $X)?

 

for example:

for every first 150 points earned, u could redem $5 for next purchase;

for every first 300 points earned, u could redem $12 for next purchase....

so summarized in the table below

 

Points Cash Voucher

-------------------------------------------

150 5

300 12

450 25"

 

His question is my question. Is this possible to be done in this module?

 

I hope anyone could give me some help! Thank you for all of your help. :rolleyes:

Share this post


Link to post
Share on other sites

Hi all!

 

I believe this has to be one of the best features ever developed for OSC, but for the last two weeks i've one small problem in trying to get the points rewards system to deduct the points from the over all price.

 

Let me explain in more details, im using version V2.00 Dated: 2006/JULY/07 & I've tried every other version within the contribution, but i get the same result.

 

When i go through and buy an item i get they option to pay partly using: Payment Method Credit/Debit Card (via PayPal)

 

and the remaining balance with the credit I have available:

--------------------------------------------

You have a credit balance of £9.37 ,would you like to use it to pay for this order?

The estimated total of your purchase is: £31.00

Total Purchase is greater than the maximum points allowed, you will also need to choose a payment method .

Tick here to use Maximum Points allowed for this order. (469 points £9.37) ->

--------------------------------------------

 

But after selecting checkout_confirmation.php I cant see any evidence that any monies have been deducted from the over cost (please see below):

 

--------------------------------------------

Sub-Total: £25.50

Cost/Weight Shipping Rates (

Amount:£25.5, Weight:1860 gms): £5.50

Total: £31.00

 

--------------------------------------------

 

and when i try go back to the 'Payment Information' section the the points have gone???

 

 

can some please, please advice what i can do next as I have really tried everything to get this to work to no avail!

 

 

All the very best!

Edited by salt

Share this post


Link to post
Share on other sites
Hi all!

 

I believe this has to be one of the best features ever developed for OSC, but for the last two weeks i've one small problem in trying to get the points rewards system to deduct the points from the over all price.

 

Let me explain in more details, im using version V2.00 Dated: 2006/JULY/07 & I've tried every other version within the contribution, but i get the same result.

 

When i go through and buy an item i get they option to pay partly using: Payment Method Credit/Debit Card (via PayPal)

 

and the remaining balance with the credit I have available:

--------------------------------------------

You have a credit balance of £9.37 ,would you like to use it to pay for this order?

The estimated total of your purchase is: £31.00

Total Purchase is greater than the maximum points allowed, you will also need to choose a payment method .

Tick here to use Maximum Points allowed for this order. (469 points £9.37) ->

--------------------------------------------

 

But after selecting checkout_confirmation.php I cant see any evidence that any monies have been deducted from the over cost (please see below):

 

--------------------------------------------

Sub-Total: £25.50

Cost/Weight Shipping Rates (

Amount:£25.5, Weight:1860 gms): £5.50

Total: £31.00

 

--------------------------------------------

 

and when i try go back to the 'Payment Information' section the the points have gone???

can some please, please advice what i can do next as I have really tried everything to get this to work to no avail!

All the very best!

bump

Share this post


Link to post
Share on other sites

Hi can someone help me please.

 

The points and rewards module was working fine for me. I’m using version 1.5.

 

However now for some reason I cannot figure out, it is not displaying the customers with pending points in Admin.

 

It says (Displaying 1 to 20 (of 33 orders)) and has the dropdown box as though their is 2 pages of info but no customers are being displayed.

 

Does anyone know what the problem is?

 

Thanks in advance.

Share this post


Link to post
Share on other sites
bump

 

fixed problem with advice from deep-silver:

 

On a fresh install of oscommerce the sort order for Points Redemptions and TOTAL

are the same = 4 you must change the sort order for TOTAL to higher then 4.

 

If the error is at the paypal site,

Go to Admin->Payment Modules->PayPal (Credit Card / Debit)

Ensure that you set the options in this module under... "Transaction Type" you MUST select Aggregate else it will not show the correct total at paypal.

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

×