Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Credit Class/Gift Vouchers/Discount Coupons 5.10


Strider

Recommended Posts

Hi,

 

I'm getting the below error and I'm wondering if it's related to any code found in catalog/includes/add_ccgvdc_application_top.php.

 

We upgraded to MySQL 4.1.21-standard and php 5.0.4

 

Error at top of any product page (only product detail pages):

 

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/stitchpi/public_html/catalog/includes/functions/database.php on line 103

 

Suspect code from catalog/includes/add_ccgvdc_application_top.php:

 

////
// Create a Coupon Code. length may be between 1 and 16 Characters
// $salt needs some thought.

 function create_coupon_code($salt="secret", $length = SECURITY_CODE_LENGTH) {
$ccid = md5(uniqid("","salt"));
$ccid .= md5(uniqid("","salt"));
$ccid .= md5(uniqid("","salt"));
$ccid .= md5(uniqid("","salt"));
srand((double)microtime()*1000000); // seed the random number generator
$random_start = @rand(0, (128-$length));
$good_result = 0;
while ($good_result == 0) {
  $id1=substr($ccid, $random_start,$length);		
  $query = tep_db_query("select coupon_code from " . TABLE_COUPONS . " where coupon_code = '" . $id1 . "'");	
  if (tep_db_num_rows($query) == 0) $good_result = 1;
}
return $id1;
 }
////
// Update the Customers GV account
 function tep_gv_account_update($customer_id, $gv_id) {
$customer_gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
$coupon_gv_query = tep_db_query("select coupon_amount from " . TABLE_COUPONS . " where coupon_id = '" . $gv_id . "'");
$coupon_gv = tep_db_fetch_array($coupon_gv_query);
if (tep_db_num_rows($customer_gv_query) > 0) {
  $customer_gv = tep_db_fetch_array($customer_gv_query);
  $new_gv_amount = $customer_gv['amount'] + $coupon_gv['coupon_amount'];
  // new code bugfix
  $gv_query = tep_db_query("update " . TABLE_COUPON_GV_CUSTOMER . " set amount = '" . $new_gv_amount . "' where customer_id = '" . $customer_id . "'");  
 // original code $gv_query = tep_db_query("update " . TABLE_COUPON_GV_CUSTOMER . " set amount = '" . $new_gv_amount . "'");
} else {
  $gv_query = tep_db_query("insert into " . TABLE_COUPON_GV_CUSTOMER . " (customer_id, amount) values ('" . $customer_id . "', '" . $coupon_gv['coupon_amount'] . "')");
}
 }
////

 

My catalog/includes/functions/database.php line 103 area

 

  function tep_db_num_rows($db_query) {
return mysql_num_rows($db_query);
 }

 

Any clues or help is appreciated!

Link to comment
Share on other sites

  • Replies 4.8k
  • Created
  • Last Reply

Top Posters In This Topic

Trying to install CCGV 5.17

 

I'm having a big problem trying to install this on an oscommerce install. The biggest problem I'm having is that the checkout_confirmation.php is not working at all. All I get is a blank screen, no error message and nothing else seems to work.

 

I'm trying to work out what the problem is and it's either the checkout_confirmation.php itself or the order_total.php class file.

 

Files below:

 

checkout_confirmation.php

<?php

