Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


Recommended Posts

Okay..could not figure out why it doubled the points problem so trying to upgrade to the next best thing, V2.0. I installed teh upgrade for Paypal IPN V3.15 also.

 

However, if I check out with a money order, all is fine. If I use Paypal, then after I hit the conformation button I am getting an error in eitehr line 162 or 147 of the redemption.php file. Missing aruguement. number 4, 5 and 6.

 

I also went back and checked the modified checkout pages in the upgrade.

 

Any Ideas?

 

2dogrc

 

Line 167

function tep_add_pending_points($customer_id, $insert_id, $points_toadd, $points_comment, $points_type) {
Edited by 2dogrc
Link to comment
Share on other sites

Can anyone explain this at checkout? I am running the v2.0d version...

 

Sub-Total: $7.49

Federal Express (Home Delivery): $4.05

Points Redeemed: -$11.54

Total: $-1.76

 

All I did was hit the back button a few times during checkout, switched the shipping options a few times and then tried to checkout again.

 

Does anyone have any thoughts?

 

TIA

Link to comment
Share on other sites

Can anyone explain this at checkout? I am running the v2.0d version...

 

Sub-Total: $7.49

Federal Express (Home Delivery): $4.05

Points Redeemed: -$11.54

Total: $-1.76

 

All I did was hit the back button a few times during checkout, switched the shipping options a few times and then tried to checkout again.

 

Does anyone have any thoughts?

 

TIA

Check three or four page behind, there is a bug fix by phocea !!!

Link to comment
Share on other sites

This contribution work now great, thanks Phocea and teamax !!!!

 

So i ve a question, is it possible to disable the function that permit to a customer to win some point by order, but enabled the possibility to win only when a customers write a comment on a product.

 

The customer will be able to use his point to pay his order ?

 

Thanks a lot for your answer

Link to comment
Share on other sites

This contribution work now great, thanks Phocea and teamax !!!!

 

So i ve a question, is it possible to disable the function that permit to a customer to win some point by order, but enabled the possibility to win only when a customers write a comment on a product.

 

The customer will be able to use his point to pay his order ?

 

Thanks a lot for your answer

Not too sure what you mean.

 

If you want to have the possibilty of allowing customers to win points by writing a comment, then you can simply manually add the points yourself after you have reviewed the customer review (so to speak).

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

Hi everybody,

 

i am having some problems with this contribution on my oscommerce installation, i have Version 2.0D installed and have followed every step and tripple checked that everything is as it should be according to the .ZIP file i downloaded with the Instructions and Files in it.

 

i have two problems with this system at the moment,

1) the redemptions box shows up but like the following,

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

The estimated total of your purchase is: %s .3,205.00 Shopping points with total worth $160.25.

 

Tick here to use Maximum Points allowed for this order. (%s points %s) ->

Or tick here to use all available points balance.

 

When it should say

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

The estimated total of your purchase is $1,324.90.....

 

this is abit of a problem, and i cannot understand why this is happening...

 

my second problem is on the checkout_confirmation.php page it does not deduct the Shopping points from the cart,

Sub-Total: $1,387.63

Pickup Rate (Customer Pickup (Our Address)): $0.00

AU TAX 10.0%: $136.27

Total: $1,523.90

 

Even if i have selected to remove 500 points or whatever from the order it still does not show up here in this page...

 

If anyone has absolutely any ideas please please please post your possible solution/answer as i am completely stuck.

Link to comment
Share on other sites

Hi everybody,

 

i am having some problems with this contribution on my oscommerce installation, i have Version 2.0D installed and have followed every step and tripple checked that everything is as it should be according to the .ZIP file i downloaded with the Instructions and Files in it.

 

i have two problems with this system at the moment,

1) the redemptions box shows up but like the following,

When it should say

this is abit of a problem, and i cannot understand why this is happening...

 

my second problem is on the checkout_confirmation.php page it does not deduct the Shopping points from the cart,

Even if i have selected to remove 500 points or whatever from the order it still does not show up here in this page...

 

If anyone has absolutely any ideas please please please post your possible solution/answer as i am completely stuck.

 

Something else that i have noticed now that i have re-registered a new test account for the catalog side...

With a new account it does not show the Redemptions box at all...

Link to comment
Share on other sites

hi,

 

I have a problem with excluding points for specials. I want that customers do not get points for specials, and also cannot redeem their points when buying specials. So i set the appropriate settings in the admin part.

 

Whenever i have ONLY specials in my cart, it works: you cannot redeem points, and you are not rewarded with points.

 

When i have no specials, it also works: you can redeem and get your points.

 

