Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


Recommended Posts

Hello Deep-Silver,

 

I have finally got around to install your module and the instructions were very simple, even on a very modified site like mine.

However i thought i could give a bit of feedback to help to get this contribution working even more greatly and hopefully reduce the amount of problem people are having

As I was going along I noted a few remarks about the install instructions that you might want to add in the file, if you feel it is necessary.

 

1- Maybe a slighter better explanation of where the order_total module should be added. ie.

After sub total

After Taxes

Before discount coupon & gift voucher if installed (CCGV calculated all order total amount before its turn so the coupon or gift voucher will include the points redemption. Other way around does not work at the moment)

etc ...

 

2- On step 4 explanation it says to skip this step if you have gift voucher installed .. however only half the step must be skipped .. Obvious if u look at the code but easily missed if u just follow it through

 

Other points are small bugs I noticed.

1- When using the restriction to use point for order under a certain amount. If you have enough in your basket to use your points ... tick the box to use your points, then go back to the shopping cart, remove articles and now have a total order value that is under the minimum amount to use points. If you then process to checkout confirmation, the points are still being removed ... hence you can go around the minimum order value restriction.

You will also noticed that even if you put thingsd back in your basket, the checkbox to use your points does not come back .. session need to be destryed for it to work again.

I remember fixing a very similar problem in another order_total contribution .. If I find out what it was again I will let you know.

 

2- Others have already spotted this one. If you have enough points to pay for the full order, the payment method should change to whatever was automatically selected to no method. At the moment the amount to pay is 0 but the customer is still redirected to the method of payment, be it visa card gatway, paypal, or get check payment details in the confirmation email.

 

3- That one is more a technical glitch and there is a work around. But the points redemption should maybe include in its calculation other possible order total module that come before it in sequence, a bit like the gift voucher mod is doing it.

 

Last point. Other modification i made which could be of interest:

 

1- I have changed the FAQ files to used css and javascript to display a bit more elegantly. You can see an example on http://www.eboutik.net/my_points_help.php. Code is complaint with browser that are not using javascript

2- i have coded the modification for Paypal IPN 3 (devosc version). I could post a small modification instruction file on the contribution page if requested. I am going to look into the bug that send a negative shipping charge to Paypal if you paid for it with your points.

3- i am most probably also going to modified the referal system to ask the customer is referal email address at the time they are creating their account. This is to avoid asking for it during checkout everytime. I think it clutter the page even more and this process is long enough as it is. This will also be the basis of a more complex referal system I would like to implement where direct referal earn you xx%, but 2nd level referal also earn you xx% (kind of pyramidal system). It shouldnt be hard to do now that function to register referal points is already in place.

 

 

Thats all .. hope this helps.

Link to comment
Share on other sites

Actually ..after further testing it seems that the order_total sequence ordering screw things up whatever you do ....

This is driving me slightly crazy and only seems to happen when you have enough points to clear the full order.

 

Here are some screenshot to explain it better:

 

Points Redemtion after Discount Coupon and Enough Points to cover order:

screen1.gif

 

Points Redemtion before Discount Coupon and Enough Points to cover order:

screen2.gif

 

Points Redemtion after Discount Coupon and NOT Enough Points to cover order:

screen3.gif

Works Fine

 

Points Redemtion before Discount Coupon and NOT Enough Points to cover order:

screen4.gif

Works Fine

 

Funny enough, the problem really seems to be with the order total calculation when there are enough point to cover the full amount. On a brand new session withouth using any discount coupon or gift vouchers the problem still remain ....

screen5.gif

Link to comment
Share on other sites

Actually ..after further testing it seems that the order_total sequence ordering screw things up whatever you do ....

This is driving me slightly crazy and only seems to happen when you have enough points to clear the full order.

 

 

 

Funny enough, the problem really seems to be with the order total calculation when there are enough point to cover the full amount. On a brand new session withouth using any discount coupon or gift vouchers the problem still remain ....

screen5.gif

 

 

What i haved noticed in mine is :

 

When you got enough points to cover the amount of your order and you have several method of payment possible (be it cash on delivery, paypal or whatever), then there's no box "preticked" and you have the possibility of ticking only the redeemed box, then , you're fine, you don't go to another method of payment and you're redirected to checkout_success...

 