/*

$Id: checkout_confirmation.php,v 1.139 2003/06/11 17:34:53 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(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT));

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

}

 

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

}

}

 

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

}

 

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

if (isset($HTTP_POST_VARS['payment'])) $payment = $HTTP_POST_VARS['payment'];

 

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

if (tep_not_null($HTTP_POST_VARS['comments'])) {

$comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);

}

 

// load the selected payment module

require(DIR_WS_CLASSES . 'payment.php');

// ################# Added CGV Contribution ##################"

if ($credit_covers) $payment='';

// ################# End Added CGV Contribution ##################"

$payment_modules = new payment($payment);

// ################# Added CGV Contribution ##################"

require(DIR_WS_CLASSES . 'order_total.php');

// ################# End Added CGV Contribution ##################"

 

require(DIR_WS_CLASSES . 'order.php');

$order = new order;

 

$payment_modules->update_status();

 

// ################# Added CGV Contribution ##################"

// CCGV Contribution

$order_total_modules = new order_total;

$order_total_modules->collect_posts();

$order_total_modules->pre_confirmation_check();

 

// if ( ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) {

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

// ################# End Added CGV Contribution ##################"

 

if (is_array($payment_modules->modules)) {

$payment_modules->pre_confirmation_check();

}

 

// load the selected shipping module

require(DIR_WS_CLASSES . 'shipping.php');

$shipping_modules = new shipping($shipping);

 

// ################# Added CGV Contribution ##################"

// require(DIR_WS_CLASSES . 'order_total.php');

// $order_total_modules = new order_total;

// ################# End Added CGV Contribution ##################"

 

// Stock Check

$any_out_of_stock = false;

if (STOCK_CHECK == 'true') {

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

if (tep_check_stock($order->products[$i]['id'], $order->products[$i]['qty'])) {

$any_out_of_stock = true;

}

}

// Out of Stock

if ( (STOCK_ALLOW_CHECKOUT != 'true') && ($any_out_of_stock == true) ) {

tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));

}

}

 

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

 

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

$breadcrumb->add(NAVBAR_TITLE_2);

?>

<!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">

</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"><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_default.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>

<tr>

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

<tr class="infoBoxContents">

<?php

if ($sendto != false) {

?>

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

<tr>

<td class="main"><?php echo '<b>' . HEADING_DELIVERY_ADDRESS . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>

</tr>

<tr>

<td class="main"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br>'); ?></td>

</tr>

<?php

if ($order->info['shipping_method']) {

?>

<tr>

<td class="main"><?php echo '<b>' . HEADING_SHIPPING_METHOD . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>

</tr>

<tr>

<td class="main"><?php echo $order->info['shipping_method']; ?></td>

</tr>

<?php

}

?>

</table></td>

<?php

}

?>

<td width="<?php echo (($sendto != false) ? '70%' : '100%'); ?>" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

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

<?php

if (sizeof($order->info['tax_groups']) > 1) {

?>

<tr>

<td class="main" colspan="2"><?php echo '<b>' . HEADING_PRODUCTS . '</b> <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>

<td class="smallText" align="right"><b><?php echo HEADING_TAX; ?></b></td>

<td class="smallText" align="right"><b><?php echo HEADING_TOTAL; ?></b></td>

</tr>

<?php

} else {

?>

<tr>

<td class="main" colspan="3"><?php echo '<b>' . HEADING_PRODUCTS . '</b> <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>

</tr>

<?php

}

 

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

echo ' <tr>' . "\n" .

' <td class="main" align="right" valign="top" width="30">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .

' <td class="main" valign="top">' . $order->products[$i]['name'];

 

if (STOCK_CHECK == 'true') {

echo tep_check_stock($order->products[$i]['id'], $order->products[$i]['qty']);

}

 

if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {

for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {

echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i></small></nobr>';

}

}

 

echo '</td>' . "\n";

 

if (sizeof($order->info['tax_groups']) > 1) echo ' <td class="main" valign="top" align="right">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n";

 

echo ' <td class="main" align="right" valign="top">' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . '</td>' . "\n" .

' </tr>' . "\n";

}

?>

</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 class="main"><b><?php echo HEADING_BILLING_INFORMATION; ?></b></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 width="30%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="main"><?php echo '<b>' . HEADING_BILLING_ADDRESS . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>

</tr>

<tr>

<td class="main"><?php echo tep_address_format($order->billing['format_id'], $order->billing, 1, ' ', '<br>'); ?></td>

</tr>

<tr>

<td class="main"><?php echo '<b>' . HEADING_PAYMENT_METHOD . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>

</tr>

<tr>

<td class="main"><?php echo $order->info['payment_method']; ?></td>

</tr>

</table></td>

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

<?php

if (MODULE_ORDER_TOTAL_INSTALLED) {

$order_total_modules->process();

echo $order_total_modules->output();

}

?>

</table></td>

</tr>

</table></td>

</tr>

<?php

if (is_array($payment_modules->modules)) {

if ($confirmation = $payment_modules->confirmation()) {

?>

<tr>

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

</tr>

<tr>

<td class="main"><b><?php echo HEADING_PAYMENT_INFORMATION; ?></b></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" cellspacing="0" cellpadding="2">

<tr>

<td class="main" colspan="4"><?php echo $confirmation['title']; ?></td>

</tr>

<?php

for ($i=0, $n=sizeof($confirmation['fields']); $i<$n; $i++) {

?>

<tr>

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

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

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

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

</tr>

<?php

}

?>

</table></td>

</tr>

</table></td>

</tr>

<?php

}

}

?>

<tr>

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

</tr>

<?php

if (tep_not_null($order->info['comments'])) {

?>

<tr>

<td class="main"><?php echo '<b>' . HEADING_ORDER_COMMENTS . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></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 class="main"><?php echo nl2br(tep_output_string_protected($order->info['comments'])) . tep_draw_hidden_field('comments', $order->info['comments']); ?></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="0">

<tr>

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

<?php

if (isset($$payment->form_action_url)) {

$form_action_url = $$payment->form_action_url;

} else {

$form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL');

}

 

echo tep_draw_form('checkout_confirmation', $form_action_url, 'post');

 

if (is_array($payment_modules->modules)) {

echo $payment_modules->process_button();

}

 

echo tep_image_submit('button_confirm_order.gif', IMAGE_BUTTON_CONFIRM_ORDER) . '</form>' . "\n";

?>

</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%"><?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><?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%"><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="checkoutBarFrom"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '" class="checkoutBarFrom">' . CHECKOUT_BAR_PAYMENT . '</a>'; ?></td>

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

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

</tr>

</table></td>

</tr>

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

 

order_total.php

<?php

/*

$Id: order_total.php,v 1.4 2003/02/11 00:04:53 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

class order_total {

var $modules;

 

// class constructor

function order_total() {

global $language;

 

if (defined('MODULE_ORDER_TOTAL_INSTALLED') && tep_not_null(MODULE_ORDER_TOTAL_INSTALLED)) {

$this->modules = explode(';', MODULE_ORDER_TOTAL_INSTALLED);

 

reset($this->modules);

while (list(, $value) = each($this->modules)) {

include(DIR_WS_LANGUAGES . $language . '/modules/order_total/' . $value);

include(DIR_WS_MODULES . 'order_total/' . $value);

 

$class = substr($value, 0, strrpos($value, '.'));

$GLOBALS[$class] = new $class;

}

}

}

 

function process() {

$order_total_array = array();

if (is_array($this->modules)) {

reset($this->modules);

while (list(, $value) = each($this->modules)) {

$class = substr($value, 0, strrpos($value, '.'));

if ($GLOBALS[$class]->enabled) {

$GLOBALS[$class]->process();

 

for ($i=0, $n=sizeof($GLOBALS[$class]->output); $i<$n; $i++) {

if (tep_not_null($GLOBALS[$class]->output[$i]['title']) && tep_not_null($GLOBALS[$class]->output[$i]['text'])) {

$order_total_array[] = array('code' => $GLOBALS[$class]->code,

'title' => $GLOBALS[$class]->output[$i]['title'],

'text' => $GLOBALS[$class]->output[$i]['text'],

'value' => $GLOBALS[$class]->output[$i]['value'],

'sort_order' => $GLOBALS[$class]->sort_order);

}

}

}

}

}

 

return $order_total_array;

}

 

function output() {

$output_string = '';

if (is_array($this->modules)) {

reset($this->modules);

while (list(, $value) = each($this->modules)) {

$class = substr($value, 0, strrpos($value, '.'));

if ($GLOBALS[$class]->enabled) {

$size = sizeof($GLOBALS[$class]->output);

for ($i=0; $i<$size; $i++) {

$output_string .= ' <tr>' . "\n" .

' <td align="right" class="main">' . $GLOBALS[$class]->output[$i]['title'] . '</td>' . "\n" .

' <td align="right" class="main">' . $GLOBALS[$class]->output[$i]['text'] . '</td>' . "\n" .

' </tr>';

}

}

}

}

 

return $output_string;

}

 

// ############ Added CCGV Contribution ##########

//

// This function is called in checkout payment after display of payment methods. It actually calls

// two credit class functions.

//

// use_credit_amount() is normally a checkbox used to decide whether the credit amount should be applied to reduce

// the order total. Whether this is a Gift Voucher, or discount coupon or reward points etc.

//

// The second function called is credit_selection(). This in the credit classes already made is usually a redeem box.

// for entering a Gift Voucher number. Note credit classes can decide whether this part is displayed depending on

// E.g. a setting in the admin section.

//

function credit_selection() {

$selection_string = '';

$close_string = '';

$credit_class_string = '';

if (MODULE_ORDER_TOTAL_INSTALLED) {

$header_string = '<tr>' . "\n";

$header_string .= ' <td><table border="0" width="100%" cellspacing="0" cellpadding="2">' . "\n";

$header_string .= ' <tr>' . "\n";

$header_string .= ' <td class="main"><b>' . TABLE_HEADING_CREDIT . '</b></td>' . "\n";

$header_string .= ' </tr>' . "\n";

$header_string .= ' </table></td>' . "\n";

$header_string .= ' </tr>' . "\n";

$header_string .= '<tr>' . "\n";

$header_string .= ' <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">' . "\n";

$header_string .= ' <tr class="infoBoxContents"><td><table border="0" width="100%" cellspacing="0" cellpadding="2">' ."\n";

$header_string .= ' <tr><td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') .'</td>' . "\n";

$header_string .= ' <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">' . "\n";

$close_string = ' </table></td>';

$close_string .= '<td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') . '</td>';

$close_string .= '</tr></table></td></tr></table></td>';

$close_string .= '<tr><td width="100%">' . tep_draw_separator('pixel_trans.gif', '100%', '10') . '</td></tr>';

reset($this->modules);

$output_string = '';

 

 

 

while (list(, $value) = each($this->modules)) {

$class = substr($value, 0, strrpos($value, '.'));

if ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) {

 

// #################### Begin Added CGV JONYO ######################

//$use_credit_string = $GLOBALS[$class]->use_credit_amount();

// #################### End Added CGV JONYO ######################

 

 

 

 

if ($selection_string =='') $selection_string = $GLOBALS[$class]->credit_selection();

if ( ($use_credit_string !='' ) || ($selection_string != '') ) {

$output_string .= '<tr colspan="4"><td colspan="4" width="100%">' . tep_draw_separator('pixel_trans.gif', '100%', '10') . '</td></tr>';

$output_string = ' <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" >' . "\n" .

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

' <td class="main"><b>' . $GLOBALS[$class]->header . '</b></td>' . $use_credit_string;

$output_string .= '<td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') . '</td>';

$output_string .= ' </tr>' . "\n";

$output_string .= $selection_string;

}

 

}

}

if ($output_string != '') {

$output_string = $header_string . $output_string;

$output_string .= $close_string;

}

}

return $output_string;

}

// #################### Begin Added CGV JONYO ######################

function sub_credit_selection(){

$selection_string = '';

$close_string = '';

$credit_class_string = '';

if (MODULE_ORDER_TOTAL_INSTALLED) {

 

reset($this->modules);

$output_string = '';

while (list(, $value) = each($this->modules)) {

$class = substr($value, 0, strrpos($value, '.'));

if ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) {

$use_credit_string = $GLOBALS[$class]->use_credit_amount();

if ($selection_string =='') $selection_string = $GLOBALS[$class]->credit_selection();

if ( ($use_credit_string !='' ) || ($selection_string != '') ) {

 

$output_string = /*' <tr><td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') .'</td><td colspan=2><table border="0" cellpadding="2" cellspacing="0" width="100%"><tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" >' . "\n" .

' <td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') .'</td>' .*/

