osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 

IF statement confusions.....

This is a discussion on IF statement confusions..... within the osCommerce 2.2 Modification Help forums, part of the osCommerce 2.2 Forums category; OK, I'm trying to get an order totals module to be activated/deactivated when certain conditions are met. Here's what I ...


Go Back   osCommerce and osCMax shopping cart software forums > osCommerce 2.2 Forums > osCommerce 2.2 Modification Help

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Closed Thread

 

LinkBack Thread Tools
  #1  
Old 08-27-2004, 07:56 AM
Member
 
Join Date: May 2004
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
seank123
Default IF statement confusions.....

OK, I'm trying to get an order totals module to be activated/deactivated when certain conditions are met.

Here's what I have:

Quote:
<?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();
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.

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #2  
Old 08-27-2004, 10:30 AM
Member
 
Join Date: Jan 2004
Location: edmonton, Alberta, Canada
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
peteyg
Default

Try this
$surch == 10;
if ($cc->cc_card_type != JCB)
$surch = 1;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #3  
Old 08-31-2004, 06:46 AM
Member
 
Join Date: May 2004
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
seank123
Default

Thanks Pete

Tried that, but results the same - it removes the module no matter what!

Any other thoughts??

Cheers
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Help with greeting statement? greg_pdq osCMax v1.7 Discussion 1 09-01-2004 09:50 AM


All times are GMT -8. The time now is 06:48 AM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax