Jump to content
deep-silver

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

Recommended Posts

Hi everybody!

 

I have the problem:

When i click the link to /catalog/admin/customers_points.php or /catalog/admin/customers_points_pending.php, i get redirected to /catalog/admin/forbiden.php - as if i werent logged in.

How can i fix it? or maybe just get rid of the part of the code where the system checks if it should redirect.

Can you help me?

 

 

Sorry for my bad english, hope you understand it :)

Share this post


Link to post
Share on other sites

Ok I had this module working flawlessly until today when i tried to set up a Pay Pal IPN module which now i have decided not to use...

 

In the process I chenged some of the sort orders of the order total modules...

 

 

I have attempted to change them back with no avail...

 

 

It seems points and rewards is not being calculated against the total of order any longer...

 

and the total amount redeemed is not being shown on the checkout confirmation pages

 

I have read through this thread and have come to the conclusion that the sort order must be correct for the module to function

 

so i have tried tinkering around with mine to get this back to its working state with no success

 

Here is my sort order

 

 

Points Redeemptions 4

Shipping 3

Sub-Total 1

Tax 2

Total 5

 

 

I have checked all my modified files that did work and point rewards queries and functions all appear fine...

 

What am i doing wrong???

 

Please help this is a LIVE shop having problems..

 

Thanks

INDI

Share this post


Link to post
Share on other sites

FIX FOR THOSE WHO CANT SEEM TO GET

 

THE DEDUCTIONS TO SHOW UP ON CHECKOUT CONFIRMATIONS WHEN CHECKING OUT OR

AFTER INSTALLING PAY PAL IPN.... and then removing it... This may work for othery similar symptoms as well THIS is what finally after 8 hours worked for me

 

 

 

For some reason no matter what I did in regards to display sort order changes ,

the module would not show up correctly or calculate the rewards and show them on the confirmation pages..

 

 

What fixed this...

 

I followed the sort order directions in this thread which resulted in NO CHANGES

 

what did however work is the reset of the module....

 

Go to configurations.... then points rewards module

 

find the following option

 

 

Enable Points system

Enable Redemptions system

 

 

Click on each and set to FALSE.....

 

Update them both

 

Go back to each

 

Set Both to TRUE

 

Update both

 

 

Now check your checkout pages... if your sort order is somewhat correct and you reset the module it appears and calculates once again....

 

Interesting....... but this is what worked for me....

 

It only took me 8 damn hours, and countless lost order, to figure it out

Share this post


Link to post
Share on other sites

## POINTS AND REWARDS MODULE V2.00 ##

Writeen by DEEP SILVER ACCESSORY Contributed to the osCommerce Project under the GNU General Public License.

To be used with osCommerce-2.2ms2-051113

 

Version 2.00 Dated: 2006/JULY/07

http://www.deep-silver.com

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

1.Added Admin features.

Added Referral points to the system .

Admin can now award referral points to customers.

When referred friend place an order, during the checkout procces on the same page that you select a payment

method there will be a box to enter a Referral code. Referral code is the Referral registered email address.

This feature can be turn on/off via admin.

 

*.Added Review points to the system .

Admin can now award Review points to customers.

All points for review are in pending untill admin confirm them(unless using auto confirm)

 

*.Enable/Disable Auto Credit Pending Points(in days)

Admin can now set the system to auto confirm pending points and auto update customers

account balance upon each success checout.(you can set it as cron job or call the script via admin/customers_points_pending.php)

Set a days period before the reward points will actually added to customers account.

 

*.Enable/Disable Auto Expire Points(in month)

Admin can now set points expire date, using a cron job the script will remove customers points and pending rows

after expire date..(you can set it as cron job or call the script via admin/customers_points_pending.php)

 

*.Enable/Disable Points Expires Auto Remainder(in days)

Admin can now set the numbers of days prior points expiration for the script to run.(Auto Expires Points must be enabled)

All customers where their points will expire in numbers of days from remainder will receive an email advice them to use

thier points balace before expire date.

 

*.Set Points Decimal Places.

Admin can now Pad the points value with amount of decimal places.

 

*.Sort Points.

Admin can now sort all type of points with all types of order status.

 

2.Updated the code in refer to catalog/checkout_payment.php

The checkbox will contain only the maximum points redeemptions allowed.

When customer choose to use his/her points balance, he/she will be using all points available/allowed.

 

3.fixed a tiny bug in catalog/my_points.php

where table layout brake when refershing the same page.

(amazing how nobody reported it before i have to find all bugs)

 

4.Made change to table structure for table 'customers_points_pending'

To avoid scripts error while using both orders status and points status as well as points comment and order comment.