$use_credit_string;

$output_string .= '<td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') . '</td>';

$output_string .= ' </tr></table></td><td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') .'</td></tr>' . "\n";

//$output_string.=$GLOBALS[$class]->use_credit_amount();

//$output_string .= $selection_string;

}

 

}

}

if ($output_string != '') {

//$output_string = $output_string;

//$output_string .= $close_string;

}

}

return $output_string;

}

// #################### End Added CGV JONYO ######################

// if ($selection_string !='') {

// $output_string .= '</td>' . "\n";

// $output_string .= $selection_string;

// }

 

 

 

 

// update_credit_account is called in checkout process on a per product basis. It's purpose

// is to decide whether each product in the cart should add something to a credit account.

// e.g. for the Gift Voucher it checks whether the product is a Gift voucher and then adds the amount

// to the Gift Voucher account.

// Another use would be to check if the product would give reward points and add these to the points/reward account.

//

function update_credit_account($i) {

if (MODULE_ORDER_TOTAL_INSTALLED) {

reset($this->modules);

while (list(, $value) = each($this->modules)) {

$class = substr($value, 0, strrpos($value, '.'));

if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) {

$GLOBALS[$class]->update_credit_account($i);

}

}

}

}

// This function is called in checkout confirmation.

// It's main use is for credit classes that use the credit_selection() method. This is usually for

