OK, I'm trying to get an order totals module to be activated/deactivated when certain conditions are met.
Here's what I have:
What I want to happen is: If the credit card type is a JCB card (as determined by the cc.php and cc_validate.php routine), make this module active - if it's something else, deactivate it.<?php
/*
$Id: ot_surcharge.php,v 1.0 2003/06/19 01:13:43 hpdl wib $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2002 osCommerce
Released under the GNU General Public License
*/
if ($cc->cc_card_type == JCB) {
$surch = 10;
} else {
$surch = 1;
}
class ot_surcharge {
var $title, $output;
function ot_surcharge() {
$this->code = 'ot_surcharge';
$this->title = MODULE_PAYMENT_TITLE;
$this->description = MODULE_PAYMENT_DESCRIPTION;
if ($surch == 10) {
$this->enabled = ((MODULE_PAYMENT_STATUS == 'True') ? true : false);
}
$this->sort_order = MODULE_PAYMENT_SORT_ORDER;
$this->include_shipping = MODULE_PAYMENT_INC_SHIPPING;
$this->include_tax = MODULE_PAYMENT_INC_TAX;
$this->percentage = MODULE_PAYMENT_PERCENTAGE;
$this->minimum = MODULE_PAYMENT_MINIMUM;
$this->calculate_tax = MODULE_PAYMENT_CALC_TAX;
// $this->credit_class = true;
$this->output = array();
As it is, nothing happens - the module is deactivated no matter what card-type is used.
What am I doing wrong?? Is the IF and ELSE statements all wrong?
Any help would be very much appreciated - I've spent ages trying to sort this one out and it's got very, very frustrating!!![]()
Cheers




LinkBack URL
About LinkBacks






Bookmarks