The table is now holding points type.

 

5.Combined limit points before Redemptions and limit points to be use per order.

doing this saved script and one database query. so now in order to set points redemption to

exact amount you must set both options above to same amount.

 

5.Combined all 3 Restriction options into a loop.

No more on/off to disable it you must leave it empty. else Restriction is on what ever come first.

1.Model 2.Products ID, 3. Categories Cpaths.

 

6.Installer.php can now handle upgrade from V1.60 to V.200.

the install check for previous module in database and if found it will show update screen.

if version 2.00 it will show the Uninstall screen. else will show wellcome screen.(because the script is actually on my site and the installer just calling it,

on some server with havey security it will not work)

 

Made some code cleaning and few changes here and there that i can even remember, therefore i advice all

of you who upgrading from V1.60 to replace all this module files.

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

Hope that this unswer all you guys requests.

 

DEEP SILVER ACCESSORY.

Yamagata City, Japan

Edited by deep-silver

Remember - - - "STRESSED" spelled backwards "DESSERTS"

Share this post


Link to post
Share on other sites

I got this error after i installed v2.00

 

1054 - Unknown column 'status' in 'where clause'

select count(*) as number_of_points_pending from customers_points_pending where status = 1 and customer_id = '119'

 

in admin/customers_points.php

 

and

 

1054 - Unknown column 'cpp.status' in 'where clause'

select count(*) as total from orders o , orders_total ot , orders_status s , customers_points_pending cpp where ot.class = 'ot_total' and cpp.status = '1' and cpp.orders_id = o.orders_id and o.orders_id = ot.orders_id and o.orders_status = s.orders_status_id and s.language_id = '1'

[TEP STOP]

 

in admin/customers_points_pending.php

 

.For your information.I install using installer.php located in the package.

 

Need help as soon as possible.

Share this post


Link to post
Share on other sites
I got this error after i installed v2.00

 

1054 - Unknown column 'status' in 'where clause'

 

 

in admin/customers_points_pending.php

 

.For your information.I install using installer.php located in the package.

 

Need help as soon as possible.

YOU MUST REPLACE admin/customers_points.php AND admin/customers_points_pending.php

with the new ones in the zip!

Edited by deep-silver

Remember - - - "STRESSED" spelled backwards "DESSERTS"

Share this post


Link to post
Share on other sites
YOU MUST REPLACE admin/customers_points.php AND admin/customers_points_pending.php

with the new ones in the zip!

 

above problems solved.

 

another coming in :P

 

in checkout_payment.php

 

Fatal error: Call to undefined function: points_selection() in /home/rezolles/public_html/checkout_payment.php on line 327

 

i think..in admin area...maybe dont have any problems yet...but i dont know...have to test it out.

 

Hope to hear from you soon.

 

**i follow instruction from "upgrade instructions" and COPIED all files located in NEW FILES but have edited some "(application_top/filenames and database_tables).

 

Please PM me if you need to see those codes.

 

Thanks

Share this post


Link to post
Share on other sites
above problems solved.

 

another coming in :P

 

in checkout_payment.php

 

Fatal error: Call to undefined function: points_selection() in /home/rezolles/public_html/checkout_payment.php on line 327

 

i think..in admin area...maybe dont have any problems yet...but i dont know...have to test it out.

 

Hope to hear from you soon.

 

**i follow instruction from "upgrade instructions" and COPIED all files located in NEW FILES but have edited some "(application_top/filenames and database_tables).

 

Please PM me if you need to see those codes.

 

Thanks

DID you read the update.txt as i said

replace all files.

you did not replace catalog/includes/functions/redemptions.php


Remember - - - "STRESSED" spelled backwards "DESSERTS"

Share this post


Link to post
Share on other sites

Hello hello

 

 

First of all, thanks a lot for this contrib, this is absolutly fab and your step by step install instructions are just great !!!

 

I have 2 basic questions, as i can't find where it is at the mo' (i know i knew, but can't find it anymore ;))

 

I want the point to be just "plain", ie 546 points, not 546.00 points

how do i get rid of this (either for "real" or just not showing :))

 

Secondly when after remdeemed points the total order equals ZERO, then i click confirm and i am still redirected to PAYPAL...

 

I would like to be redirected then to either checkout_process or checkout_success (i do not know what is best, i guess success otherwise it'd check if payment has been received ?)

 

I thought it did it automaticaly but if fact no... (or maybe it's because i've tried to install Paypal IPN and and uninstalled it afterwards ?)

 

thanks in advance for your precious help,

 

Steph

Share this post


Link to post
Share on other sites

I haven't had a chance to download this updated version and test it but the functions stated really take it on to the next level...

 

thanks deep-silver


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

 

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

 

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

 

CHOOCH

Share this post


Link to post
Share on other sites

very cool new features!!!!

 

however, i've run into this problem:

 

on checkout_payment.php: if i have points, the points redemption box is not shown anymore. instead, the friend referral box is there.

 

how can i use my old redemption box (which was customized to fit my shop) IF the customers points are greater than 0 and HIDE the friend referral box?

 

also, the checkout_payment page is now a bit jumbled. is it possible to move the friend referral box to create_account.php instead and remove it from checkout_payment?

 

 

these new features are great, thanks for releasing it deep-silver!

Share this post


Link to post
Share on other sites

also, i notice when i confirm & delete points from admin/orders.php the customer does not receive a discount points update via email anymore

Share this post


Link to post
Share on other sites
also, i notice when i confirm & delete points from admin/orders.php the customer does not receive a discount points update via email anymore

the box to use the points have moved to catalog/includes/functions/redemptions.php in order to make it simple for new users.

just replace the html part to fit your need.

If you dont want the reffral box at checkout payment page.

amaned this code out of catalog/checkout_payment.php

	if (tep_not_null(USE_REFERRAL_SYSTEM)) {
  echo referral_input();
}

so it will lokk like this

<!-- Points/Rewards Module V2.00 Redeemption box bof -->
<?php
 if ((USE_POINTS_SYSTEM == 'true') && (USE_REDEEM_SYSTEM == 'true')) {
echo points_selection();
/*  if (tep_not_null(USE_REFERRAL_SYSTEM)) {
  echo referral_input();
}
*/	
 }
?>
<!-- Points/Rewards Module V2.00 Redeemption box eof -->

I disabled the email sent out when using admin/orders becuse this part of the code is a bit tricky

and some users get errors as well as 2 emails sent 2 customer the best way is to comabin order confirm and points confirm email. i will have to work on it.


Remember - - - "STRESSED" spelled backwards "DESSERTS"

Share this post


Link to post
Share on other sites
Hello hello

First of all, thanks a lot for this contrib, this is absolutly fab and your step by step install instructions are just great !!!

 

I have 2 basic questions, as i can't find where it is at the mo' (i know i knew, but can't find it anymore ;))

 

I want the point to be just "plain", ie 546 points, not 546.00 points

how do i get rid of this (either for "real" or just not showing :))

 

Secondly when after remdeemed points the total order equals ZERO, then i click confirm and i am still redirected to PAYPAL...

 

I would like to be redirected then to either checkout_process or checkout_success (i do not know what is best, i guess success otherwise it'd check if payment has been received ?)

 

I thought it did it automaticaly but if fact no... (or maybe it's because i've tried to install Paypal IPN and and uninstalled it afterwards ?)

 

thanks in advance for your precious help,

 

Steph

in admin points module config page on the 5 from top

Points decimal place set it to zero.(you wont be able to give half point anything below zero is zero 0.5 = 0 and 1.9 =2)

i dont know about paypal you will need to check your coding

Edited by deep-silver

Remember - - - "STRESSED" spelled backwards "DESSERTS"

Share this post


Link to post
Share on other sites

weird! still doesn't show :(

 

here's my code:

<?php
 if ((USE_POINTS_SYSTEM == 'true') && (USE_REDEEM_SYSTEM == 'true')) {
echo points_selection();
/*  if (tep_not_null(USE_REFERRAL_SYSTEM)) {
  echo referral_input();
}
*/	
 }
?>

 

 

i also have checkout_shipping & checkout_payment combined into one (so my edits go on checkout_shipping instead)... could this have an effect on it messing up?

 

no errors show at all, just looks as though i have no points. but i have the bits for the shopping_cart.php box and it says i have a balance available for use

Share this post


Link to post
Share on other sites
weird! still doesn't show :(

 

here's my code:

<?php
 if ((USE_POINTS_SYSTEM == 'true') && (USE_REDEEM_SYSTEM == 'true')) {
echo points_selection();
/*  if (tep_not_null(USE_REFERRAL_SYSTEM)) {
  echo referral_input();
}
*/	
 }
?>

i also have checkout_shipping & checkout_payment combined into one (so my edits go on checkout_shipping instead)... could this have an effect on it messing up?

 

no errors show at all, just looks as though i have no points. but i have the bits for the shopping_cart.php box and it says i have a balance available for use

any products or price or points restriction on?

how much points do you see in your cart?


Remember - - - "STRESSED" spelled backwards "DESSERTS"

Share this post


Link to post
Share on other sites
in admin points module config page on the 5 from top

Points decimal place set it to zero.(you wont be able to give half point anything below zero is zero 0.5 = 0 and 1.9 =2)

i dont know about paypal you will need to check your coding

 

 

Sorry to be thick, but in the config page in the admin, i don't see anything related to the number of decimal...

5 from top is "set auto credit point" but i've read them all...

 

Did i miss something ? (i haven't installed yet the v2, i'm still on V1.6)

 

The thing is for order at zero, in the payment info page i'm still obliged to tick a mean of payment, and rewarding points are not "considered" as a mean apparently (as of course i can tick 2 boxes, paypal and redeemmed), but can't Untick one of the payment system...

 

Where should i look ? i thought since it's redeemed max are caculated against the order, when it states the max point = (make order =0), i haven't set any limit) , well i should be able to use redeemed as the ONLY mean of payment ?

 

My checkout_out payment page :

 

<?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 (c) 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;

 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 > 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) ){

?>

		<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,2) . 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 class="main" ><?php printf(TEXT_REDEEM_SYSTEM_SPENDING_ALL, number_format($max_points,2)); ?></td>

				<td class="main" align="right"><br><?php echo tep_draw_checkbox_field('customer_shopping_points_spending', $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'); ?>

 

Sorry for the bandwidth, and thanks for this great module all round too, hope you could help :)

 