// entering redeem codes(Gift Vouchers/Discount Coupons). This function is used to validate these codes.

// If they are valid then the necessary actions are taken, if not valid we are returned to checkout payment

// with an error

//

function collect_posts() {

global $HTTP_POST_VARS,$HTTP_SESSION_VARS;

if (MODULE_ORDER_TOTAL_INSTALLED) {

reset($this->modules);

while (list(, $value) = each($this->modules)) {

$class = substr($value, 0, strrpos($value, '.'));

if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) {

$post_var = 'c' . $GLOBALS[$class]->code;

// #################### Begin Added CGV JONYO ######################

// if ($HTTP_POST_VARS[$post_var]) $_SESSION[$post_var] = $HTTP_POST_VARS[$post_var];

// if (!tep_session_is_registered($post_var)) tep_session_register($post_var);

if ($HTTP_POST_VARS[$post_var]) {

if (!tep_session_is_registered($post_var)) tep_session_register($post_var);

// ############ Added CCGV Contribution ##########

$post_var = $HTTP_POST_VARS[$post_var];

// ############ End Added CCGV Contribution ##########

}

// #################### End Added CGV JONYO ######################

$GLOBALS[$class]->collect_posts();

}

 

}

}

}

// pre_confirmation_check is called on checkout confirmation. It's function is to decide whether the

// credits available are greater than the order total. If they are then a variable (credit_covers) is set to

// true. This is used to bypass the payment method. In other words if the Gift Voucher is more than the order

// total, we don't want to go to paypal etc.

//

function pre_confirmation_check() {

// #################### Begin Added CGV JONYO ######################

global $payment, $order, $credit_covers, $customer_id;

// #################### End Added CGV JONYO ######################

if (MODULE_ORDER_TOTAL_INSTALLED) {

 

$total_deductions = 0;

reset($this->modules);

$order_total = $order->info['total'];

while (list(, $value) = each($this->modules)) {

$class = substr($value, 0, strrpos($value, '.'));

$order_total = $this->get_order_total_main($class,$order_total);

if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) {

$total_deductions = $total_deductions + $GLOBALS[$class]->pre_confirmation_check($order_total);

$order_total = $order_total - $GLOBALS[$class]->pre_confirmation_check($order_total);

}

}

// #################### Begin Added CGV JONYO ######################

 

$gv_query=tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");

$gv_result=tep_db_fetch_array($gv_query);

$gv_payment_amount = $gv_result['amount'];

 

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

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

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

$credit_covers = true;

}

else{ // belts and suspenders to get rid of credit_covers variable if it gets set once and they put something else in the cart

if(tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers');

}

// #################### End Added CGV JONYO ######################

}

}

// this function is called in checkout process. it tests whether a decision was made at checkout payment to use

// the credit amount be applied aginst the order. If so some action is taken. E.g. for a Gift voucher the account

// is reduced the order total amount.

//

function apply_credit() {

if (MODULE_ORDER_TOTAL_INSTALLED) {

reset($this->modules);

while (list(, $value) = each($this->modules)) {

$class = substr($value, 0, strrpos($value, '.'));

if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) {

$GLOBALS[$class]->apply_credit();

}

}

}

}

// Called in checkout process to clear session variables created by each credit class module.

//

function clear_posts() {

global $HTTP_POST_VARS,$HTTP_SESSION_VARS;

if (MODULE_ORDER_TOTAL_INSTALLED) {

reset($this->modules);

while (list(, $value) = each($this->modules)) {

$class = substr($value, 0, strrpos($value, '.'));

if ( ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) ) {

$post_var = 'c' . $GLOBALS[$class]->code;

if (tep_session_is_registered($post_var)) tep_session_unregister($post_var);

}

}

}

}

// Called at various times. This function calulates the total value of the order that the

// credit will be appled aginst. This varies depending on whether the credit class applies

// to shipping & tax

//

function get_order_total_main($class, $order_total) {

global $credit, $order;

// if ($GLOBALS[$class]->include_tax == 'false') $order_total=$order_total-$order->info['tax'];

// if ($GLOBALS[$class]->include_shipping == 'false') $order_total=$order_total-$order->info['shipping_cost'];

return $order_total;

}

// ############ End Added CCGV Contribution ##########

 

}

?>

 

Any help would be MUCH appreciated. Especially if it was asap.

 

TIA

Link to comment
Share on other sites

Trying to install CCGV 5.17

 

I'm having a big problem trying to install this on an oscommerce install. The biggest problem I'm having is that the checkout_confirmation.php is not working at all. All I get is a blank screen, no error message and nothing else seems to work.

 

I'm trying to work out what the problem is and it's either the checkout_confirmation.php itself or the order_total.php class file.

 

Ok - I've fixed the problem and found that it's in the documentation that comes with 5.17. Instead of this:

 

WRONG

Right Under: 
 $order = new order;  
			$payment_modules->update_status(); (around line 61)

Replace: 
if ( ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL')); (around line 55)
 }

With:
// ################# Added CGV Contribution ##################"
// CCGV Contribution
 $order_total_modules = new order_total;
 $order_total_modules->collect_posts();
 $order_total_modules->pre_confirmation_check();

