Jump to content
Strider

Credit Class/Gift Vouchers/Discount Coupons 5.10

Recommended Posts

Thanks

I just downloaded that the first thing that i did was update the checkout_payment.php but all i get is a white page


at the end of the day the code will be good

Share this post


Link to post
Share on other sites

i dont know if i should updated the other files? becase they are working fine


at the end of the day the code will be good

Share this post


Link to post
Share on other sites
i dont know if i should updated the other files? becase they are working fine

Yes, do all of them, and check the install instuctions for other changes. If all else fails, send me an email, and I will send you a zip copy of the files that I uploaded. They do contain other contribs, but they they should be marked where each contrib has made changes. Compare to your files, and go slowly. Don't expect a reply immediatley, because I am GMT +10 and I need to get some sleep.


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites

I was doing the updates but I just get a white page in

 

checkout_payment.php


at the end of the day the code will be good

Share this post


Link to post
Share on other sites

Ok Now I am getting a Error on checkout_payment.php

 

it reads

 

Warning: Missing argument 1 for javascript_validation() in /home/content/c/o/o/coolbug/html/includes/classes/payment.php on line 84

 

function javascript_validation($coversAll) { // Line 84


at the end of the day the code will be good

Share this post


Link to post
Share on other sites
Ok Now I am getting a Error on checkout_payment.php

 

it reads

 

Warning: Missing argument 1 for javascript_validation() in /home/content/c/o/o/coolbug/html/includes/classes/payment.php on line 84

 

function javascript_validation($coversAll) { // Line 84

That line is correct.

 

Did you check the alterations in catalog/checkout_payment.php


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites

Coopco - thanks for uploading your vn of checkout_payment.php ... but it's exactly the same as the vn I have and (unsurprisingly) throws the same error - the root of the problem lies elsewhere with the $GLOBAL that is referenced not being set correctly - I will continue to experiment with/search in other places like ot_coupon.php and order_total.php which are referenced by checkout_payment.php..... no need for you to send me any zip, but thanx for the offer. I have a nasty feeling this problem could be related to server setup .... anyway I'll keep posting with the progress (if any!) that I make.

 

K

Share this post


Link to post
Share on other sites
Hi - thanks for the above info ... and this is what occurred (yes I did originally use 5.16 BlueNoteMKVI) - I downloaded the shanejackson set that you recommended and installed it into the vanilla osc .... checkout_payment.php gave an error (unexpected $ at end of file) - this was due to a couple of instances of <? rather than <?php being used to open php fragements - my server needs <?php - anyway corrected that problem and then got

Fatal error: Call to a member function on a non-object in /home/sites/domains/wbstools/catalog/checkout_payment.php on line 174

 

Line 174 is : $testing= $GLOBALS['ot_gv']->mod_process();

 

.... and that's the nub of it I think. Looks like this line is trying to get a global value ... and it's not properly defined.

 

You say you had no probs with this install ... wonder what I've missed - but I have checked again that I copied all the files over from 5.12a2 Part 1 + 5.15a2 Part 2.

 

Any ideas out there ...?

 

Thanx

 

Keith

 

Maybe it is referencing the catalog\includes\languages\english\modules\order_total\ot_gv.php file

 

Here is mine

 

 

 

<?php

/*

$Id: ot_gv.php,v 1.37.3 2004/01/01 12:52:59 Strider Exp $

$Id: ot_gv.php,v 1.4.2.12 2003/05/14 22:52:59 wilt Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2002 osCommerce

 

Released under the GNU General Public License

Added checkout layout mod

*/

 

class ot_gv {

var $title, $output;

 

function ot_gv() {

$this->code = 'ot_gv';

$this->title = MODULE_ORDER_TOTAL_GV_TITLE;

$this->header = MODULE_ORDER_TOTAL_GV_HEADER;

$this->description = MODULE_ORDER_TOTAL_GV_DESCRIPTION;

$this->user_prompt = MODULE_ORDER_TOTAL_GV_USER_PROMPT;

$this->enabled = MODULE_ORDER_TOTAL_GV_STATUS;

$this->sort_order = MODULE_ORDER_TOTAL_GV_SORT_ORDER;

$this->include_shipping = MODULE_ORDER_TOTAL_GV_INC_SHIPPING;

$this->include_tax = MODULE_ORDER_TOTAL_GV_INC_TAX;

$this->calculate_tax = MODULE_ORDER_TOTAL_GV_CALC_TAX;

$this->credit_tax = MODULE_ORDER_TOTAL_GV_CREDIT_TAX;

$this->tax_class = MODULE_ORDER_TOTAL_GV_TAX_CLASS;

$this->show_redeem_box = MODULE_ORDER_TOTAL_GV_REDEEM_BOX;

$this->credit_class = true;

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

// $this->checkbox = $this->user_prompt . '<input type="checkbox" onClick="submitFunction()" name="' . 'c' . $this->code . '">';

$this->checkbox = $this->user_prompt . '<input type="checkbox" onClick="clearRadeos()" name="' . 'c' . $this->code . '">';

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

$this->output = array();

}

 

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

// #################### if you set it in admin to not include tax or shipping in the amount

 

function process() {

global $order, $currencies, $cot_gv;

// if ($_SESSION['cot_gv']) { // old code Strider

if (tep_session_is_registered('cot_gv')) {

$order_total = $this->get_order_total();

$od_amount = $this->calculate_credit($order_total);

if ($this->calculate_tax != "None") {

$tod_amount = $this->calculate_tax_deduction($order_total, $od_amount, $this->calculate_tax);

$od_amount = $this->calculate_credit($order_total);

}

$this->deduction = $od_amount;

// if (($this->calculate_tax == "Credit Note") && (DISPLAY_PRICE_WITH_TAX != 'true')) {

// $od_amount -= $tod_amount;

// $order->info['total'] -= $tod_amount;

// }

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

if ($od_amount > 0) {

$this->output[] = array('title' => $this->title . ':',

'text' => '<b>' . $currencies->format($od_amount) . '</b>',

'value' => $od_amount);

}

}

}

 

function mod_process() {

global $currencies;

$my_order_total = $this->get_order_total();

$my_od_amount = $this->calculate_credit($my_order_total);

if ($this->calculate_tax != "None") {

$tod_amount = $this->calculate_tax_deduction($my_order_total, $my_od_amount, $this->calculate_tax);

$my_od_amount = $this->calculate_credit($my_order_total);

}

$this->deduction = $my_od_amount;

//$order->info['total'] = $order->info['total'] - $my_od_amount;

if ($my_od_amount > 0) {

$this->my_output[] = array('title' => $this->title . ':',

'text' => '<b>' . $currencies->format($my_od_amount) . '</b>',

'value' => $my_od_amount);

}

}

 

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

 

 

function selection_test() {

global $customer_id;

if ($this->user_has_gv_account($customer_id)) {

return true;

} else {

return false;

}

}

 

function pre_confirmation_check($order_total) {

global $cot_gv, $order;

// if ($_SESSION['cot_gv']) { // old code Strider

$od_amount = 0; // set the default amount we will send back

if (tep_session_is_registered('cot_gv')) {

// pre confirmation check doesn't do a true order process. It just attempts to see if

// there is enough to handle the order. But depending on settings it will not be shown

// all of the order so this is why we do this runaround jane. What do we know so far.

// nothing. Since we need to know if we process the full amount we need to call get order total

// if there has been something before us then

 

if ($this->include_tax == 'false') {

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

}

if ($this->include_shipping == 'false') {

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

}

$od_amount = $this->calculate_credit($order_total);

 

 

if ($this->calculate_tax != "None") {

$tod_amount = $this->calculate_tax_deduction($order_total, $od_amount, $this->calculate_tax);

$od_amount = $this->calculate_credit($order_total)+$tod_amount;

}

}

return $od_amount;

}

// original code

/*function pre_confirmation_check($order_total) {

if ($SESSION['cot_gv']) {

$gv_payment_amount = $this->calculate_credit($order_total);

}

return $gv_payment_amount;

} */

 

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

function use_credit_amount() {

global $cot_gv, $currencies;

// $_SESSION['cot_gv'] = false; // old code - Strider

$cot_gv = false;

if ($this->selection_test()) {

$output_string = $this->checkbox . '</b>' . '</td>' . "\n";}

 

return $output_string;

}

 

function use_credit_amount_sub() {

global $cot_gv;

// $_SESSION['cot_gv'] = false; // old code - Strider

$cot_gv = false;

if ($this->selection_test()) {

$output_string .= ' <td align="right" class="main" colspan=2>';

$output_string .= '<b>' . $this->checkbox . '</b>' . '</td>' . "\n";

}

return $output_string;

}

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

 

function update_credit_account($i) {

 

global $order, $customer_id, $insert_id, $REMOTE_ADDR;

if (ereg('^GIFT', addslashes($order->products[$i]['model']))) {

$gv_order_amount = ($order->products[$i]['final_price'] * $order->products[$i]['qty']);

if ($this->credit_tax=='true') $gv_order_amount = $gv_order_amount * (100 + $order->products[$i]['tax']) / 100;

// $gv_order_amount += 0.001;

$gv_order_amount = $gv_order_amount * 100 / 100;

if (MODULE_ORDER_TOTAL_GV_QUEUE == 'false') {

// GV_QUEUE is true so release amount to account immediately

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

$customer_gv = false;

$total_gv_amount = 0;

if ($gv_result = tep_db_fetch_array($gv_query)) {

$total_gv_amount = $gv_result['amount'];

$customer_gv = true;

}

$total_gv_amount = $total_gv_amount + $gv_order_amount;

if ($customer_gv) {

$gv_update=tep_db_query("update " . TABLE_COUPON_GV_CUSTOMER . " set amount = '" . $total_gv_amount . "' where customer_id = '" . $customer_id . "'");

} else {

$gv_insert=tep_db_query("insert into " . TABLE_COUPON_GV_CUSTOMER . " (customer_id, amount) values ('" . $customer_id . "', '" . $total_gv_amount . "')");

}

} else {

// GV_QUEUE is true - so queue the gv for release by store owner

$gv_insert=tep_db_query("insert into " . TABLE_COUPON_GV_QUEUE . " (customer_id, order_id, amount, date_created, ipaddr) values ('" . $customer_id . "', '" . $insert_id . "', '" . $gv_order_amount . "', NOW(), '" . $REMOTE_ADDR . "')");

}

}

}

 

function credit_selection() {

global $customer_id, $currencies, $language;

$selection_string = '';

$gv_query = tep_db_query("select coupon_id from " . TABLE_COUPONS . " where coupon_type = 'G' and coupon_active='Y'");

if (tep_db_num_rows($gv_query)) {

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

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

$selection_string .= ' <td class="main">' . "\n";

$image_submit = '<input type="image" name="submit_redeem" onClick="submitFunction()" src="' . DIR_WS_LANGUAGES . $language . '/images/buttons/button_redeem.gif" border="0" alt="' . IMAGE_REDEEM_VOUCHER . '" title = "' . IMAGE_REDEEM_VOUCHER . '">';

$selection_string .= TEXT_ENTER_GV_CODE . tep_draw_input_field('gv_redeem_code') . '</td>';

$selection_string .= ' <td align="right">' . $image_submit . '</td>';

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

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

}

return $selection_string;

}

 

function apply_credit() {

global $order, $customer_id, $coupon_no, $cot_gv;

if (tep_session_is_registered('cot_gv')) {

$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 = $this->deduction;

$gv_amount = $gv_result['amount'] - $gv_payment_amount;

$gv_update = tep_db_query("update " . TABLE_COUPON_GV_CUSTOMER . " set amount = '" . $gv_amount . "' where customer_id = '" . $customer_id . "'");

}

return $gv_payment_amount;

}

 

function collect_posts() {

// Security Update + $cot_gv added in Global in v5.13 by Rigadin + updated URL parameters of all tep_redirect function called inside this function

global $currencies, $HTTP_POST_VARS, $customer_id, $coupon_no, $REMOTE_ADDR, $cot_gv;

 

 

if ($HTTP_POST_VARS['gv_redeem_code']) {

// Security update by Rigadin in v5.13: add slashes in front of user input

$gv_query = tep_db_query("select coupon_id, coupon_type, coupon_amount from " . TABLE_COUPONS . " where coupon_code = '" . tep_db_input($HTTP_POST_VARS['gv_redeem_code']) . "'");

$gv_result = tep_db_fetch_array($gv_query);

if (tep_db_num_rows($gv_query) != 0) {

$redeem_query = tep_db_query("select * from " . TABLE_COUPON_REDEEM_TRACK . " where coupon_id = '" . $gv_result['coupon_id'] . "'");

if ( (tep_db_num_rows($redeem_query) != 0) && ($gv_result['coupon_type'] == 'G') ) {

// error, this coupon has been redeemed already.

tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error='.$this->code.'&error=' . urlencode(ERROR_NO_INVALID_REDEEM_GV), 'SSL'));

}

}

// Next line added by Rigadin in v5.13 to give an error when unknown code entered

elseif ($HTTP_POST_VARS['submit_redeem_x']) tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error='.$this->code.'&error=' . urlencode(ERROR_NO_INVALID_REDEEM_GV), 'SSL'));

 

if ($gv_result['coupon_type'] == 'G') {

$gv_amount = $gv_result['coupon_amount'];

// Things to set

// ip address of claimant

// customer id of claimant

// date

// redemption flag

// now update customer account with gv_amount

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

$customer_gv = false;

$total_gv_amount = $gv_amount;

if ($gv_amount_result = tep_db_fetch_array($gv_amount_query)) {

$total_gv_amount = $gv_amount_result['amount'] + $gv_amount;

$customer_gv = true;

}

$gv_update = tep_db_query("update " . TABLE_COUPONS . " set coupon_active = 'N' where coupon_id = '" . $gv_result['coupon_id'] . "'");

$gv_redeem = tep_db_query("insert into " . TABLE_COUPON_REDEEM_TRACK . " (coupon_id, customer_id, redeem_date, redeem_ip) values ('" . $gv_result['coupon_id'] . "', '" . $customer_id . "', now(),'" . $REMOTE_ADDR . "')");

if ($customer_gv) {

// already has gv_amount so update

$gv_update = tep_db_query("update " . TABLE_COUPON_GV_CUSTOMER . " set amount = '" . $total_gv_amount . "' where customer_id = '" . $customer_id . "'");

} else {

// no gv_amount so insert

$gv_insert = tep_db_query("insert into " . TABLE_COUPON_GV_CUSTOMER . " (customer_id, amount) values ('" . $customer_id . "', '" . $total_gv_amount . "')");

}

tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error='.$this->code.'&error=' . urlencode(ERROR_REDEEMED_AMOUNT. $currencies->format($gv_amount)), 'SSL'));

}

}

// v5.13a Generates an error if redeem button pressed without code entered

if ($HTTP_POST_VARS['submit_redeem_x'] && !$HTTP_POST_VARS['gv_redeem_code']) tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error='.$this->code.'&error=' . urlencode(ERROR_NO_REDEEM_CODE), 'SSL'));

}

 

function calculate_credit($amount) {

global $customer_id, $order;

$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'];

$gv_amount = $gv_payment_amount;

$save_total_cost = $amount;

$full_cost = $save_total_cost - $gv_payment_amount;

if ($full_cost <= 0) {

$full_cost = 0;

$gv_payment_amount = $save_total_cost;

}

return tep_round($gv_payment_amount,2);

}

 

function calculate_tax_deduction($amount, $od_amount, $method) {

global $order;

switch ($method) {

case 'Standard':

// Amended line, was giving an error when a zero value was arriving here. v5.13 by Rigadin

// v5.13 spelling error introduced an error, corrected

//$ratio1 = tep_round($od_amount / $amount,2);

$ratio1= ($amount==0? 0 : tep_round($od_amount / $amount,2) );

$tod_amount = 0;

reset($order->info['tax_groups']);

while (list($key, $value) = each($order->info['tax_groups'])) {

$tax_rate = tep_get_tax_rate_from_desc($key);

$total_net += $tax_rate * $order->info['tax_groups'][$key];

}

if ($od_amount > $total_net) $od_amount = $total_net;

reset($order->info['tax_groups']);

while (list($key, $value) = each($order->info['tax_groups'])) {

$tax_rate = tep_get_tax_rate_from_desc($key);

$net = $tax_rate * $order->info['tax_groups'][$key];

if ($net > 0) {

$god_amount = $order->info['tax_groups'][$key] * $ratio1;

$tod_amount += $god_amount;

$order->info['tax_groups'][$key] = $order->info['tax_groups'][$key] - $god_amount;

}

}

$order->info['tax'] -= $tod_amount;

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

break;

case 'Credit Note':

$tax_rate = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);

$tax_desc = tep_get_tax_description($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);

$tod_amount = $this->deduction / (100 + $tax_rate)* $tax_rate;

$order->info['tax_groups'][$tax_desc] -= $tod_amount;

// $order->info['total'] -= $tod_amount; //// ????? Strider

break;

default:

}

return $tod_amount;

}

 

function user_has_gv_account($c_id) {

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

if ($gv_result = tep_db_fetch_array($gv_query)) {

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

return true;

}

}

return false;

}

 

function get_order_total() {

global $order;

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

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

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

 

return $order_total;

}

 

// START added by Rigadin in v5.13, needed to show module errors on checkout_payment page

function get_error() {

global $HTTP_GET_VARS;

 

$error = array('title' => MODULE_ORDER_TOTAL_GV_TEXT_ERROR,

'error' => stripslashes(urldecode($HTTP_GET_VARS['error'])));

 

return $error;

}

// END added by Rigadin

 

function check() {

if (!isset($this->check)) {

$check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_ORDER_TOTAL_GV_STATUS'");

$this->check = tep_db_num_rows($check_query);

}

 

return $this->check;

}

 

function keys() {

return array('MODULE_ORDER_TOTAL_GV_STATUS', 'MODULE_ORDER_TOTAL_GV_SORT_ORDER', 'MODULE_ORDER_TOTAL_GV_QUEUE', 'MODULE_ORDER_TOTAL_GV_INC_SHIPPING', 'MODULE_ORDER_TOTAL_GV_INC_TAX', 'MODULE_ORDER_TOTAL_GV_CALC_TAX', 'MODULE_ORDER_TOTAL_GV_TAX_CLASS', 'MODULE_ORDER_TOTAL_GV_CREDIT_TAX');

}

 

function install() {

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Affichage', 'MODULE_ORDER_TOTAL_GV_STATUS', 'true', 'Voulez-vous autoriser l\'affichage de la remise pour les chèques cadeaux ?', '6', '1','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Ordre de tri', 'MODULE_ORDER_TOTAL_GV_SORT_ORDER', '740', 'Ordre de tri pour l\'affichage (Le plus petit nombre est montrer en premier).<br>', '6', '2', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Chèques en attente', 'MODULE_ORDER_TOTAL_GV_QUEUE', 'true', 'Voulez-vous mettre les chèques en attente de validation ?', '6', '3','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function ,date_added) values ('Livraison', 'MODULE_ORDER_TOTAL_GV_INC_SHIPPING', 'true', 'Voulez-vous inclure la livraison dans le caclule ?', '6', '5', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function ,date_added) values ('Taxe', 'MODULE_ORDER_TOTAL_GV_INC_TAX', 'true', 'Voulez-vous inclure la taxe dans le calcule ?', '6', '6','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function ,date_added) values ('Mode de calcule', 'MODULE_ORDER_TOTAL_GV_CALC_TAX', 'None', 'Quel mode utiliser pour recalculer la taxe ?', '6', '7','tep_cfg_select_option(array(\'None\', \'Standard\', \'Credit Note\'), ', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Type de Taxe', 'MODULE_ORDER_TOTAL_GV_TAX_CLASS', '0', 'Quel type de taxe voulez-vous utiliser pour les coupons de réduction ?<br>', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function ,date_added) values ('Inclure taxe', 'MODULE_ORDER_TOTAL_GV_CREDIT_TAX', 'false', 'Voulez-vous ajouter la taxe sur le chèque cadeau ?', '6', '8','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");

}

 

function remove() {

tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");

}

}

?>


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites

If someone posted an update today, it does not appear in the contrib area. It could be that the attachment was the wrong format, or it was too big.


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites

Hi

 

I have this contrib installed and working well.

 

However, due to competition, I now want to offer all online customers a 10% discount over the shop customers. Is there a way to do this so that the customer does not have to enter a discount code, they just get it.

 

Thanks

 

W

Share this post


Link to post
Share on other sites
Hi

 

I have this contrib installed and working well.

 

However, due to competition, I now want to offer all online customers a 10% discount over the shop customers. Is there a way to do this so that the customer does not have to enter a discount code, they just get it.

 

Thanks

 

W

 

You could send everyone a discount coupon for 10%, and have it never expire. They would only have to redeem it once. Then for new customers, they could be given the discount coupon when they create an account.


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites
That line is correct.

 

Did you check the alterations in catalog/checkout_payment.php

 

Yes I have checked and double check the files but I stll keep getting that error and I dont see the redeem button anywere


at the end of the day the code will be good

Share this post


Link to post
Share on other sites
Yes I have checked and double check the files but I stll keep getting that error and I dont see the redeem button anywere

Can you post here the code for the page?


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites
Can you post here the code for the page?

 

 

 

Catalog/checkout_payment.php

 

<?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 (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
// #################### Added CGV ######################
if(tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers');  // CCGV Contribution
// #################### 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;
  }
}
 }

// 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) {
 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>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php // #################### Added CGV ###################### 
 echo $order_total_modules->credit_selection();//ICW ADDED FOR CREDIT CLASS SYSTEM
// #################### End Added CGV ###################### ?>
  <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'); ?>

 

 

includes/classes/payment.php

 

<?php
/*
 $Id: payment.php,v 1.37.3 2004/01/01 22:26:32 Strider Exp $
 $Id: payment.php,v 1.37 2003/06/09 22:26:32 hpdl Exp $
 $Id: payment.php,v 1.3.2.1 2003/05/03 23:41:23 wilt Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 class payment {
var $modules, $selected_module;

// class constructor
function payment($module = '') {
  global $payment, $language, $PHP_SELF;

  if (defined('MODULE_PAYMENT_INSTALLED') && tep_not_null(MODULE_PAYMENT_INSTALLED)) {
	$this->modules = explode(';', MODULE_PAYMENT_INSTALLED);

	$include_modules = array();

	if ( (tep_not_null($module)) && (in_array($module . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1)), $this->modules)) ) {
	  $this->selected_module = $module;

	  $include_modules[] = array('class' => $module, 'file' => $module . '.php');
	} else {
	  reset($this->modules);
	  while (list(, $value) = each($this->modules)) {
		$class = substr($value, 0, strrpos($value, '.'));
		$include_modules[] = array('class' => $class, 'file' => $value);
	  }
	}

	for ($i=0, $n=sizeof($include_modules); $i<$n; $i++) {
	  include(DIR_WS_LANGUAGES . $language . '/modules/payment/' . $include_modules[$i]['file']);
	  include(DIR_WS_MODULES . 'payment/' . $include_modules[$i]['file']);

	  $GLOBALS[$include_modules[$i]['class']] = new $include_modules[$i]['class'];
	}

// if there is only one payment method, select it as default because in
// checkout_confirmation.php the $payment variable is being assigned the
// $HTTP_POST_VARS['payment'] value which will be empty (no radio button selection possible)
	if ( (tep_count_payment_modules() == 1) && (!isset($GLOBALS[$payment]) || (isset($GLOBALS[$payment]) && !is_object($GLOBALS[$payment]))) ) {
	  $payment = $include_modules[0]['class'];
	}

	if ( (tep_not_null($module)) && (in_array($module, $this->modules)) && (isset($GLOBALS[$module]->form_action_url)) ) {
	  $this->form_action_url = $GLOBALS[$module]->form_action_url;
	}
  }
}

// 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]);
	  }
	}
  }
}

// #################### Begin Added CGV JONYO ######################
//	function javascript_validation() {
 function javascript_validation($coversAll) { // line 84
//added the $coversAll to be able to pass whether or not the voucher will cover the whole
//price or not.  If it does, then let checkout proceed when just it is passed.
  $js = '';
  if (is_array($this->modules)) {
if ($coversAll) {
  $addThis='if (document.checkout_payment.cot_gv.checked) {
  payment_value=cot_gv;  alert (\'hey yo\');
  } else ';
  } else {
$addThis='';
  }
	$js = '<script language="javascript"><!-- ' . "\n" .
		  'function check_form() {' . "\n" .
		  '  var error = 0;' . "\n" .
		  '  var error_message = "' . JS_ERROR . '";' . "\n" .
		  '  var payment_value = null;' . "\n" .$addThis . //added by jonyo, yo
		  '  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();
	  }
	}

// ############ Added CCGV Contribution ##########
//		$js .= "\n" . '  if (payment_value == null) {' . "\n" .
	$js .= "\n" . '  if (payment_value == null && submitter != 1) {' . "\n" . // CCGV Contribution
// ############ End Added CCGV Contribution ##########
		   '	error_message = error_message + "' . JS_ERROR_NO_PAYMENT_MODULE_SELECTED . '";' . "\n" .
		   '	error = 1;' . "\n" .
		   '  }' . "\n\n" .
// ############ Added CCGV Contribution ##########
//  ICW CREDIT CLASS Gift Voucher System Line below amended
//			   '  if (error == 1) {' . "\n" .
		   '  if (error == 1 && submitter != 1) {' . "\n" .
// ############ End Added CCGV Contribution ##########
		   '	alert(error_message);' . "\n" .
		   '	return false;' . "\n" .
		   '  } else {' . "\n" .
		   '	return true;' . "\n" .
		   '  }' . "\n" .
		   '}' . "\n" .
		   '//--></script>' . "\n";
  }

  return $js;
}
// #################### End Added CGV JONYO ######################

function selection() {

  $selection_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) {
		$selection = $GLOBALS[$class]->selection();
		if (is_array($selection)) $selection_array[] = $selection;
	  }
	}
  }

  return $selection_array;
}
// ############ Added CCGV Contribution ##########
// check credit covers was setup to test whether credit covers is set in other parts of the code
function check_credit_covers() {
global $credit_covers;

return $credit_covers;
}
// ############ End Added CCGV Contribution ##########
function pre_confirmation_check() {
// ############ Added CCGV Contribution ##########
  global $credit_covers, $payment_modules; 
// ############ End Added CCGV Contribution ##########
  if (is_array($this->modules)) {
	if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->enabled) ) {
// ############ Added CCGV Contribution ##########
	  if ($credit_covers) { //  ICW CREDIT CLASS Gift Voucher System
		$GLOBALS[$this->selected_module]->enabled = false; //ICW CREDIT CLASS Gift Voucher System
		$GLOBALS[$this->selected_module] = NULL; //ICW CREDIT CLASS Gift Voucher System
		$payment_modules = ''; //ICW CREDIT CLASS Gift Voucher System
	  } else { //ICW CREDIT CLASS Gift Voucher System
// ############ End Added CCGV Contribution ##########
	  $GLOBALS[$this->selected_module]->pre_confirmation_check();
// ############ Added CCGV Contribution ##########
	  }
// ############ End Added CCGV Contribution ##########
	}
  }
}

function confirmation() {
  if (is_array($this->modules)) {
	if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->enabled) ) {
	  return $GLOBALS[$this->selected_module]->confirmation();
	}
  }
}

function process_button() {
  if (is_array($this->modules)) {
	if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->enabled) ) {
	  return $GLOBALS[$this->selected_module]->process_button();
	}
  }
}

function before_process() {
  if (is_array($this->modules)) {
	if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->enabled) ) {
	  return $GLOBALS[$this->selected_module]->before_process();
	}
  }
}

function after_process() {
  if (is_array($this->modules)) {
	if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->enabled) ) {
	  return $GLOBALS[$this->selected_module]->after_process();
	}
  }
}

function get_error() {
  if (is_array($this->modules)) {
	if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->enabled) ) {
	  return $GLOBALS[$this->selected_module]->get_error();
	}
  }
}
 }
?>


at the end of the day the code will be good

Share this post


Link to post
Share on other sites
Catalog/checkout_payment.php

Not quite what I expected. It seems that it was not the 5.15a2 version. I have zipped admin and zipped catalog and sent them to your email address. Compare these and make what changes are indicated for CCGV. If these updates fail, repost your new file.


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites
Not quite what I expected. It seems that it was not the 5.15a2 version. I have zipped admin and zipped catalog and sent them to your email address. Compare these and make what changes are indicated for CCGV. If these updates fail, repost your new file.

 

 

what E-mail did you sent it to?

 

moiseszaragoza@yahoo.com is better


at the end of the day the code will be good

Share this post


Link to post
Share on other sites
Not quite what I expected. It seems that it was not the 5.15a2 version. I have zipped admin and zipped catalog and sent them to your email address. Compare these and make what changes are indicated for CCGV. If these updates fail, repost your new file.

OK, your given hotmail address (as given in your profile) is not recognised. If you want the zips, email me, do not PM me.

 

----- The following addresses had permanent fatal errors -----

<moiseszaragoza@hotmail.com>

(reason: 550 Requested action not taken: mailbox unavailable)

 

----- Transcript of session follows -----

... while talking to mx4.hotmail.com.:

>>> DATA

<<< 550 Requested action not taken: mailbox unavailable

550 5.1.1 <moiseszaragoza@hotmail.com>... User unknown

 

Just to be perfectly clear, do install all of the Jonyo stuff.


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites
OK, your given hotmail address (as given in your profile) is not recognised. If you want the zips, email me, do not PM me.

 

----- The following addresses had permanent fatal errors -----

<moiseszaragoza@hotmail.com>

(reason: 550 Requested action not taken: mailbox unavailable)

 

----- Transcript of session follows -----

... while talking to mx4.hotmail.com.:

>>> DATA

<<< 550 Requested action not taken: mailbox unavailable

550 5.1.1 <moiseszaragoza@hotmail.com>... User unknown

 

Just to be perfectly clear, do install all of the Jonyo stuff.

OK

Now sent zips to your yahoo address.


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

Share this post


Link to post
Share on other sites

I just finning updating everything in the catalog.

but nothing is showinh in the payment page


at the end of the day the code will be good

Share this post


Link to post
Share on other sites

I was looking at the site but the shipping opptions dose not appera it says

 

 

Please select the preferred shipping method to use on this order. Please Select

 

 

Free Shipping

Free shipping for orders over $50.00

 

 

 

but the order id only 25


at the end of the day the code will be good

Share this post


Link to post
Share on other sites

Ok I had to put back the old Catalog/checkout_payment.php but this file had the error on line 87

Missing argument 1 for javascript_validation() in /home/content/c/o/o/coolbug/html/includes/classes/payment.php on line 87

 

the sorce code is on

http://forums.oscommerce.com/index.php?s=&...ndpost&p=861127

 

i was wandering what should i do to fix that error

 

PS i still cant get to use the gift card to pay for anything

 

Test the acunt info http://forums.oscommerce.com/index.php?s=&...ndpost&p=861201


at the end of the day the code will be good

Share this post


Link to post
Share on other sites
Ok I had to put back the old Catalog/checkout_payment.php but this file had the error on line 87

Missing argument 1 for javascript_validation() in /home/content/c/o/o/coolbug/html/includes/classes/payment.php on line 87

 

the sorce code is on

http://forums.oscommerce.com/index.php?s=&...ndpost&p=861127

 

i was wandering what should i do to fix that error

 

PS i still cant get to use the gift card to pay for anything

 

Test the acunt info http://forums.oscommerce.com/index.php?s=&...ndpost&p=861201

Look, I don't know what you are doing. The links in the above posts do not serve any purpose.

 

If you are using ie, go to the page that is giving problems. Click view, go to source, press ctrl a, copy and paste into a reply to this post.

 

Did you change the necessary files, upload the new and changed files, and have you ever run the sql.


The Coopco Underwear Shop

 

If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

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

×