Steph

Share this post


Link to post
Share on other sites

Further to my probleme of order total = 0 and being rederected towards of payment system (even if order covered COMPLETELY by redeemed points

 

Here is the payment page ine the CLASS directory ,

 

should go with the bit in CHECKOUT_CONFIRMATION :

 

// load the selected payment module
 require(DIR_WS_CLASSES . 'payment.php');
 $payment_modules = new payment($payment);

 require(DIR_WS_CLASSES . 'order.php');
 $order = new order;

 $payment_modules->update_status();

 

 

PAYMENT.PHP in DIR CLASSES :

 

 

// class methods
/* The following method is needed in the checkout_confirmation.php page
  due to a chicken and egg problem with the payment class and order class.
  The payment modules needs the order destination data for the dynamic status
  feature, and the order class needs the payment module title.
  The following method is a work-around to implementing the method in all
  payment modules available which would break the modules in the contributions
  section. This should be looked into again post 2.2.
*/   
function update_status() {
  if (is_array($this->modules)) {
	if (is_object($GLOBALS[$this->selected_module])) {
	  if (function_exists('method_exists')) {
		if (method_exists($GLOBALS[$this->selected_module], 'update_status')) {
		  $GLOBALS[$this->selected_module]->update_status();
		}
	  } else { // PHP3 compatibility
		@call_user_method('update_status', $GLOBALS[$this->selected_module]);
	  }
	}
  }
}

function javascript_validation() {
  $js = '';
  if (is_array($this->modules)) {
	$js = '<script language="javascript"><!-- ' . "\n" .
		  'function check_form() {' . "\n" .
		  '  var error = 0;' . "\n" .
		  '  var error_message = "' . JS_ERROR . '";' . "\n" .
		  '  var payment_value = null;' . "\n" .
		  '  if (document.checkout_payment.payment.length) {' . "\n" .
		  '	for (var i=0; i<document.checkout_payment.payment.length; i++) {' . "\n" .
		  '	  if (document.checkout_payment.payment[i].checked) {' . "\n" .
		  '		payment_value = document.checkout_payment.payment[i].value;' . "\n" .
		  '	  }' . "\n" .
		  '	}' . "\n" .
		  '  } else if (document.checkout_payment.payment.checked) {' . "\n" .
		  '	payment_value = document.checkout_payment.payment.value;' . "\n" .
		  '  } else if (document.checkout_payment.payment.value) {' . "\n" .
		  '	payment_value = document.checkout_payment.payment.value;' . "\n" .
		  '  }' . "\n\n";

	reset($this->modules);
	while (list(, $value) = each($this->modules)) {
	  $class = substr($value, 0, strrpos($value, '.'));
	  if ($GLOBALS[$class]->enabled) {
		$js .= $GLOBALS[$class]->javascript_validation();
	  }
	}

	$js .= "\n" . '  if (payment_value == null) {' . "\n" .
		   '	error_message = error_message + "' . JS_ERROR_NO_PAYMENT_MODULE_SELECTED . '";' . "\n" .
		   '	error = 1;' . "\n" .
		   '  }' . "\n\n" .



		   // Points/Rewards Module V1.60 BOF

		 //'  if (error == 1) {' . "\n" .

		   '  if (error == 1 && submitter != 1) {' . "\n" .

// Points/Rewards Module V1.60 EOF




			'	alert(error_message);' . "\n" .
		   '	return false;' . "\n" .
		   '  } else {' . "\n" .
		   '	return true;' . "\n" .
		   '  }' . "\n" .
		   '}' . "\n" .
		   '//--></script>' . "\n";
  }

  return $js;
}

 

Sorry again, just thought it might be usefull to have a look at the code :)

 

