Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


Recommended Posts

Hello Everyone,

 

I have integrated this module with my site, the issue I am facing is ,

It does not allow to make a checkout using only points which a customer has confirmed. It forces to select a payment method (Say cash on delivery or paypal standard etc) in order to make checkout using points.

 

Is it possible to buy something using points without having to pay from the site ?

 

Please suggest , its really urgernt :'(

 

Thank you in advance

Link to comment
Share on other sites

Please Note.

in a rare case where you have enough points to cover your order and your store has only one payment option.

you stuck. why?

osCommerce choose that option as the default payment option.

the only why around is.

1. the safe way is to enable any other option.

2. you could add an extra code to go around it.

i will not post it now unless someone is really in need of it.

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

When using points to pay for your the whole order. you will notice that the payment method is empty.

this add on will show points as payment method or other payment + points.

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

find line no.37

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

and add after.

			$order->info['payment_method'] = ( $order->info['total'] > 0) ? $order->info['payment_method'] . '+' . str_replace(':', '', TEXT_POINTS) : str_replace(':', '', TEXT_POINTS);

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

Any none standard payment (third party that use api) like PayPal IPN.

will need to be merge in order to use it with this module.

I am looking into paypal IPN and will post soon.

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...

I am facing one issue supposed i have 100 points and i have paypal payment method activated ... now after final step of checkout ( Confirm ).. i go to paypal now if i return back without payment my points will deduct .. any way to deduct points after we come back form paypal?

Please help me its really critical issue

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
  • 1 month later...

I'll just say that if you take the time to do it, it can be installed osc 2.3.1. I have it in mine and love it, although I do have a couple issues that I need to resolve.

 

The first one off-hand is when redeeming points, if subtotal is less than points, it gives customer credit for negative amount.

 

7.00 - 15.00 Points = -8.00 Credit. This lets them not pay for shipping or tax basically.

 

I'm thinking I read about this some time ago in this forum, so I'll have to keep searching unless someone knows off-hand how to resolve this...

Link to comment
Share on other sites

Where do you have these installed in your files?

 

 

Posted 19 March 2011, 04:36

snapback.pngdesmoworks, on 18 March 2011, 21:49, said:

 

I'd like to have a total accumulated points calculation as we are offering special one time rewards for different levels of achievement. Such as 2000 points, 5000 points, 10000 points, etc... Kind of like an airline where they have various levels of achievement within their rewards systems.

 

Looks like I've got it. Basically just takes the customers current points and adds (well, subtracts the negative) the redeemed points to get the total accumulated points. Below is for what the customers see in their account. Just finishing up the report in the admin section so we can track these people easily. Next up will be to make loyalty groups at the different point levels and an automated system to alert those who qualify.

 

The query:

 

 

<?php $accumulated_points_query = tep_db_query("select c.customers_id, c.customers_shopping_points, pp.customer_id, sum(pp.points_pending) as points_redeemed from " . TABLE_CUSTOMERS . " c, " . TABLE_CUSTOMERS_POINTS_PENDING . " pp where points_status = 4 and c.customers_id = pp.customer_id and customers_id = '" . (int)$customer_id . "'");

 

$accumulated = tep_db_fetch_array($accumulated_points_query);?>

 

And to display the data:

 

 

Lifetime Accumulated Loyalty Points: <?php echo number_format($accumulated['customers_shopping_points'] - $accumulated['points_redeemed'],POINTS_DECIMAL_PLACES); ?>

 

 

$customers_query_raw = "select c.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address, c.customers_points_expires, c.customers_shopping_points, pp.customer_id, (c.customers_shopping_points - sum(case when pp.points_status = 4 then pp.points_pending else 0 end)) as points_accumulated from " . TABLE_CUSTOMERS . " c, " . TABLE_CUSTOMERS_POINTS_PENDING . " pp where c.customers_id = pp.customer_id group by c.customers_firstname, c.customers_lastname order by $sort ";

 

 

The output:

<?php echo number_format($customers['points_accumulated'],POINTS_DECIMAL_PLACES); ?>

Edited by The Munch
Link to comment
Share on other sites

 

Posted 19 March 2011, 04:36

desmoworks, on 18 March 2011, 21:49, said:

I'd like to have a total accumulated points calculation as we are offering special one time rewards for different levels of achievement. Such as 2000 points, 5000 points, 10000 points, etc... Kind of like an airline where they have various levels of achievement within their rewards systems.

The query:
<?php $accumulated_points_query = tep_db_query("select c.customers_id, c.customers_shopping_points, pp.customer_id, sum(pp.points_pending) as points_redeemed from " . TABLE_CUSTOMERS . " c, " . TABLE_CUSTOMERS_POINTS_PENDING . " pp where points_status = 4 and c.customers_id = pp.customer_id and customers_id = '" . (int)$customer_id . "'");

$accumulated = tep_db_fetch_array($accumulated_points_query);?>

And to display the data:
Lifetime Accumulated Loyalty Points: <?php echo number_format($accumulated['customers_shopping_points'] - $accumulated['points_redeemed'],POINTS_DECIMAL_PLACES); ?>

For the report I had to do it a little differently. In order to do a proper sort by accumulated points I had to get the math done in the query instead. Now I can sort by customers name, current points, accumulated points, etc... I also added their emails to the report and next will figure out how to export the report with selected parameters to excel.

The query:
$customers_query_raw = "select c.customers_id, c.customers_firstname, c.customers_lastname, c.customers_email_address, c.customers_points_expires, c.customers_shopping_points, pp.customer_id, (c.customers_shopping_points - sum(case when pp.points_status = 4 then pp.points_pending else 0 end)) as points_accumulated from " . TABLE_CUSTOMERS . " c, " . TABLE_CUSTOMERS_POINTS_PENDING . " pp where c.customers_id = pp.customer_id group by c.customers_firstname, c.customers_lastname order by $sort ";

The output:
<?php echo number_format($customers['points_accumulated'],POINTS_DECIMAL_PLACES); ?>

 

Sorry, just after posting that last one I figured it out. duh! I have it in the account.php at the bottom and it works great. Thanks!! I'm also trying to get the same thing going with a membership level program based on their lifetime points, which for me is based on referrals, not really how much they spend. But it's the same principle. If you make any headway on this, please post it here..

Edited by The Munch
Link to comment
Share on other sites

I've seen this question on different pages in here, but haven't seen a solution. Apparently this contribution at one time was experimenting with giving the customer the option of using all of their points or just part of them by (I'm assuming) a box to enter how many of their points (or how much money) they want to use on the order to deduct from their current points.

 

Does anyone know how to get that to work?

Link to comment
Share on other sites

  • 2 weeks later...

So I've downloaded Points & Rewards v1.60 dated 3 Nov 2005 in my attempt to get the partial points, as that seems to be the last version with that active before it got traded for the All-Points checkbox.

 

In checkout_payment.php, I have:

 if ((USE_POINTS_SYSTEM == 'true') && (USE_REDEEM_SYSTEM == 'true')) {
  //echo points_selection();
  $cart_show_total= $cart->show_total();
  echo points_selection($cart_show_total);}

  ?><center><?php echo TEXT_REDEEM_SYSTEM_SPENDING_PART . '  ' .tep_draw_input_field('customer_shopping_points_spending', $customer_shopping_points_spending , 'onBlur="validate(this)" onFocus="clearText(this)" maxlength="7" style="width:70px"')?></center><?php;

 if (tep_not_null(USE_REFERRAL_SYSTEM) && (tep_count_customer_orders() == 0) && KEEP_REFERRER_ID=='true' && tep_get_referral() == 0) {
echo referral_input();}

 

This does calculate in the checkout_confirmation.php (when a value is entered into the input field for the partial points), and it's correct. The problem is that the field has the same name as the original with the checkbox, so having both of them makes the first one effectively disabled, which in this case is the checkbox. The calculation is correct though, and when trying to enter a value above what the customer has, it rightfully pulls up the error message. So it does work wonderfully.

 

I'm just wondering if someone knows how to make both the checkbox and the partial points field work, so that customers have the choice of spending all of their points or spending only part of them. Obviously it comes down to renaming the partial points field, but I'm needing a little help with that, and it's proving to be too much for the ole noggin tonight...

 

Any help would be greatly appreciated...

(Currently using osC 2.3.1 with Points & Rewards v2.1beta dated 3 Feb 2011)

Edited by The Munch
Link to comment
Share on other sites

  • 2 weeks later...

I installed "V2.1beta" on my OSC 2.2 M2. I can't find some codes in some of the files. The codes are below. PLEASE HELP!

 

1) catalog/checkout_process.php

 

 

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'));

}

 