BUT, when you have usually one mean of payment (for instance, me, when it's only downloads, then i have only paypal as a payment method), then NO MATTER if your points cover up the total amount or not, you are redirected to Paypal, no matter...

 

I'm not too sure how to make the points module a "proper" method of payment and maybe give it a prime status (like before paypal ?), not sure it'd be the solution though... i must say i can't quite code in php, i'm trying already to understand the codes when reading them, but can't really write them (apart from the obvious ;))

 

Steph

Link to comment
Share on other sites

Ben

The points information shown in products info page are points given.

The Restriction to products only apply on redeem not on award.

Why not do it the other way round and EXCLUDE the products which are listed in RESTRICTION_PID.

For me it would be much easier, as I would like to provide points for almost all my products eccept some.

 

To hide the points display in product_info.php we could than add

	if ((USE_POINTS_SYSTEM == 'true') && (DISPLAY_POINTS_INFO == 'true') && (strpos(RESTRICTION_PID,$product_info['products_id'])===false)) { // check that the points system is enabled

to product_info.php

 

For your version of restriction its vice versa

	if ((USE_POINTS_SYSTEM == 'true') && (DISPLAY_POINTS_INFO == 'true') && (strpos(RESTRICTION_PID,$product_info['products_id'])===true)) { // check that the points system is enabled

What do you think?

G?tz

Link to comment
Share on other sites

As requested here is the code for a different way of displaying the FAQ page:

 

Replace the english language my_points_help.php file by the following.

To match the style of the answer display box to your shop you only need to play with the line:

$style = 'background-color:#f5ffc7; border: 1px dashed #fe8fa7; DISPLAY: none; POSITION: relative; padding:4px; margin:2px; border-left:5px solid #fe8fa7; text-align:justify;';

 

** Edit - Code is too long and apparently cannot be posted here .. will post in on contribution in a bit...

 

You will also need to include a javascript at the top of the my_points_help.php file (not the language one but the actual catalogue file)

Edited by Phocea
Link to comment
Share on other sites

Other points are small bugs I noticed.

1- When using the restriction to use point for order under a certain amount. If you have enough in your basket to use your points ... tick the box to use your points, then go back to the shopping cart, remove articles and now have a total order value that is under the minimum amount to use points. If you then process to checkout confirmation, the points are still being removed ... hence you can go around the minimum order value restriction.

You will also noticed that even if you put thingsd back in your basket, the checkbox to use your points does not come back .. session need to be destryed for it to work again.

I remember fixing a very similar problem in another order_total contribution .. If I find out what it was again I will let you know.

Ok I think I worked this one out ..but could you confirm this ?

 

In the functions/redemption.php, the function points_selection() is checking a few thing before displaying if you can use your point or not ...

However the resetting of the session base customer_shopping_points_spending is coming too late.

 

Basically, only after checking if all the rules to use the points are OK, then we register the session...

However if you tick the box, then later go back to checkout_payment, but this time you cannot use your point (for exemple there is not enough value in your basket anymore, then the session is never destroyed .. and the reward section does not show ...

But since its still registered from last time, points are deducted on checnkout_confirmation !!

 

To fix this you can simply change that piece of code:

 function points_selection() {
  global $cart, $currencies, $order;

  if (($customer_shopping_points = tep_get_shopping_points()) && $customer_shopping_points > 0){
 if ((get_redemption_rules($order) == true) && (get_points_rules_discounted($order) == true)){
   if ($customer_shopping_points >= POINTS_LIMIT_VALUE){
	 if ((POINTS_MIN_AMOUNT == '') || ($cart->show_total() >= POINTS_MIN_AMOUNT) ){
	   if (tep_session_is_registered('customer_shopping_points_spending')) tep_session_unregister('customer_shopping_points_spending');

 

by this

 

 function points_selection() {
  global $cart, $currencies, $order;

  if (($customer_shopping_points = tep_get_shopping_points()) && $customer_shopping_points > 0){
	   if (tep_session_is_registered('customer_shopping_points_spending')) tep_session_unregister('customer_shopping_points_spending');
 if ((get_redemption_rules($order) == true) && (get_points_rules_discounted($order) == true)){
   if ($customer_shopping_points >= POINTS_LIMIT_VALUE){
	 if ((POINTS_MIN_AMOUNT == '') || ($cart->show_total() >= POINTS_MIN_AMOUNT) ){

 

Is it as early as possible or could we reset the session even before the first condition -? I was not sure if $customer_shopping_points was a session based variable or not ...

 

I tested it as it is above and the bug has been fixed

Link to comment
Share on other sites

I'm trying to do a small modification to hide products from the pointsystem, so customers do not award points on a purchase of them. to enable it, set a comma separated list of Products ID restricted in your admin.

 

To install you need to run this sql in phpmyadmin:

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 ('', 'Hide products from Points-System', 'HIDDEN_POINTS', '', 'Hide products from Points-System.<br>Set a comma separated list of Products ID restricted or leave empty to disable it.', '22', '17', NOW(), NOW(), NULL , NULL);

and change this function in catalog/functions/redemptions.php

  function get_points_toadd($order) {

if ($order->info['total'] > 0) {
  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'];
}
if (tep_not_null(HIDDEN_POINTS)) {
  for ($i=0; $i<sizeof($order->products); $i++) {
	$p_ids = split("[,]", HIDDEN_POINTS);
	for ($ii = 0; $ii < count($p_ids); $ii++) {
	  if ($order->products[$i]['id'] == $p_ids[$ii]) {
		if (USE_POINTS_FOR_TAX == 'true') {
		  $points_toadd = $points_toadd - tep_add_tax($order->products[$i]['final_price'],$order->products[$i]['tax']);
		} else {
		  $points_toadd = $points_toadd - $order->products[$i]['final_price'];
		}
	  }
	}
  }
}
return $points_toadd;
 }

Its not yet tested in all cases, any comments or help is greatly appreciated!

Maybe someone could fill himself in :)

G?tz

Link to comment
Share on other sites

To hide the points display in product_info.php we could than add

	if ((USE_POINTS_SYSTEM == 'true') && (DISPLAY_POINTS_INFO == 'true') && (strpos(HIDDEN_POINTS,$product_info['products_id'])===false)) { // check that the points system is enabled

to product_info.php

Link to comment
Share on other sites

To the idiot who should go back to playschool and learn what open source is: Keep your comment for yourself and dont just got create a new accout because you prefer to hide rather than insult someone in person.

 

I have taken the files of deep-silver exactly as thy were and included modification as requested on the forum.

 

However if you rather keep the bug still existing in this great contribution then so be it.

 

So sorry guys, but seing how things are going here I will not post the fix for the problem when there is enough point toi pay for the fill order amount but it is still going to the payment gateway.

 

I will leave you a tip though: "look at how CCGV is doing it in the order_total class pre_confirmation_check() functio". This would be a good starting point. There is a couple of other function that could help with recalculating the point values needed depending if there has already been some deduction on the order ... this way maybe the point redemption could be made after discount coupon or gift vouchers have been deducted or vice versa without any problem.

 

As it stands at the moment, this contribution is slightly crippled by this problem.

Link to comment
Share on other sites

Greg

So sorry guys, but seing how things are going here I will not post the fix for the problem
Don't bother with someone not worth it.

On the whole, in the community here I found a lot of nice people helping each other to develop this shopsystem.

Kind regards

G?tz

Link to comment
Share on other sites

Well anyway I am off on vacation in a few hours so hopefully deep silver will sort that one out.

 

Basically Points and Rewads needs to duplicate some of the CCGV functionality, or maybe extend it for people that already have it installed

 

CCVG do a pre_confirmation_check in checkout_confirmation that set a variable $credit_cover depending if the voucher deduction is enough to cover the order total or not.

If it is, it set the payment method to null.

 

Points and Rewards must do something similar to avoir this bug. I also believe that if some of the same function were to be implemented then the probleme with the order_total sequencing might be solved.

Link to comment
Share on other sites

I have a couple of questions and I am sure others using this contribution would like to know as well.

 

1) If the account balance is greater then the order total, how do you remove the payment method. (Like on checkout_payment.php, remove the payment method and only show the customer the account balance table to enter the points that they would like to spend). Only if the customer has enough points to cover the order total.

 

2) Is there a way to do auto detect the account balance, like if the account balance is greater then the order total, it skips checkout_payment to the checkout_confirmation page.

 

Hope someone can help here or give some idea of how to do this because I have been trying but cant seem to get it to work.

 

Richard

Link to comment
Share on other sites

Hello Deepsilver. This contribution is really great, I just wanted to make one suggestion, if it is possible to implement.

I now use minimum order amount 20 USD, after which I allow customers to use points. I have already got some emails from customers with complains that cannot use their points, and the problem is that they never read FAQ, to see that they need 20 USD in cart to use points.

Even after I explain and give the link to FAQ, some remain angry, and do not come and finish the order.

Is it possible on checkout_payment.php page give some kind of "you need minimum 20 USD in your cart to use your points, please see FAQ for more info"" text in points section, instead of not displaying anything, if it is less than 20 USD.

 

Thank you

Link to comment
Share on other sites

Is it possible on checkout_payment.php page give some kind of "you need minimum 20 USD in your cart to use your points, please see FAQ for more info"" text in points section, instead of not displaying anything, if it is less than 20 USD
Everything is possible: catalog/includes/functions/redemptions.php
 function points_selection() {
  global $cart, $currencies, $order;

  if (($customer_shopping_points = tep_get_shopping_points()) && $customer_shopping_points > 0){
 if (tep_session_is_registered('customer_shopping_points_spending')) tep_session_unregister('customer_shopping_points_spending');
 if ((get_redemption_rules($order) == true) && (get_points_rules_discounted($order) == true)){
   if ($customer_shopping_points >= POINTS_LIMIT_VALUE){
	 if ((POINTS_MIN_AMOUNT == '') || ($cart->show_total() >= POINTS_MIN_AMOUNT) ){

.... some lines left out

	 } else {
		echo 'you need minimum 20 USD in your cart to use your points, please see FAQ for more info';
	 }

.....

Link to comment
Share on other sites

Thanks Deep-Silver. I haven't had the chance just yet to try that and here's why; something weird going in the admin orders.php. Every time I install the contrib, install the credit card module, do a test buy, go into admin>customers>orders, all of the credit card information is gone minus the payment method, in this case all I see is Credit Card. No numbers, no expiry date, nothing.

 

Before I re-install the contrib (I restore from a backup) I can order from credit card module and see the whole credit card thing and that order is there. However, once I re-install the contrib, do a new test order, the NEW order credit card info is gone as described above. The other order however, shows all of the info needed.

 

Any reason you can think of that would cause this? I do have the codes for the Gift and Coupon contrib in the site but not installed. Didn?t work for me ?

 

Hi Deep-Silver...

I am having exactly the same problem. I was wondering if you knew of anyone else that has had this problem, and if you have any idea's about it? I'm about to go through my entire installation and see if I can find the error... One thing I've noticed is:

I have the points system set up so that you can only redeem points if you have $50 or over in your cart. This problem is only occuring if you have less than $50 in your cart... Hoping for some guidance!

 

Thanks

~bobsi18~

Link to comment
Share on other sites

Hi Deep-Silver...

I am having exactly the same problem. I was wondering if you knew of anyone else that has had this problem, and if you have any idea's about it? I'm about to go through my entire installation and see if I can find the error... One thing I've noticed is:

I have the points system set up so that you can only redeem points if you have $50 or over in your cart. This problem is only occuring if you have less than $50 in your cart... Hoping for some guidance!

 

Thanks

~bobsi18~

Hi there... I've done more testing and now believe the issue is with the gift voucher contrib... i've noticed that if my voucher balance is bigger than the cart balance the problems are occurring, but not if the cart balance is greater than the voucher balance... off to see if i can figure it out.

~bobsi18~

Link to comment
Share on other sites

I have a couple of questions and I am sure others using this contribution would like to know as well.

 

1) If the account balance is greater then the order total, how do you remove the payment method. (Like on checkout_payment.php, remove the payment method and only show the customer the account balance table to enter the points that they would like to spend). Only if the customer has enough points to cover the order total.

 

2) Is there a way to do auto detect the account balance, like if the account balance is greater then the order total, it skips checkout_payment to the checkout_confirmation page.

 

Hope someone can help here or give some idea of how to do this because I have been trying but cant seem to get it to work.

 

Richard

 

I still cant this to work the way that I want it too.... please someone with some insight please! Here is a copy of checkout_payment:

 

<?php

/*

$Id: checkout_payment.php,v 1.113 2003/06/29 23:03:27 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright ? 2003 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

// if the customer is not logged on, redirect them to the login page

if (!tep_session_is_registered('customer_id')) {

$navigation->set_snapshot();

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

}

 

// if there is nothing in the customers cart, redirect them to the shopping cart page

if ($cart->count_contents() < 1) {

tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));

}

 

// if no shipping method has been selected, redirect the customer to the shipping method selection page

if (!tep_session_is_registered('shipping')) {

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

}

 

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

}

}

 

// Stock Check

if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) {

$products = $cart->get_products();

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

if (tep_check_stock($products[$i]['id'], $products[$i]['quantity'])) {

tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));

break;

}

}

}

 

// if no billing destination address was selected, use the customers own address as default

if (!tep_session_is_registered('billto')) {

tep_session_register('billto');

$billto = $customer_default_address_id;

} else {

// verify the selected billing address

$check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$billto . "'");

$check_address = tep_db_fetch_array($check_address_query);

 

if ($check_address['total'] != '1') {

$billto = $customer_default_address_id;

if (tep_session_is_registered('payment')) tep_session_unregister('payment');

}

}

 

require(DIR_WS_CLASSES . 'order.php');

$order = new order;

 

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

 

$total_weight = $cart->show_weight();

$total_count = $cart->count_contents();

 

// load all enabled payment modules

require(DIR_WS_CLASSES . 'payment.php');

$payment_modules = new payment;

 

// if customer is using points to pay

if ($customer_shopping_points_spending > 0) {

 

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

tep_redirect(tep_href_link(FILENAME_CHECKOUT_PROCESS));

}

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PAYMENT);

 

$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));

$breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<title><?php echo TITLE; ?></title>

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

<link rel="stylesheet" type="text/css" href="stylesheet.css">

<script language="javascript"><!--

/* Points/Rewards Module V1.60 bof*/

function clearText(thefield){

if (thefield.defaultValue==thefield.value)

thefield.value = ""

}

function validate(field) {

var valid = "0123456789.,"

var ok = "yes";

var temp;

for (var i=0; i<field.value.length; i++) {

temp = "" + field.value.substring(i, i+1);

if (valid.indexOf(temp) == "-1") ok = "no";

}

if (ok == "no") {

alert("<?php echo REDEEM_SYSTEM_JS_ERROR; ?>");

field.focus();

field.select();

}

}

var submitter = null;

function submitFunction() {

submitter = 1;

}

/* Points/Rewards Module V1.60 eof*/

var selected;

 

function selectRowEffect(object, buttonSelect) {

if (!selected) {

if (document.getElementById) {

selected = document.getElementById('defaultSelected');

} else {

selected = document.all['defaultSelected'];

}

}

 

if (selected) selected.className = 'moduleRow';

object.className = 'moduleRowSelected';

selected = object;

 

// one button is not an array

if (document.checkout_payment.payment[0]) {

document.checkout_payment.payment[buttonSelect].checked=true;

} else {

document.checkout_payment.payment.checked=true;

}

}

 

function rowOverEffect(object) {

if (object.className == 'moduleRow') object.className = 'moduleRowOver';

}

 

function rowOutEffect(object) {

if (object.className == 'moduleRowOver') object.className = 'moduleRow';

}

//--></script>

<?php echo $payment_modules->javascript_validation();

?>

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

 

<!-- body //-->

<table border="0" width="100%" cellspacing="3" cellpadding="3">

<tr>

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

</table></td>

<!-- body_text //-->

<td width="100%" valign="top"><?php echo tep_draw_form('checkout_payment', tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'), 'post', 'onsubmit="return check_form();"'); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

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

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

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<?php

if (isset($HTTP_GET_VARS['payment_error']) && is_object(${$HTTP_GET_VARS['payment_error']}) && ($error = ${$HTTP_GET_VARS['payment_error']}->get_error())) {

?>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="main"><b><?php echo tep_output_string_protected($error['title']); ?></b></td>

</tr>

</table></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBoxNotice">

<tr class="infoBoxNoticeContents">

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main" width="100%" valign="top"><?php echo tep_output_string_protected($error['error']); ?></td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<?php

}

?>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="main"><b><?php echo TABLE_HEADING_BILLING_ADDRESS; ?></b></td>

</tr>

</table></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents">

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main" width="50%" valign="top"><?php echo TEXT_SELECTED_BILLING_DESTINATION; ?><br><br><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL') . '">' . tep_image_button('button_change_address.gif', IMAGE_BUTTON_CHANGE_ADDRESS) . '</a>'; ?></td>

<td align="right" width="50%" valign="top"><table border="0" cellspacing="0" cellpadding="2">

<tr>

<td class="main" align="center" valign="top"><b><?php echo TITLE_BILLING_ADDRESS; ?></b><br><?php echo tep_image(DIR_WS_IMAGES . 'arrow_south_east.gif'); ?></td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main" valign="top"><?php echo tep_address_label($customer_id, $billto, true, ' ', '<br>'); ?></td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="main"><b><?php echo TABLE_HEADING_PAYMENT_METHOD; ?></b></td>

</tr>

</table></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents">

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<?php

$selection = $payment_modules->selection();

 

if (sizeof($selection) > 1) {

?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main" width="50%" valign="top"><?php echo TEXT_SELECT_PAYMENT_METHOD; ?></td>

<td class="main" width="50%" valign="top" align="right"><b><?php echo TITLE_PLEASE_SELECT; ?></b><br><?php echo tep_image(DIR_WS_IMAGES . 'arrow_east_south.gif'); ?></td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<?php

} else {

?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main" width="100%" colspan="2"><?php echo TEXT_ENTER_PAYMENT_INFORMATION; ?></td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<?php

}

 

$radio_buttons = 0;

for ($i=0, $n=sizeof($selection); $i<$n; $i++) {

?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">

<?php

if ( ($selection[$i]['id'] == $payment) || ($n == 1) ) {

echo ' <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";

} else {

echo ' <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";

}

?>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main" colspan="3"><b><?php echo $selection[$i]['module']; ?></b></td>

<td class="main" align="right">

<?php

if (sizeof($selection) > 1) {

echo tep_draw_radio_field('payment', $selection[$i]['id']);

} else {

echo tep_draw_hidden_field('payment', $selection[$i]['id']);

}

?>

</td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<?php

if (isset($selection[$i]['error'])) {

?>

<tr>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main" colspan="4"><?php echo $selection[$i]['error']; ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<?php

} elseif (isset($selection[$i]['fields']) && is_array($selection[$i]['fields'])) {

?>

<tr>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td colspan="4"><table border="0" cellspacing="0" cellpadding="2">

<?php

for ($j=0, $n2=sizeof($selection[$i]['fields']); $j<$n2; $j++) {

?>

<tr>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main"><?php echo $selection[$i]['fields'][$j]['title']; ?></td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main"><?php echo $selection[$i]['fields'][$j]['field']; ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<?php

}

?>

</table></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<?php

}

?>

</table></td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<?php

$radio_buttons++;

}

?>

</table></td>

</tr>

</table></td>

</tr>

<!-- Points/Rewards Module V1.60 Redeemption box bof -->

<?php

 

if ((USE_REDEEM_SYSTEM == 'true') && ($customer_shopping_points = tep_get_shopping_points()) && $customer_shopping_points > -1){

if ((get_redemption_rules($order) == true) && (get_points_rules_discounted($order) == true)){

if ($customer_shopping_points >= POINTS_LIMIT_VALUE){

if ((POINTS_MIN_AMOUNT == '') || ($cart->show_total() >= POINTS_MIN_AMOUNT) ){

?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="main"><b><?php echo TABLE_HEADING_REDEEM_SYSTEM; ?></b></td>

</tr>

</table></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents">

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main" width="100%" colspan="3"><?php echo TEXT_REDEEM_SYSTEM_START . number_format($customer_shopping_points) . TEXT_REDEEM_SYSTEM_MIDDLE . $currencies->format(tep_calc_shopping_pvalue($customer_shopping_points)) . ''; ?></td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<?php

$max_points = 0;

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

if (POINTS_LIMIT_EXACT == 'false'){

?>

<td class="main" width="100%" colspan="3"><?php printf(TEXT_REDEEM_SYSTEM_TOTAL, $currencies->format($order->info['total'])); ?></td>

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<?php

}

?>

<?php

if (POINTS_LIMIT_EXACT == 'true' && $customer_shopping_points >= POINTS_EXACT_VALUE){

if(tep_session_is_registered('customer_shopping_points_spending')) tep_session_unregister('customer_shopping_points_spending');

?>

<tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onClick="submitFunction()">

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main"><?php echo TEXT_REDEEM_SYSTEM_SPENDING_EXACT; ?></td>

<td class="main" align="right"><?php echo tep_draw_checkbox_field('customer_shopping_points_spending', $customer_shopping_points_spending); ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

<?php

} else {

?>

<tr onClick="submitFunction()">

<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main" ><?php echo TEXT_REDEEM_SYSTEM_SPENDING . '  ' .tep_draw_input_field('customer_shopping_points_spending', $customer_shopping_points_spending , 'onBlur="validate(this)" onFocus="clearText(this)" maxlength="20" style="width:70px"'); ?><br><?php printf(TEXT_REDEEM_SYSTEM_SPENDING_ALL, number_format($max_points)); ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

</table></td>

</tr>

<?php

}

?>

</table></td>

</tr>

</table></td>

</tr>

<?php

}

}

}

}

?>

<!-- Points/Rewards Module V1.60 Redeemption box eof -->

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="main"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>

</tr>

</table></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents">

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td><?php echo tep_draw_textarea_field('comments', 'soft', '60', '5'); ?></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents">

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main"><b><?php echo TITLE_CONTINUE_CHECKOUT_PROCEDURE . '</b><br>' . TEXT_CONTINUE_CHECKOUT_PROCEDURE; ?></td>

<td class="main" align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td width="50%" align="right"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>

<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>

</tr>

</table></td>

<td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>

<td><?php echo tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif'); ?></td>

<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>

</tr>

</table></td>

<td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>

<td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>

<td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>

</tr>

</table></td>

</tr>

<tr>

<td align="center" width="25%" class="checkoutBarFrom"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '" class="checkoutBarFrom">' . CHECKOUT_BAR_DELIVERY . '</a>'; ?></td>

<td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_PAYMENT; ?></td>

<td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td>

<td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_FINISHED; ?></td>

</tr>

</table></td>

</tr>

</table></form></td>

<!-- body_text_eof //-->

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- right_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>

<!-- right_navigation_eof //-->

</table></td>

</tr>

</table>

<!-- body_eof //-->

 

<!-- footer //-->

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

<br>

</body>

</html>

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Edited by RMStuning
Link to comment
Share on other sites

Even when I typed this it doesnt help... I am a newbie as you may already know:)

 

// if customer is using points to pay

if ($customer_shopping_points_spending > 0) {

 

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

tep_redirect(tep_href_link(FILENAME_CHECKOUT_PROCESS));

}

Edited by RMStuning
Link to comment
Share on other sites

Everything is possible: catalog/includes/functions/redemptions.php
 function points_selection() {
  global $cart, $currencies, $order;

  if (($customer_shopping_points = tep_get_shopping_points()) && $customer_shopping_points > 0){
 if (tep_session_is_registered('customer_shopping_points_spending')) tep_session_unregister('customer_shopping_points_spending');
 if ((get_redemption_rules($order) == true) && (get_points_rules_discounted($order) == true)){
   if ($customer_shopping_points >= POINTS_LIMIT_VALUE){
	 if ((POINTS_MIN_AMOUNT == '') || ($cart->show_total() >= POINTS_MIN_AMOUNT) ){

.... some lines left out

	 } else {
		echo 'you need minimum 20 USD in your cart to use your points, please see FAQ for more info';
	 }

.....

 

Hi texmaxx, thank you for that, but please can you give exact code, without any lines left out:), as I am 0 in php, also is it possible to instead of 20 USD make it to read from database, not to edit it every time, minimum order amount changes

Link to comment
Share on other sites

please can you give exact code
 function points_selection() {
  global $cart, $currencies, $order;

  if (($customer_shopping_points = tep_get_shopping_points()) && $customer_shopping_points > 0){
	   if (tep_session_is_registered('customer_shopping_points_spending')) tep_session_unregister('customer_shopping_points_spending');
 if ((get_redemption_rules($order) == true) && (get_points_rules_discounted($order) == true)){
   if ($customer_shopping_points >= POINTS_LIMIT_VALUE){
	 if ((POINTS_MIN_AMOUNT == '') || ($cart->show_total() >= POINTS_MIN_AMOUNT) ){
		 $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;
		 if ($order->info['total'] > tep_calc_shopping_pvalue($max_points)) {
			   $note = '<br /><small>' . TEXT_REDEEM_SYSTEM_NOTE .'</small>';
		 }
		 $customer_shopping_points_spending = $max_points;
?>
			<tr>
	  <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	</tr>
	<tr>
	  <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		<tr>
		  <td class="main"><b><?php echo TABLE_HEADING_REDEEM_SYSTEM; ?></b></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td class="main"><?php printf(TEXT_REDEEM_SYSTEM_START, $currencies->format(tep_calc_shopping_pvalue($customer_shopping_points)), $currencies->format($order->info['total']). $note); ?></td>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		 </tr>
		  <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)">
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td class="main"><?php printf(TEXT_REDEEM_SYSTEM_SPENDING, number_format($max_points,POINTS_DECIMAL_PLACES), $currencies->format(tep_calc_shopping_pvalue($max_points))); ?></td>
			<td class="main" align="right"><?php echo tep_draw_checkbox_field('customer_shopping_points_spending', $customer_shopping_points_spending,'','onclick="submitFunction()"'); ?></td>
			<td width="25"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		 </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
<?php
	 } else {
?>
			<tr>
	  <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	</tr>
	<tr>
	  <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		<tr>
		  <td class="main"><b><?php echo TABLE_HEADING_REDEEM_SYSTEM; ?></b></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td class="main"><?php echo 'You need minimum ' . POINTS_MIN_AMOUNT . ' USD in your cart to use your points, please see FAQ for more info'; ?></td>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		 </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
<?php
	 }
   }
 }
  }
}

Link to comment
Share on other sites

Hi texmaxx, thanks a lot for your help, but unfortunaly I was not able to use it

I do not know why, but I used installer.php to upgarde from 1.6 to 2.0 to preserve my database info, and now I do not see use points module on checkout_payment.php, however if use referal system is on, its box is visible, but still customer is not able to to use points. I am sure the code is correct(re-checked 3 times).

 

I tried SQL clean install, it works, but I lose all data, and insert it manually is almost impossible.

any ideas what to do with database or code to see it on payment page?

Link to comment
Share on other sites

I spent hours trying to get the new code to work .. dumping old database values and rewriting the sql file to. So far I have ended up going back to original code on catalog side and am trying to get the new files on admin side to work.

 

If you already have the Referral Mod installed this could be a problem. You now have 2 systems controlling referral id's. Now they are separate systems .. but it is confusing. If I already have my referral mod set to accept referral id's on account creation ... I get another referral input box from the Points / Rewards module showing again at checkout time. This seems redundant and will confuse customers .. if you have both mods installed.

 

The referral v1.1 mod uses this code for the referral_id etc (these are just parts):

 

$referral_id = tep_db_prepare_input($_POST['referral_id']);

 

<?php if (REFERRAL_ID_METHOD == 'user') { ?>

<tr>

<td class="main"><?php echo ENTRY_REFERRAL_ID; ?></td>

<td class="main"><?php echo tep_draw_password_field('referral_id', '', 'maxlength="14"') . ' ' . (tep_not_null(ENTRY_REFERRAL_ID_TEXT) ? '<span class="inputRequirement">' . ENTRY_REFERRAL_ID_TEXT . '</span>' : ''); ?></td>

</tr>

 

The Points / Rewards v2.0 is using a different code for referral_id entry

 

<tr>

<td class="main"><?php echo TEXT_REFERRAL_REFERRED; ?></td>

<td class="main"><?php echo tep_draw_input_field('customer_referred', $customer_referred); ?></td>

</tr>

 

Now shouldn't the Points / Rewards v2.0 module be using the same field code for referral id's as the original Referral v1.1 mod? ... to avoid conflicts etc ... Does the code need to be rewritten ? Maybe I`m missing something here.

 

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

 

 

To test install I had to take out these references in the configuration table .. as they were not being accessed in the new code:

 

REMOVED FOR UPDATE:

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 ('', 'Can Customers use Reward Points toward Order Shipping Fees', 'POINT_WITHOUT_SHIPPING', 'false', 'Can Customers use Reward Points toward Order Shipping Fees?', '22', '100', NULL, '2005-06-20 18:43:57', NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),');

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 ('', 'Enable Product Restrictions', 'REDEMPTION_RESTRICTION', 'false', 'Enable the Product Restrictions ?', '22', '8', '', now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),');

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 ('', 'Limit Reward Point Redemptions to Exact Amount', 'POINTS_LIMIT_EXACT', 'false', 'Do you want to Limit Reward Point Redemptions to an Exact Amount ? [ This will disable customers ability to choose a Reward Points amount to spend ]', '22', '15', '', now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),');

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 ('', 'If Points Exact Amount enabled, set the Exact Amount', 'POINTS_EXACT_VALUE', '100', 'If you enabled the Limit Reward Point Redemptions to an Exact Amount ... set the Exact Amount of Reward Points to be Redeemed.<br>Only this amount of Reward Points will be allowed to be Redeemed. ', '22', '16', '', now(), NULL, NULL);

 

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

 

I rewrote my sql file so ONLY THE FOLLOWING configuration fields were needed: (even at that ... one was a duplicate from the referral mod)

 

INSERT INTO `configuration_group` (`configuration_group_id`, `configuration_group_title`, `configuration_group_description`, `sort_order`, `visible`) VALUES ('22', 'Points / Rewards v1.50', 'Points / Rewards System Configuration', '22', '1');

 

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 ('', 'Enable Reward Points System', 'USE_POINTS_SYSTEM', 'true', 'Enable the Points Reward System for customers to earn points for Orders Placed ?', '22', '1', '', now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),');

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 ('', 'Enable Reward Points Redemption System', 'USE_REDEEM_SYSTEM', 'true', 'Enable customers to Redeem Reward Points at Checkout Procedure ?', '22', '2', '', now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),');

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 ('', 'Points per $1.00 Purchase', 'POINTS_PER_AMOUNT_PURCHASE', '1', 'Number of Reward Points awarded for each $1.00 spent on Store Purchases.<br>[ Currency is defined according to admin Default Currency ]', '22', '3', '', now(), NULL, NULL);

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 ('', 'Dollar Value per Redeem Point', 'REDEEM_POINT_VALUE', '0.1', 'The set value of one Reward Point.<br>[ Reward Point value is currency defined according to admin Default Currency. ]', '22', '4', '', now(), NULL, NULL);

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 ('', 'Reward Points Decimal Places', 'POINTS_DECIMAL_PLACES', '0', 'Pad the Reward Points Value this amount of Decimal Places.', '22', '50', now(), now(), NULL, NULL);

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 ('', 'Auto Credit Pending Points', 'POINTS_AUTO_ON', '', 'Enable Auto Credit Pending Points and set a days period before the reward points will actually added to customers account.<br>For same day set to 0(zero).<br>To disable this option leave empty.', '22', '60', now(), now(), NULL, NULL);

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 ('', 'Auto Expire Reward Points', 'POINTS_AUTO_EXPIRES', '12', 'Set a month period before Reward Points will Auto Expire.<br>To disable this option leave empty.', '22', '70', now(), now(), NULL, NULL);

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 ('', 'Reward Points Expire Auto Reminder', 'POINTS_EXPIRES_REMIND', '30', 'Enable Points Expires Auto Reminder and set the numbers of days prior points expiration for the script to run.(Auto Expires Points must be enabled)<br>To disable this option leave empty.', '22', '8', now(), now(), NULL, NULL);

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 ('', 'Award Points on Shipping Fees', 'USE_POINTS_FOR_SHIPPING', 'false', 'Award customers Reward Points on an Orders Shipping Fees ?', '22', '5', '', now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),');

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 ('', 'Award Points on Order Tax', 'USE_POINTS_FOR_TAX', 'false', 'Award customers Reward Points on an Orders Tax ?', '22', '6', '', now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),');

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 ('', 'Award Points for Specials', 'USE_POINTS_FOR_SPECIALS', 'true', 'Allow customers to earn Reward Points for items already Discounted [ ie. items on Special ]?<br>When set to [ False ] ... Reward Points are awarded only on items with Full Price', '22', '7', '', now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),');

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 ('', 'Award Points on Orders except the Reward Points used for Payment', 'USE_POINTS_FOR_REDEEMED', 'true', 'When order made with Reward Points. Allow customers to earn Reward Points for the amount spent ... other than any Reward Points used toward the Order?<br>When set to [ false ] ... customers will NOT be awarded any Reward Points at all.', '22', '21', '', now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),');

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 ('', 'Award points for Products Reviews', 'USE_POINTS_FOR_REVIEWS', '50', 'If you want to award points when customers add Product Review, set the points amount to be given or leave empty to disable this option', '22', '13', now(), now(), NULL, NULL);

// TOOK OUT WAS CONFLICTING /// 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 ('', 'Enable and set points for Referral System', 'USE_REFERRAL_SYSTEM', '100', 'Do you want to Enable the Referral System and award points when customers refer someone?<br>Set the amount of points to be given or leave empty to disable this option.', '22', '14', now(), now(), NULL, NULL);

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 ('', 'If Restriction enabled set Model Allowed', 'RESTRICTION_MODEL', 'DVD-FRAN', 'Restrict Products by model.<br>If Restrictions enabled set Model Allowed.', '22', '9', '', now(), NULL, NULL);

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 ('', 'Or set Product ID Allowed', 'RESTRICTION_PID', '15', 'Restrict Products Allowed by Product ID.<br>If Restriction enabled set a comma separated list of Products ID Allowed.<br>Leave blank if product restriction set to Model.', '22', '10', '', now(), NULL, NULL);

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 ('', 'Or set Category ID Allowed', 'RESTRICTION_PATH', '', 'Restrict Products Allowed by Category ID.<br>If Restriction enabled set a comma separated list of Cpaths Allowed.<br>Leave blank if product restriction set to Model.', '22', '11', '', now(), NULL, NULL);

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 ('', 'Enable Products Price Restriction', 'REDEMPTION_DISCOUNTED', 'false', 'When customers Redeem Reward Points ... they may not be used toward items already Discounted ?<br>Redemptions enabled only on items with Full Price', '22', '12', '', now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),');

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 ('', 'Reward Points Total before allowed Redemption', 'POINTS_LIMIT_VALUE', '0', 'Set the number of Reward Points needed before they can be Redeemed. Set to 0 for no limit.', '22', '13', '', now(), NULL, NULL);

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 ('', 'Maximum Reward Points allowed per Order', 'POINTS_MAX_VALUE', '1000', 'Set the Maximum Number of Reward Points customers can Redeem Per Order. To avoid points maximum limit, set to high No. ', '22', '14', '', now(), NULL, NULL);

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 ('', 'Restrict Points Redemption For Minimum Purchase Amount', 'POINTS_MIN_AMOUNT', '', 'Enter the Minimum Purchase Amount [ ie. total value in cart ] required before Reward Points Redemption is enabled.<br>Leave empty for no Restriction.', '22', '18', '', now(), NULL, NULL);

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 ('', 'New signup customers Welcome Points Amount', 'NEW_SIGNUP_POINT_AMOUNT', '0', 'Set the Welcome Reward Points amount to be auto-credited for New Signup Customers. Set to 0 if you wish to disable auto-credited Reward Points.', '22', '17', '', now(), NULL, NULL);

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 ('', 'Maximum Number of Reward Point Records to Display', 'MAX_DISPLAY_POINTS_RECORD', '20', 'Set the Maximum Number of Reward Point Records to display per page on the my_points.php page.', '22', '18', '', now(), NULL, NULL);

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 ('', 'Display Reward Points Information on Product Info Page', 'DISPLAY_POINTS_INFO', 'true', 'Do you want to show Reward Points Information on the Product Info Page ?', '22', '19', '', now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),');

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 ('', 'Keep Records of Reward Points Redeemed', 'DISPLAY_POINTS_REDEEMED', 'false', 'Do you want to keep records of all Reward Points Redeemed ?', '22', '20', '', now(), NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),');

 

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 ('', 'Sort Order', 'MODULE_ORDER_TOTAL_REDEMPTIONS_SORT_ORDER', '4', 'Sort order of display.', '6', '2', now(), now(), NULL, NULL);

 

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

 

Also there is a configuration field that is duplicated.

 

// HAD TO TAKE OUT // ALREADY WAS A FIELD FOR THIS FROM REFERRALS MOD

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 ('', 'Enable and set points for Referral System', 'USE_REFERRAL_SYSTEM', '100', 'Do you want to Enable the Referral System and award Reward Points when customers refer someone?<br>Set the amount of points to be given or leave empty to disable this option.', '22', '140', now(), now(), NULL, NULL);

 

 

The Referral v1.1-2.2ms2 mod already has a field for true or false selection and is used by code in the create _account.php page .. as well as many other places.

 

configuration_group_id, sort_order, set_function) VALUES ('Enable Referral System', 'USE_REFERRAL_SYSTEM', 'false',

'Whether the referral system is enabled for use.', @optID, '50', 'tep_cfg_select_option(array(\'true\', \'false\'),');

 

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

 

I am also getting this error in the new customers_points_referral.php file where you review Pending points.

 

Warning: reset(): Passed variable is not an array or object in C:\sokkit\site\catalog\admin\includes\classes\object_info.php on line 17

 

Warning: Variable passed to each() is not an array or object in C:\sokkit\site\catalog\admin\includes\classes\object_info.php on line 18

 

 

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

 

Anyway ... I think the Reward Points v2.0 mod needs a lot more work and testing before it will work somewhat smoothly. It does have some nice features added ... but they are just not working ... at least not for me .. lol

 

I will continue to dabble away and see what I can do.

Edited by insomniac2
Link to comment
Share on other sites

For this section I was thinking about changing the USE_REDEEM_SYSTEM parts to USE_POINTS_REDEEM_SYSTEM so as not to conflict with the Referralv1.1 mod

 

Also there is a configuration field that is duplicated.

 

// HAD TO TAKE OUT // ALREADY WAS A FIELD FOR THIS FROM REFERRALS MOD

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 ('', 'Enable and set points for Referral System', 'USE_REFERRAL_SYSTEM', '100', 'Do you want to Enable the Referral System and award Reward Points when customers refer someone?<br>Set the amount of points to be given or leave empty to disable this option.', '22', '140', now(), now(), NULL, NULL);

 

 

The Referral v1.1-2.2ms2 mod already has a field for true or false selection and is used by code in the create _account.php page .. as well as many other places.

 

configuration_group_id, sort_order, set_function) VALUES ('Enable Referral System', 'USE_REFERRAL_SYSTEM', 'false',

'Whether the referral system is enabled for use.', @optID, '50', 'tep_cfg_select_option(array(\'true\', \'false\'),');

 

Can I rename the Points / Rewards one to 'USE_POINTS_REFERRAL_SYSTEM' instead of 'USE_REFERRAL_SYSTEM' already taken. Will this screw up the Points / Reward mod if I do that? I only see reference to the code twice in the new Points / Reward v2.0 module.

 

For example the code below would have to be changed for checkout_payment.php :

 

<!-- Points/Rewards Module V2.00 Redeemption box bof -->

<?php

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

echo points_selection();

if (tep_not_null(USE_REFERRAL_SYSTEM)) {

echo referral_input();

}

}

?>

<!-- Points/Rewards Module V2.00 Redeemption box eof -->

 

AS WELL AS code in checkout_process :

 

#### Points/Rewards Module V2.00 balance customer points BOF ####

if ((USE_POINTS_SYSTEM == 'true') && (USE_POINTS_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 ####

 

How would this effect the Points / Reward system?

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.
Note: Your post will require moderator approval before it will be visible.

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