Steph

Edited by Steph Mu Bai

Share this post


Link to post
Share on other sites
any products or price or points restriction on?

how much points do you see in your cart?

$5.25 or 105 (i have my shopping cart infobox set to hide the "105" as many customers were confused by this number.)

 

it also shows my balance in admin when i search my email and on /my_points.php, however; i DID have to remove the sprintf from the output in catalog/my_points.php as for some reason - when i left that in it just shown the expiry date for the points, nothing else

 

 

and i have no price restrictions or anything like that. everything on that end is default.

Edited by eww

Share this post


Link to post
Share on other sites
$5.25 or 105 (i have my shopping cart infobox set to hide the "105" as many customers were confused by this number.)

 

it also shows my balance in admin when i search my email and on /my_points.php, however; i DID have to remove the sprintf from the output in catalog/my_points.php as for some reason - when i left that in it just shown the expiry date for the points, nothing else

and i have no price restrictions or anything like that. everything on that end is default.

you should check your coding its look like you have missed some parts of the new version.

the best thing to do is(if you have time)just go over the INSTALL.txt for new install and see if you find any diff in your code.

I really can't tell you how to do that since you have modified the original coding. all i can tell you is that its work fine on a core install of the latest oscommerce


Remember - - - "STRESSED" spelled backwards "DESSERTS"

Share this post


Link to post
Share on other sites

i've done that and upgrade install a few times and i can't find anything different.

one thing i did notice is when i ran the updgrade sql (manually, via phpmyadmin) is that many of the options went to group 0 / empty. so i had to go into phpmyadmin and change them all from 0 to 22.

 

can you take a look at my points/rewards configuration and see if i missed a table? i had to go back a few times and go over; as i missed some of them due to having " at the end of the query, so they didn't insert the first time around (produced an error and stopped installation after that line)

 

here it is:

Enable Points system	  true	   
Enable Redemptions system 	true 	Info 
Points per $store_currency purchase 	1 	Info 
Yen Redeem per point 	0.05 	Info 
Points Decimal Places 	0 	Info 
Auto Credit Pending Points 		Info 
Auto Expires Points 	3 	Info 
Points Expires Auto Remainder 	30 	Info 
Award points for shipping 	false 	Info 
Award points for Tax 	false 	Info 
Award points for Specials 	false 	Info 
Award points for order with redeemed points 	true 	Info 
Award points for Products Reviews 	50 	Info 
Enable and set points for Referral System 		Info 
Enable Products Model Restriction 	DVD-FRAN 	Info 
Enable Products ID Restriction 	15 	Info 
Enable Categories ID Restriction 		Info 
Enable Products Price Restriction 	false 	Info 
If you wish to limit points before Redemptions, set points limit 	0 	Info 
If you wish to limit points to be use per order, set points Max 	10000 	Info 
Restrict Points Redemption For Minimum Purchase Amount 		Info 
New signup customers Welcome Points amount 	0 	Info 
Maximum number of points records to display 	20 	Info 
Display Points information in Product info page 	false 	Info 
Keep Records of Redeemed Points 	true 	Info

 

also, the only thing i customized was the html of your amazing contribution :) i didn't want to screw myself for future upgrades and mangle the php aspect, but i took out my original code on checkout_payment/shipping to see if maybe the table structure changed and still no luck

Share this post


Link to post
Share on other sites
I could not find the "POINTS AND REWARDS MODULE" zip file on the site above. Can anyone tell me where I can download it?

 

Any help will be appreciatd.

TC

 

Try from here :rolleyes:

Share this post


Link to post
Share on other sites
i've done that and upgrade install a few times and i can't find anything different.

also, the only thing i customized was the html of your amazing contribution :) i didn't want to screw myself for future upgrades and mangle the php aspect, but i took out my original code on checkout_payment/shipping to see if maybe the table structure changed and still no luck

There was a bug in redemptions_update.sql file. this has been fixed as well as added the ability to set the expire date to customers who already has points.

When using the auto installer.php the script will verify the expire months while when using a manual update you will have to open the redemptions_update.sql and set the expire months statement before executing it.

 

All your statments look o.k. do you stiil don't see the redeemptions box at checkout?


Remember - - - "STRESSED" spelled backwards "DESSERTS"

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×