But, when i mix specials and non-specials in my cart, it goes wrong: i still cannot redeem points, also not for the non-specials. And i get rewarded with points, also for the specials.

 

How can i make this work? Any help would be appreciated!

 

Thanks!

 

Matt

Matthias Thoen

my contribution: Photo Gallery for osCommerce

--check my homepage in my CARD--

Link to comment
Share on other sites

Not too sure what you mean.

 

If you want to have the possibilty of allowing customers to win points by writing a comment, then you can simply manually add the points yourself after you have reviewed the customer review (so to speak).

 

Hi Chooch, yes i can do that. So if i want to disable the possibility for the customer to win point when he make an order, only for this case.

Link to comment
Share on other sites

I scanned through this thread, but never saw an answer for this:

 

store/admin/customers_points_referral.php

 

Warning: reset() [function.reset]: Passed variable is not an array or object in /home/gabbyscr/public_html/store/admin/includes/classes/object_info.php on line 17

 

Warning: Variable passed to each() is not an array or object in /home/gabbyscr/public_html/store/admin/includes/classes/object_info.php on line 18

 

Any idea why that's happening?

 

Also, in that same page, I have a customer that just ordered and her points are showing up there under Pending Points and listed as "Review" when she actually purchased products.

 

Any help would be greatly appreciated.

Link to comment
Share on other sites

This is my catalog/includes/functions/redemptions.php file, can anyone please tell me how to add a 50% order total limit for redemptions? (so points redemptions can be maximum 50% of the total order)

 

<?php