2) catalog/product_reviews_info.php

 

 

<td class="pageHeading" valign="top"><?php echo $products_name; ?></td>

<td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>

</tr>

</table></td>

</tr>

 

3) open catalog/reviews.php

 

 

 

<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_reviews_new.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

</tr>

</table></td>

</tr>

 

4) catalog/includes/boxes/shopping_cart.php

 

 

if ($cart->count_contents() > 0) {

$info_box_contents[] = array('text' => tep_draw_separator());

$info_box_contents[] = array('align' => 'right',

'text' => $currencies->format($cart->show_total()));

}

Link to comment
Share on other sites

For anyone interested, I finally sat back down to figure out the Partial Points. I have it installed on my osc 2.3.1, but the module was based on 2.2. Here it is:

 

Use Partial Points for Points & Rewards Module v1.0 (12.16.2011)
Based from Points & Rewards Module v2.1beta (3 Feb 2011)
For osC 2.2 or 2.3.1
Author:  Scott "Munch" Bearden

+++++++++++++++++++++++++++
in PhpMyAdmin:
Step 1
ADD THE FOLLOWING SQL:
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 ('','Use Partial Points Fake','USE_POINTS_PART_FAKE','yes','Do you want to use Partial Points instead of All Points?','888010','18','now()','now()','','tep_cfg_select_option(array(yes, no))')

+++++++++++++++++++++++++++
in catalog/checkout_confirmation.php:
Step 2.0
Find:
##### Points/Rewards Module V2.1beta check for error BOF #######
 if ((USE_POINTS_SYSTEM == 'true') && (USE_REDEEM_SYSTEM == 'true')) {
  if (isset($_POST['customer_shopping_points_spending']) && is_numeric($_POST['customer_shopping_points_spending'])) {
   $customer_shopping_points_spending = false;
Insert This Before:
### BOF: Partial Points ###
$_POST['customer_shopping_points_spending'] = ($_POST['customer_shopping_points_spending'] + $_POST['customer_shopping_points_spending_part']);
$customer_shopping_points_spending = ($customer_shopping_points_spending + $customer_shopping_points_spending_part);
### EOF: Partial Points ###

+++++++++++++++++++++++++++
Step 2.1
A few lines down find:
   // This if sentence should include check for amount of points on account compared to the transferred point from checkout_payment.php
   // Possible Hack Fix included
   if (tep_calc_shopping_pvalue($_POST['customer_shopping_points_spending']) < $order->info['total'] && !is_object($$payment) || (tep_get_shopping_points($customer_id) < $_POST['customer_shopping_points_spending'])) {
 $customer_shopping_points_spending = false;
 tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(REDEEM_SYSTEM_ERROR_POINTS_NOT), 'SSL'));
### IF THE COMBINATION OF THE CUSTOMER'S MAXIMUM POINTS ALLOWED PER ORDER CHECKBOX AND THE PARTIAL POINTS BOX EXCEEDS THE MAXIMUM POINTS ALLOWED PER ORDER, AND YOU WANT TO USE AN ERROR MESSAGE ... Insert This After: ###
### BOF: Partial Points ###
   } elseif ($_POST['customer_shopping_points_spending'] > POINTS_MAX_VALUE){
 $customer_shopping_points_spending = false;
 tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(REDEEM_SYSTEM_ERROR_POINTS_OVER_MAX), 'SSL'));
   }