//  if ( ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) {
 if ( (is_array($payment_modules->modules)) && (sizeof($payment_modules->modules) > 1) && (!is_object($$payment)) && (!$credit_covers) ) {
// ################# End Added CGV Contribution ##################"

 

It should say this:

 

RIGHT

Right Under: 
 $order = new order;  
			$payment_modules->update_status(); (around line 61)

Replace: 
if ( ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) {

With:
// ################# Added CGV Contribution ##################"
// CCGV Contribution
 $order_total_modules = new order_total;
 $order_total_modules->collect_posts();
 $order_total_modules->pre_confirmation_check();

//  if ( ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) {
 if ( (is_array($payment_modules->modules)) && (sizeof($payment_modules->modules) > 1) && (!is_object($$payment)) && (!$credit_covers) ) {
// ################# End Added CGV Contribution ##################"

 

HTH anyone else!

Link to comment
Share on other sites

Ok - I've fixed the problem and found that it's in the documentation that comes with 5.17. Instead of this:

 

HTH anyone else!

 

My version that worked with MySQL 4.0/PHP4 is heavily modified, but I will say my order_total.php doesn't have any of this ###CGV JONYO ### code.

 

May try to roll back away from that if that's an update or go back to to 5.13d

Link to comment
Share on other sites

Hi,

 

I'm getting the below error and I'm wondering if it's related to any code found in catalog/includes/add_ccgvdc_application_top.php.

 

We upgraded to MySQL 4.1.21-standard and php 5.0.4

 

Error at top of any product page (only product detail pages):

 

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/stitchpi/public_html/catalog/includes/functions/database.php on line 103

 

NO - this error was not related to CCGV code.

 

It turns out the offending code was a custom breadcrumb code in catalog/includes/application_top.php that removed the model number and replaced it with the product name instead.

Link to comment
Share on other sites

I get this error -

 

Fatal error: Call to undefined function: tep_draw_date_selector() in /home/craftyli/public_html/craftstore/admin/coupon_admin.php on line 763

 

 

undefined function: tep_draw_date_selector() what file is this function in?

 

can anyone help me out???????

Link to comment
Share on other sites

I?ve just installed contribution Credit Class & Gift Voucher 5.17

 

But something is wrong probably on page checkout_payment.php.

 

If anybody could have a look at it please.

 

This is the code

 

<?php

/*

$Id: checkout_payment.php,v 1.2.7 2004/01/01 12:03:27 Strider Exp $

$Id: checkout_payment.php,v 1.113 2003/07/24 23:03:27 Strider Exp $

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

$Id: checkout_payment.php,v 1.6.2.3 2003/05/10 20:12:14 wilt 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');

 

// #################### Begin Added CGV JONYO ######################

if (tep_session_is_registered('cot_gv')) tep_session_unregister('cot_gv'); //added to reset whether a gift voucher is used or not on this order

// #################### End Added CGV JONYO ######################

 

 

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

}

}

 

// if we have been here before and are coming back get rid of the credit covers variable

// #################### Added CGV ######################

if(tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers'); // CCGV Contribution

if(tep_session_is_registered('cot_gv')) tep_session_unregister('cot_gv'); //CCGV

// #################### End Added CGV ######################

 

 

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

}

}

}

// #################### Begin Added CGV JONYO ######################

// #################### THIS MOD IS OPTIONAL! ######################

 

// load the selected shipping module

require(DIR_WS_CLASSES . 'shipping.php');

$shipping_modules = new shipping($shipping);

 

// #################### End Added CGV JONYO ######################

// #################### THIS MOD WAS OPTIONAL! ######################

 

 

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

// #################### Added CGV ######################

require(DIR_WS_CLASSES . 'order_total.php');//ICW ADDED FOR CREDIT CLASS SYSTEM

$order_total_modules = new order_total;//ICW ADDED FOR CREDIT CLASS SYSTEM

$order_total_modules->clear_posts(); // ADDED FOR CREDIT CLASS SYSTEM by Rigadin in v5.13

// #################### End Added CGV ######################

 

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

 

$total_weight = $cart->show_weight();

$total_count = $cart->count_contents();

// #################### Added CGV ######################

$total_count = $cart->count_contents_virtual(); //ICW ADDED FOR CREDIT CLASS SYSTEM

// #################### End Added CGV ######################

 

// 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"><!--

var selected;

<?php // #################### Added CGV ###################### ?>

var submitter = null;

function submitFunction() {

submitter = 1;

}

<?php // #################### End Added CGV ###################### ?>

function selectRowEffect(object, buttonSelect) {

 

// #################### Begin Added CGV JONYO ######################

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

// #################### End Added CGV JONYO ######################

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;

}

// #################### Begin Added CGV JONYO ######################

}

// #################### End Added CGV JONYO ######################

}

 

function rowOverEffect(object) {

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

}

 

function rowOutEffect(object) {

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

}

 

<?php // #################### Begin Added CGV JONYO ###################### ?>

 

<?php

if (MODULE_ORDER_TOTAL_INSTALLED)

$temp=$order_total_modules->process();

$temp=$temp[count($temp)-1];

$temp=$temp['value'];

 

$gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");

$gv_result = tep_db_fetch_array($gv_query);

 

if ($gv_result['amount']>=$temp){ $coversAll=true;

 

?>

 

function clearRadeos(){

document.checkout_payment.cot_gv.checked=!document.checkout_payment.cot_gv.checked;

for (counter = 0; counter < document.checkout_payment.payment.length; counter++)

{

// If a radio button has been selected it will return true

// (If not it will return false)

if (document.checkout_payment.cot_gv.checked){

document.checkout_payment.payment[counter].checked = false;

document.checkout_payment.payment[counter].disabled=true;

//document.checkout_payment.cot_gv.checked=false;

} else {

document.checkout_payment.payment[counter].disabled=false;

//document.checkout_payment.cot_gv.checked=true;

}

}

}<? } else { $coversAll=false;?>

function clearRadeos(){

document.checkout_payment.cot_gv.checked=!document.checkout_payment.cot_gv.checked;

}<? } ?>

<?php // #################### End Added CGV JONYO ###################### ?>

 

//--></script>

 

<?php // #################### Begin Added CGV JONYO ###################### ?>

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

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

<?php // #################### End Added CGV JONYO ###################### ?>

 

</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="800" cellspacing="0" cellpadding="0" align="center" class="tableBGcolor">

<tr>

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

<!-- 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 class="tablebodytop"><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

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

<td class="pageHeading" align="right"><?php /*?><?php echo tep_image(DIR_WS_IMAGES . 'table_background_payment.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?><?php */?></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

}

?>

<?php // #################### Begin Added CGV JONYO ###################### ?>

<?php // #################### THIS MOD IS OPTIONAL! ###################### ?>

<tr>

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

<tr>

<td class="main"><b><?php echo HEADING_PRODUCTS; ?></b><? echo ' <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td>

</tr>

</table></td>

</tr>

<tr>

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

<tr class="infoBoxContents">

<td>

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

<?php

//}

 

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

echo ' <tr>' . "\n" .

' <td width="10%" class="infoBox" align="right" valign="top" width="30">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .

' <td width="60%" class="infoBox" valign="top">' . $order->products[$i]['name'];

 

if (STOCK_CHECK == 'true') {

echo tep_check_stock($order->products[$i]['id'], $order->products[$i]['qty']);

}

 

if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {

for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {

echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i></small></nobr>';

}

}

 

echo '</td>' . "\n";

 

if (sizeof($order->info['tax_groups']) > 1) echo ' <td class="infoBox" valign="top" align="right">' . tep_display_tax_value($order->products[$i]['tax']) . '% </td>' . "\n";

 

echo ' <td width="30%"class="infoBox" align="right" valign="top">' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . ' </td>' . "\n" .

' </tr>' . "\n";

}

?>

<tr>

<td COLSPAN="3" valign="top" align="right">

<table class="infoBox" border="0" cellspacing="0" cellpadding="3">

<?php

if (MODULE_ORDER_TOTAL_INSTALLED) {

//$temp=$order_total_modules->process();

echo $order_total_modules->output();

}

?>

</table>

</td>

</tr>

</table>

</td>

</tr>

</table></td>

</tr>

<!-- </table></td>

</tr-->

<?php // #################### End Added CGV JONYO ###################### ?>

<?php // #################### THIS MOD WAS OPTIONAL! ###################### ?>

 

 

 

 

<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="infoBox" 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="infoBox" 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="infoBox" 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>

<?php // #################### Added CGV ######################

echo $order_total_modules->credit_selection();//ICW ADDED FOR CREDIT CLASS SYSTEM

// #################### End Added CGV ###################### ?>

</tr>

<tr>

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

<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="infoBox" width="50%" valign="top"><?php echo TEXT_SELECT_PAYMENT_METHOD; ?></td>

<td class="infoBox" 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="infoBox" 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="infoBox" colspan="3"><b><?php echo $selection[$i]['module']; ?></b></td>

<td class="infoBox" 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="infoBox" 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="infoBox"><?php echo $selection[$i]['fields'][$j]['title']; ?></td>

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

<td class="infoBox"><?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++;

}

 