/*

$Id: redemptions.php, v 1.50 2005/AUG/10 15:17:12 sda_ Exp $

http://www.deep-silver.com

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 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'];

}

 

 

// balance customer points account

function tep_set_shopping_points($points_toset, $customer_id) {

 

tep_db_query("update " . TABLE_CUSTOMERS . " set customers_shopping_points = '" . (int)$points_toset . "' where customers_id = '" . (int)$customer_id . "'");

}

 

// calculate the shopping points value for the customer

function tep_calc_shopping_pvalue($points) {

 

return((float)$points * (float)REDEEM_POINT_VALUE);

}

 

// calculate the products shopping points tax value if any

function tep_display_points($products_price, $products_tax, $quantity = 1) {

if ((DISPLAY_PRICE_WITH_TAX == 'true') && (USE_POINTS_FOR_TAX == 'true')) {

$products_price_points_query = tep_add_tax($products_price, $products_tax) * $quantity;

} else {

$products_price_points_query = $products_price * $quantity;

}

return $products_price_points_query;

}

 

// calculate the shopping points for any products price

function tep_calc_products_price_points($products_price_points_query) {

$products_points_total = $products_price_points_query * POINTS_PER_AMOUNT_PURCHASE;

 

return $products_points_total;

}

 

// calculate the shopping points value for any products price

function tep_calc_price_pvalue($products_points_total) {

$products_points_value = tep_calc_shopping_pvalue($products_points_total);

 

return($products_points_value);

}

 

// fetches the pending rows the customer currently has

function tep_count_pending_rows($customer_id) {

 

$rows_query = tep_db_query("select count(*) as count from " . TABLE_CUSTOMERS_POINTS_PENDING . " where customer_id = '" . $customer_id . "'");

$rows = tep_db_fetch_array($rows_query);

 

if ($rows['count'] > 0) {

return true;

} else {

return false;

}

}

 

// fetches the products restriction by model.

function get_redemption_rules($order) {

 

if (REDEMPTION_RESTRICTION == 'true') {

 

if (tep_not_null(RESTRICTION_MODEL))

for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {

if (!(substr($order->products[$i]['model'], 0, 10) == RESTRICTION_MODEL)) {

 

return false;

}

return true;

}

if (tep_not_null(RESTRICTION_PID))

for ($i=0; $i<sizeof($order->products); $i++) {

$p_ids = split("[,]", RESTRICTION_PID);

for ($ii = 0; $ii < count($p_ids); $ii++) {

if ($order->products[$i]['id'] == $p_ids[$ii]) {

 

return true;

}

}

}

if (tep_not_null(RESTRICTION_PATH))

for ($i=0; $i<sizeof($order->products); $i++) {

$cat_ids = split("[,]", RESTRICTION_PATH);

$sub_cat_ids = split("[_]", tep_get_product_path($order->products[$i]['id']));

for ($iii = 0; $iii < count($sub_cat_ids); $iii++) {

for ($ii = 0; $ii < count($cat_ids); $ii++) {

if ($sub_cat_ids[$iii] == $cat_ids[$ii]) {

 

return true;

}

}

}

}

return false;

 

} else {

 

return true;

}

}

 

// check to see if to add pending points for specials.

function get_award_discounted($order) {

 

if (USE_POINTS_FOR_SPECIALS == 'false') {

 

for ($i=0; $i<sizeof($order->products); $i++) {

$id = $order->products[$i]['id'];

$product_query = tep_db_query("select products_price from " . TABLE_PRODUCTS . " where products_id = '" . $id . "' and products_status = 1");

$product = tep_db_fetch_array($product_query);

$cart_pri = split("[,]", $order->products[$i]['price']);

$p_pri = split("[,]", $product['products_price']);

for ($iii = 0; $iii < count($p_pri); $iii++) {

for ($ii = 0; $ii < count($cart_pri); $ii++) {

if ($p_pri[$iii] == $cart_pri[$ii]) {

 

return true;

}

}

}

}

 

return false;

 

} else {

return true;

}

}

 

// fetches the products pending points to add.

function get_points_toadd($order) {

 

if ((USE_POINTS_SYSTEM == 'true') && ($order->info['total'] > 0)) { // check that the points system is enabled

if ((USE_POINTS_FOR_SHIPPING == 'false') && (USE_POINTS_FOR_TAX == 'false'))

$points_toadd = $order->info['total'] - $order->info['shipping_cost'] - $order->info['tax'];

else if ((USE_POINTS_FOR_SHIPPING == 'false') && (USE_POINTS_FOR_TAX == 'true'))

$points_toadd = $order->info['total'] - $order->info['shipping_cost'];

else if ((USE_POINTS_FOR_SHIPPING == 'true') && (USE_POINTS_FOR_TAX == 'false'))

$points_toadd = $order->info['total'] - $order->info['tax'];

else $points_toadd = $order->info['total'];

}

return $points_toadd;

}

 

// this function sets the customers Pending points

function tep_add_pending_points($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);

}

 

// this function get the last update value for any key

function tep_get_last_date($key) {

 

$key_date_query = tep_db_query("select last_modified from " . TABLE_CONFIGURATION . " where configuration_key = '" . $key . "'");

$key_date = tep_db_fetch_array($key_date_query);

 

return tep_date_long($key_date['last_modified']);

}

 

// this function record the customers redeemed_points

function tep_add_redeemed_points($customer_id, $insert_id,$redeemed_points) {

 

$sql_data_array = array('unique_id' => '',

'customer_id' => $customer_id,

'orders_id' => $insert_id,

'points_pending' => - $redeemed_points,

'date_added' => 'now()',

'comment' => 'TEXT_DEFAULT_REDEEMED',

'status' => 4);

 

tep_db_perform(TABLE_CUSTOMERS_POINTS_PENDING, $sql_data_array);

}

 

// fetches the products discounted restriction if enabled.

function get_points_rules_discounted($order) {

 

if (REDEMPTION_DISCOUNTED == 'true') {

 

for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {

$id = $order->products[$i]['id'];

$product_query = tep_db_query("select products_price from " . TABLE_PRODUCTS . " where products_id = '" . $id . "' and products_status = 1");

$product = tep_db_fetch_array($product_query);

if (!(substr($order->products[$i]['price'],0,10) == $product['products_price'])) {

return false;

}

}

 

return true;

 

} else {

return true;

}

}

 

// check for awards restriction if enabled.

function get_redemption_awards($customer_shopping_points_spending) {

 

if (USE_POINTS_FOR_REDEEMED == 'false') {

if (!$customer_shopping_points_spending) {

return true;

}

 

return false;

 

} else {

 

return true;

}

}

?>

 

am i looking in the right place?

Thanks.

Link to comment
Share on other sites

I have a strange problem with Points/RewardsV20 - everything seems to work fine, except one major thing:

- In configuration in admin folder I am able to see and choose Points/RewardsV20 but there are no options in it - only thing i see is a clean table with name and so on, but nothing under it... :( Does anybody know what could it be? For now I am unable to change any options, values...

 

Please, please help... I haven't seen anybody else would have this problem...and have no idea what could it be :(

Link to comment
Share on other sites

Hi all

 

Apologies if these questions have been asked and answered somewhere but I can't find them!!

 

I love this mod but I have 2 problems:

 

1. When checking out it deducts the reward points from the customers total but not the value of the reward points from the cutomers cart.

 

2. In 'my points information page' under the comments header it displays 'shopping points name' this works fine until that customer referes someone, then the name displayed is that of the person they refered. The actual points remain the original customers points.

 

I'm using version ## POINTS AND REWARDS MODULE V2.0d ## CORRECTED with minor bug fix (11 Aug 06) and Referral Points Once insatalled.

 

Thanks everyone.

Link to comment
Share on other sites

I just added the latest Deep-Silver version for a client and it is brilliant.

 

However, I don't understand how the referal system is supposed to work.

 

Is it simply that A introduces B, therefore A gets x points when B places an order once?

Or is A supposed to keep getting x points as long as B keeps on placing orders?

 

Is it mean't to give referal points once (ie. points for refering?)

 

I was thinking of using the last small contribution to the catalog/checkout which adds the code of checking if the customer has placed an order before therefore stopping them from seeing the referals box.

 

Thanks to anyone who can give some clarity.

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

Anyone ever figure this out?

 

store/admin/customers_points_referral.php

 

Warning: reset() [function.reset]: Passed variable is not an array or object in /home/gabbyscr/public_html/store/admin/includes/classes/object_info.php on line 17

 

Warning: Variable passed to each() is not an array or object in /home/gabbyscr/public_html/store/admin/includes/classes/object_info.php on line 18

Link to comment
Share on other sites

Hello,

 

I'm using "POINTS AND REWARDS MODULE V2.0d" by Phosky and "Referral Points Once" fix by sashaben. I have a couple of issues with the referral part.

 

1. First of all, the module doesn't identify the referral by the email entered on the checkout_payment.php although the email is registered in the system. The Customers field on admin/customers_points_referral.php has just empty (). So, even if I confirm referral points and select to notify a customer, no email is sent because the customer is not identified.

 

2. Secondly, the order status is not identified correctly in admin/customers_points_referral.php. Instead of Pending, it says Awaiting Return.

 

3. What if I don't want Customers to earn points(cash back) for an item purchased at the store. Can I do that?

 

Any help would be appreciated. Thanks in advance.

Link to comment
Share on other sites

Hello,

 

I'm using "POINTS AND REWARDS MODULE V2.0d" by Phosky and "Referral Points Once" fix by sashaben. I have a couple of issues with the referral part.

 

1. First of all, the module doesn't identify the referral by the email entered on the checkout_payment.php although the email is registered in the system. The Customers field on admin/customers_points_referral.php has just empty (). So, even if I confirm referral points and select to notify a customer, no email is sent because the customer is not identified.

 

2. Secondly, the order status is not identified correctly in admin/customers_points_referral.php. Instead of Pending, it says Awaiting Return.

 

3. What if I don't want Customers to earn points(cash back) for an item purchased at the store. Can I do that?

 

Any help would be appreciated. Thanks in advance.

 

1. I briefly tested it but as it won't be supported by Deep-Silver, I decided against using it.

 

2. For that one, you really need to contact the authors of the two modifications and ask them if they knew or know of any problems arising due to their modifications. However, by looking at their code I can't see why that problem would occur.

 

3. You can have the Points module switched off, if you want.

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

1. I briefly tested it but as it won't be supported by Deep-Silver, I decided against using it.

 

2. For that one, you really need to contact the authors of the two modifications and ask them if they knew or know of any problems arising due to their modifications. However, by looking at their code I can't see why that problem would occur.

 

3. You can have the Points module switched off, if you want.

I don't want to completly turn off the points module. I still want to allow points for reviews and referrals. I just don't want to add points for purchases. Is there any way to turn off only that part of the module? Is there any support for the referral part of the module? Who can I contact about that? I thought this is why the support thread was opened for, to discuss the problems with the contribution.

 

Thanks for your help, anyway.

Link to comment
Share on other sites

Hello, I installed this contrib the 1.60 version

 

step by step of V1.00 has V1.60 not problem to install it. in the administration part, I have to give points and to withdraw some. email received by the customer.

 

I have a problem when a customer places order. The points on standby are not accessible in the administration part. ?Customers Pending Points? I have this error:

 

Fatal error: Call to a member function on a non-object in /home.10.2/xxxxxxxxxxx/www/V2/admin/includes/classes/order.php on line 183

 

however we do not have to touch has this file it seems to me!

 

on line 183 in admin/includes/classes/order.php

$this->content_type = $cart->get_content_type();

 

can you help me ?

 

Thanks

Edited by Cruelo
Link to comment
Share on other sites

I don't want to completly turn off the points module. I still want to allow points for reviews and referrals. I just don't want to add points for purchases. Is there any way to turn off only that part of the module? Is there any support for the referral part of the module? Who can I contact about that? I thought this is why the support thread was opened for, to discuss the problems with the contribution.

 

Thanks for your help, anyway.

Why don't you simply play with the code you have in product_info.php or better still, just remove it!!

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

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...