### EOF: Partial Points ###
### IF THE COMBINATION OF THE CUSTOMER'S MAXIMUM POINTS ALLOWED PER ORDER CHECKBOX AND THE PARTIAL POINTS BOX EXCEEDS THE MAXIMUM POINTS ALLOWED PER ORDER, AND YOU WANT THE POINTS TO DEFAULT TO THE MAXIMUM POINTS ALLOWED PER ORDER ... Insert This After: ###
### BOF: Partial Points ###
   } elseif ($_POST['customer_shopping_points_spending'] > POINTS_MAX_VALUE){
 $customer_shopping_points_spending = POINTS_MAX_VALUE;
   }
### EOF: Partial Points ###

+++++++++++++++++++++++++++
in catalog/checkout_payment.php:
Step 3
Find:
<!-- Points/Rewards Module V2.1beta Redeemption box bof -->
<?php
 if ((USE_POINTS_SYSTEM == 'true') && (USE_REDEEM_SYSTEM == 'true')) {
  //echo points_selection();
  $cart_show_total= $cart->show_total();
  echo points_selection($cart_show_total);
NOTE*** IF YOU USE THE CONTRIBUTION 'REMEMBER REFERRER', THIS LAST LINE READS:
  echo points_selection($cart_show_total);}
Insert After:
### BOF: Partial Points ###
if($cart_show_total > (POINTS_MIN_AMOUNT-.01)) {
 if(USE_POINTS_PART == 'yes'){
  ?><center><?php echo TEXT_REDEEM_SYSTEM_SPENDING_PART . '  ' .tep_draw_input_field('customer_shopping_points_spending_part', $customer_shopping_points_spending_part , 'onBlur="validate(this)" onFocus="clearText(this)" maxlength="7" style="width:70px"')?></center><?php;
 }
}
### EOF: Partial Points ###

+++++++++++++++++++++++++++
IF YOU ARE USING AN ERROR MESSAGE IN Step 2.1, PROCEED WITH STEP 4.
IF YOU ARE USING THE DEFAULT TO THE MAXIMUM POINTS ALLOWED IN Step 2.1, SKIP Step 4 AND YOU'RE DONE!!
in catalog/includes/languages/english.php:
Step 4
Find:
define('REDEEM_SYSTEM_ERROR_POINTS_OVER', 'REDEEM POINTS ERROR !  Points value can not be over the total value. Please Re enter points');
Insert After:
### LINE ADD: Partial Points ###
define('REDEEM_SYSTEM_ERROR_POINTS_OVER_MAX', 'REDEEM POINTS ERROR !  Points value can not be greater than $'.POINTS_MAX_VALUE.'.00');

+++++++++++++++++++++++++++
YOU ARE FINISHED!!

Link to comment
Share on other sites

  • 3 months later...

I've installed this contribution, and everything seems to work find EXCEPT....

 

It doesn't subtract the redeemed points from the price of the order.

It does subtract the redeemed points from the point balance -- just not the order total.

A customer can check the redeem box - but nothing happens except losing those points from the balance.

 

 

 

Can anyone tell me what I'm possibly missing?

 

Thanks!

Link to comment
Share on other sites

I've been able to successfully install this, and get it to work (Fixed the problem just above this note.)

 

But, I do have a problem. If someone has enough points to pay for the entire order, and have the credit card payment option checked, and error will come back "No credit card number" or "No amount given."

 

It is still sending the information to the credit card authorization, but without any data.

 

How do I correct this?

 

Thanks.

Link to comment
Share on other sites

Please see the post just above this one. I'm still looking for a fix on that.

 

And, found another error. Fuzzy math.

 

 

Sub-Total:

$2,500.00

Points Redeemed:

-$99.40

Shipping Rate ( United States : ):

$6.00

Total:

$2.00

 

That came from editing the shopping cart after using some points.

It doesn't recalc properly it seems.

 

Anyone seen this type of weirdness and have a fix?

 

Thanks.

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...

Hi!

I have this Points/Rewards module installed in my shop fior a while and working fine. But now i just installed a new payment module (Multibanco/ATM) and ther's some problem with this 2 modules working together...

Multibanco module is working perfectly, unless the costumer discounts Reward Points. In this case the Multibanco Reference for payment is not showing in checkou_success page neither by email. If the costumers dosn't discount Points everything works fine with Multibanco module (in checkout_success appears the reference and amount to pay).

 