// #################### Begin Added CGV JONYO ######################

 

if (tep_session_is_registered('customer_id')) {

if ($gv_result['amount']>0){

echo ' <tr><td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') .'</td><td colspan=2>' . "\n" .

' <table border="0" cellpadding="2" cellspacing="0" width="100%"><tr class="moduleRow" onmouseover="rowOverEffect(this)" onclick="clearRadeos()" onmouseout="rowOutEffect(this)" >' . "\n" .

' <td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') .'</td><td class="main">' . $gv_result['text'];

 

echo $order_total_modules->sub_credit_selection();

}

}

 

 

// #################### End Added CGV JONYO ######################

 

?>

</table></td>

 

</tr>

</table></td>

</tr>

<tr>

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

</tr>

<tr>

<td><table class="main" 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 class="main" ><?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="main" >

<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="infoBox"><b><?php echo TITLE_CONTINUE_CHECKOUT_PROCEDURE . '</b><br>' . TEXT_CONTINUE_CHECKOUT_PROCEDURE; ?></td>

<td class="infoBox" 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 class="main"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

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

<tr>

<td width="25%"class="main" ><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 class="main" 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 class="main" border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

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

<td width="50%"class="main" ><?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" class="tableBGcolor" ><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="8">

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

 

 

Thank you very much.

Link to comment
Share on other sites

hello

 

it's been 3 hours i'm going again and again on all the files and can't figure out what's going wrong.

 

on the admin side, absolutly no problem with the discount coupon.

 

but the box to enter the code doesn't appear in the checkout_payment page during checkout process.

 

i've checked the checkout_process file so many times and it sounds ok (did reloaded it many times as well).

 

so i'd like to know what other file could work to call that box.

 

in case, i past below the checkout_payment file.

 

thanks for your help.

 

 

 