It's very strange.. i already checked all the files and there's no mistake, it seems to be a conflict but i don't know how to fix it..... if someone has an idea i'd really appreciate!

 

When costumers select payment method MULTIBANCO/ATM this is the difference depending on Reward/Points selection or not:

 

Checkout_Success when costumer DON'T DISCOUNT Points (everything OK):

 

post-194836-0-29403600-1336043733_thumb.jpg

 

Checkout_Success when costumer DISCOUNT Points (not showing Multibanco data):

post-194836-0-34746000-1336043726_thumb.jpg

 

Thanks!

Link to comment
Share on other sites

Completing the information about my problem above... the MULTIBANCO MODULE works fine even when Points are discounted because i do see the reference to payment in the admin page. So the refª is generated with the correct amount for that order. The problem is that the costumer is not seeing those references on checkout_succes or receiving them by email, that's all. So i suppose that this is a small bug but can't figure it out!

Link to comment
Share on other sites

  • 1 month later...

hello,

 

in check_out payment, if customer has no points than no comment is written, maybe i made a mistake.

anyhow,

 

if points sytem and redeem okey, will check customers first buy if not say, you can give points to your friends,

if it is not customers first buy, check customers points, write customers point, if it has not any point, writes text_no_ points_yet

 

i did like below but did not work

 

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

//echo points_selection();

$cart_show_total= $cart->show_total();

 

if (tep_not_null(USE_REFERRAL_SYSTEM) && (tep_count_customer_orders() == 0)) {

echo referral_input();

} else if ($cart_show_total > 0) {

echo points_selection($cart_show_total);

} else { echo TEXT_NO_POINTS_YET;

}

}

Link to comment
Share on other sites

  • 4 weeks later...

There is something about modification in step 18 for 2.3. Is there going to be an update to this for 2.3 as none of the lines in 2.2 are in the files. I have adapted some addons from 2.2 to fit 2.3 but there is to much in this one to do it. Please do this rewards for 2.3

Link to comment
Share on other sites

  • 2 weeks later...

Hello,

 

I've been trying to install this great contri, think I'm almost done,

however when I want to add the module in the admin sector - total order

(so points can be seen in the checkout_confirmation page)

 

I get this error :

 

Warning: reset() [function.reset]: Passed variable is not an array or object in /home/lilijewel/domains/pretty-juwelen.com/public_html/prettyadmin/modules.php on line 240

 

Warning: Variable passed to each() is not an array or object in /home/lilijewel/domains/pretty-juwelen.com/public_html/prettyadmin/modules.php on line 241

 

 

There are many topics about this but I can't find a solution to fix this.

 

this is what's in admin/modules.php around lines 240/241

 

switch ($action) {
   case 'edit':
  $keys = '';
  reset($mInfo->keys);
  while (list($key, $value) = each($mInfo->keys)) {
    $keys .= '<strong>' . $value['title'] . '</strong><br />' . $value['description'] . '<br />';[/b]
[b]	    if ($value['set_function']) {
	  eval('$keys .= ' . $value['set_function'] . "'" . $value['value'] . "', '" . $key . "');");
    } else {
	  $keys .= tep_draw_input_field('configuration[' . $key . ']', $value['value']);
    }
    $keys .= '<br /><br />';
  }
  $keys = substr($keys, 0, strrpos($keys, '<br /><br />'));[/b]
[b]	  $heading[] = array('text' => '<strong>' . $mInfo->title . '</strong>');[/b]
[b]	  $contents = array('form' => tep_draw_form('modules', FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module'] . '&action=save'));
  $contents[] = array('text' => $keys);
  $contents[] = array('align' => 'center', 'text' => '<br />' . tep_draw_button(IMAGE_SAVE, 'disk', null, 'primary') . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module'])));
  break;

 

can anyone help me out here?

Thanks in advance

Lili

Link to comment
Share on other sites

Does anyone know how to get the points and rewards module to work with "Paypal_IPN" and "Dynamo checkout" One Page checkout. It credits pending points fine when it is the standard 4 page checkout , but when you turn on one page checkout, it does not credit the pending points after the order is complete.

 

Any help would be highly appreciated.

 

Best Regards,

 

Evan

GanodermaCoffee.com

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