<?php
/*
 $Id: checkout_payment.php,v 1.2 2003/09/24 15:34:25 wilt 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'));
}
 }

// if we have been here before and are coming back get rid of the credit covers variable
	if(tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers');  //ICW ADDED FOR CREDIT CLASS SYSTEM


// 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;
 require(DIR_WS_CLASSES . 'order_total.php');//ICW ADDED FOR CREDIT CLASS SYSTEM
 $order_total_modules = new order_total;//ICW ADDED FOR CREDIT CLASS SYSTEM

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

 $total_weight = $cart->show_weight();
 $total_count = $cart->count_contents();
 $total_count = $cart->count_contents_virtual(); //ICW ADDED FOR CREDIT CLASS SYSTEM

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

 $content = CONTENT_CHECKOUT_PAYMENT;
 $javascript = $content . '.js.php';

 require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);

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

Link to comment
Share on other sites

Shiyde,

 

Did you do this:

 

Enabling Gift Vouchers and Discount Coupons

 

To enable the Gift Voucher, go to your admin->modules->order_total->Gift Vouchers and choose to install it. On a default system there should be a button with a green cross and the words install. Click that.

 

To enable the Discount Coupon, go to your admin->modules->order_total->Discount Coupons and choose to install it. On a default system there should be a button with a green cross and the words install. Click that.

 

The default settings for the Discount Coupons are as follows:

 

Discount Coupon

Display Total

true

Sort Order

9

Include Shipping

true

Include Tax

true

Re-calculate Tax

None

Tax Class

--none--

 

 

 

The default settings for the Gift Voucher is as follows:

 

Gift Vouchers

Display Total

true

Sort Order

740

Queue Purchases

true

Include Shipping

true

Include Tax

true

Re-calculate Tax

None

Tax Class

--none--

Credit including Tax

false

 

Before we start playing around with all the sort orders and other settings let's just get it running now.

 

 

 

 

 

 

hello

 

it's been 3 hours i'm going again and again on all the files and can't figure out what's going wrong.

 

on the admin side, absolutly no problem with the discount coupon.

 

but the box to enter the code doesn't appear in the checkout_payment page during checkout process.

 

i've checked the checkout_process file so many times and it sounds ok (did reloaded it many times as well).

 

so i'd like to know what other file could work to call that box.

 

in case, i past below the checkout_payment file.

 

thanks for your help.

<?php
/*
 $Id: checkout_payment.php,v 1.2 2003/09/24 15:34:25 wilt 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'));
}
 }

// if we have been here before and are coming back get rid of the credit covers variable
	if(tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers');  //ICW ADDED FOR CREDIT CLASS SYSTEM
// 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;
 require(DIR_WS_CLASSES . 'order_total.php');//ICW ADDED FOR CREDIT CLASS SYSTEM
 $order_total_modules = new order_total;//ICW ADDED FOR CREDIT CLASS SYSTEM

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

 $total_weight = $cart->show_weight();
 $total_count = $cart->count_contents();
 $total_count = $cart->count_contents_virtual(); //ICW ADDED FOR CREDIT CLASS SYSTEM

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

 $content = CONTENT_CHECKOUT_PAYMENT;
 $javascript = $content . '.js.php';

 require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);

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

Link to comment
Share on other sites

Yes, the install button in admin/modules would probably fix that.

 

Good Luck

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

 

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

 

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

 

CHOOCH

Link to comment
Share on other sites

Thank You! This fixed my problem. I have a lot of contributions going and was able to load CCGV 5.17 with only this one issue that you fixed. I would recommend this version to all having previously loaded the older versions this went 500% smoother.

 

Ok - I've fixed the problem and found that it's in the documentation that comes with 5.17. Instead of this:

 

WRONG

Right Under: 
 $order = new order;  
			$payment_modules->update_status(); (around line 61)

Replace: 
if ( ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL')); (around line 55)
 }

With:
// ################# Added CGV Contribution ##################"
// CCGV Contribution
 $order_total_modules = new order_total;
 $order_total_modules->collect_posts();
 $order_total_modules->pre_confirmation_check();

//  if ( ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) {
 if ( (is_array($payment_modules->modules)) && (sizeof($payment_modules->modules) > 1) && (!is_object($$payment)) && (!$credit_covers) ) {
// ################# End Added CGV Contribution ##################"

 

It should say this:

 

RIGHT

Right Under: 
 $order = new order;  
			$payment_modules->update_status(); (around line 61)

Replace: 
if ( ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) {

With:
// ################# Added CGV Contribution ##################"
// CCGV Contribution
 $order_total_modules = new order_total;
 $order_total_modules->collect_posts();
 $order_total_modules->pre_confirmation_check();

//  if ( ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) {
 if ( (is_array($payment_modules->modules)) && (sizeof($payment_modules->modules) > 1) && (!is_object($$payment)) && (!$credit_covers) ) {
// ################# End Added CGV Contribution ##################"

 

HTH anyone else!

What would you do if you knew you could not fail?

Link to comment
Share on other sites

Hi

 

I've couple of problems with this contribution. Once installed the shop runs fine and customers can redeem vouchers for the specifide amount and under the assigned cretiria. However the following problems are present:

 

1)The voucher is still present in the shopping cart after purchase

2) The redeemed voucher isn't showing up in admin

3) Users who haven't been sent a voucher can still redeem the voucher

4)Users can keep redeeming the same voucher over and over.

 

Is there an obvious reason for this to occur or should I just reinstall the module?

Link to comment
Share on other sites

Problem with MultiByte strings:

 

my site is using Chinese UTF-8

 

when it comes to show the order sub-total on page checkout_payment.php, the chinese for SUB-TOTAL (SUB_TITLE_SUB_TOTAL) and TOTAL (SUB_TITLE_TOTAL) will appear messed up.

 

Inside classes/order_total.php, i try to change STRING functions into MB_STRING, still doesnt work:

 

function output() {
  $output_string = '';
  if (is_array($this->modules)) {
	reset($this->modules);
	while (list(, $value) = each($this->modules)) {
	  $class = mb_substr($value, 0, mb_strrpos($value, '.')); 
	 [........]
	}
  }
  return $output_string;
}

 

so i belive the problem is whenever the TEXT is stored into that $GLOBALS[$class]->output[$i]['title'], something goes wrong.

 

can anyone help here?

thanks!!

Expresionario.com | Pura Sub-cultura!

Link to comment
Share on other sites

I just want to konw how a customer get a discount.

Only mailing by the admin?

A customer gets a discount via a voucher code that is issued by the admin. This is then added to the customers GV balance.

 

A customer can also get a discount if they know someone who has a GV balance and that someone emails them part of their GV balance. Once received, that 'amount' is added on to their GV balance.

 

Finally, the discount coupon itself is created in admin. If you can think of any way other than getting it to your customers by emailing them from admin, it is news to me.

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

 

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

 

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

 

CHOOCH

Link to comment
Share on other sites

hi :)

 

i created a coupon to mail out, 10% off a purchase of 35.00 or over

 

now, i tested a purchase, $400.00 put in the coupon code and got this

 

Congratulations, you have redeemed <BR>***HOWEVER:No reducion available, please see the coupon restrictions***

 

help??

Link to comment
Share on other sites

  • 2 weeks later...
I just want to konw how a customer get a discount.

Only mailing by the admin?

You create a coupon code and whether you tell them by word of mouth, snail mail, email via store admin, email via hotmail/yahoo or by telephone - they insert the code in checkout and get the discount.

 

It can't get much more clearer than that.

Edited by chooch

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

 

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

 

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

 

CHOOCH

Link to comment
Share on other sites

You create a coupon code and whether you tell them by word of mouth, snail mail, email via store admin, email via hotmail/yahoo or by telephone - they insert the code in checkout and get the discount.

 

It can't get much more clearer than that.

 

chooch, you do a great favor to me. Thank you very much.

Everyone is changing the world.

Everyone is a world.

For everyone needs my help, PM or email if I amn't online.

Link to comment
Share on other sites

Hello,

Firstly I would like to say hello cause this is my first post and hope not the last one.

Well, I have a problem with this contribution, I have see the same question in this forum but after applying the modifications, I can?t make it work.

The problem is: when I fill the checkout_confirmation page (I mean the payment option and when I write the code) and click to redeem the it automatically redirect to the login page.

I?ve the URL SEO contribution and I?ve been following the instructions in the forum to change to "false" the Configure Output W3C valid URLs (parameter string)? but I have the same problem.

I have installed the version 5.17 (dated 20 sep 2006) and I?ve also installed all the updates fixes and so.

Can anyone help me resolving this problem?

Thank you for your time.

Regards.

Link to comment
Share on other sites

Hello,

 

I'm hoping somone can help me here and has had the same issue...

 

I've installed the CCGV contribution and it went ok , and it appears to work until I try and complete checkout for a test order.. I just can't get off the checkout_payment.php page. Whether I try and redeem a voucher or not, the page just refreshes every time I click the "continue" button.

 

Any ideas?

 

Thanks

 

Sam

Link to comment
Share on other sites

Hello,

 

I'm hoping somone can help me here and has had the same issue...

 

I've installed the CCGV contribution and it went ok , and it appears to work until I try and complete checkout for a test order.. I just can't get off the checkout_payment.php page. Whether I try and redeem a voucher or not, the page just refreshes every time I click the "continue" button.

 

Any ideas?

 

Thanks

 

Sam

did you add the easier to understand checkout contribution for CCGV? there was a fix posted for that somewhere in the thread.

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

 

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

 

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

 

CHOOCH

Link to comment
Share on other sites

Hello! I have CCGV 5.10 installed and the discount coupon section works just fine.

 

However...I just went into Admin and selected myself as a customer to send a Gift Voucher to in the amount of $50.

 

I received an email with the note I included in Admin followed by lines that read:

 

The Gift Voucher is worth $50.00

 

To redeem this Gift Voucher, please click on the link below. Please also write down the redemption code which is bbc15e in case you have any problems.

 

http://www.nameofmysite.com/gv_redeem.php?gv_no=bbc15e

 

I purposely left out the real name of my site, so...that part is fine.

 

Problem is...when I click on the link to redeem my gift voucher, I receive the following:

 

Parse error: syntax error, unexpected '}' in /home/username/public_html/foldername/gv_redeem.php on line 93

 

I'm staring at the file now and have been for a while and I simply cannot find this error. I see nothing. Any ideas?

Link to comment
Share on other sites

did you add the easier to understand checkout contribution for CCGV? there was a fix posted for that somewhere in the thread.

 

Hello,

 

Thanks for the reply, I had just used the latest full package version of the contribution, "Credit Class & Gift Voucher 5.17"

 

I've searched back through the forums and found this update, is this what you meant?:

 

I tried making those code changes but it just resulted in the same problem...

 

Find this code:

global $payment, $order, $credit_covers, $customer_id;

Replace it with this code:

global $payment, $order, $credit_covers, $customer_id, $gv_payment_amount, $ot_coupon, $currency, $currencies;

Find this code:

$gv_query=tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
$gv_result=tep_db_fetch_array($gv_query);
$gv_payment_amount = $gv_result['amount'];
// if ($order->info['total'] - $total_deductions <= 0 ) {
if ($order->info['total'] - $gv_payment_amount <= 0 ) {

Replace it with this code:

$gv_query=tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
$gv_result=tep_db_fetch_array($gv_query);
$gv_payment_amount = $gv_result['amount'];
// if ($order->info['total'] - $total_deductions <= 0 ) {
if ( (tep_round($order->info['total'], $currencies->currencies[$currency]['decimal_places']) - 

tep_round($ot_coupon->pre_confirmation_check($order->info['subtotal']), 

$currencies->currencies[$currency]['decimal_places'])) - tep_round($gv_payment_amount, 

$currencies->currencies[$currency]['decimal_places']) <= 0 ) {

Link to comment
Share on other sites

Hello,

 

Thanks for the reply, I had just used the latest full package version of the contribution, "Credit Class & Gift Voucher 5.17"

 

I've searched back through the forums and found this update, is this what you meant?:

No, I mean't an update by Aaronwear

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

 

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

 

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

 

CHOOCH

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...