tedbooks Posted January 5, 2005 Posted January 5, 2005 hi i want to make the moneyorder module available only for some customers and some affiliates. like if $buss_account=1 and if customers_buisness_account from TABLE_CUSTOMER =1 i am trying to learn how to do this if i add the $this->enabled = false;by itself it makes the module not available but if i putif ($buss_account ==1) $this->enabled = false; it does not worki should be able to turn it on and off by changing the value but it just stays on at all time i am getting the $buss_account from application_top.php and i have the same conditional statment working in my right column so why wouldn't it work in the module is the question <?php /* $Id: moneyorder.php,v 1.10 2003/01/29 19:57:14 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ class moneyorder { var $code, $title, $description, $enabled; // class constructor function moneyorder() { global $order; $this->code = 'moneyorder'; $this->title = MODULE_PAYMENT_MONEYORDER_TEXT_TITLE; $this->description = MODULE_PAYMENT_MONEYORDER_TEXT_DESCRIPTION; $this->sort_order = MODULE_PAYMENT_MONEYORDER_SORT_ORDER; $this->enabled = ((MODULE_PAYMENT_MONEYORDER_STATUS == 'True') ? true : false); if ((int)MODULE_PAYMENT_MONEYORDER_ORDER_STATUS_ID > 0) { $this->order_status = MODULE_PAYMENT_MONEYORDER_ORDER_STATUS_ID; } if (is_object($order)) $this->update_status(); $this->email_footer = MODULE_PAYMENT_MONEYORDER_TEXT_EMAIL_FOOTER; } // class methods function update_status() { global $order; if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_MONEYORDER_ZONE > 0) ) { $check_flag = false; $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_MONEYORDER_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id"); while ($check = tep_db_fetch_array($check_query)) { if ($check['zone_id'] < 1) { $check_flag = true; break; } elseif ($check['zone_id'] == $order->billing['zone_id']) { $check_flag = true; break; } } if ($check_flag == false) { $this->enabled = false; } } //// my adjustment if ($buss_account ==1) $this->enabled = false; //end of my adjustment } function javascript_validation() { return false; } function selection() { return array('id' => $this->code, 'module' => $this->title); } function pre_confirmation_check() { return false; } function confirmation() { return array('title' => MODULE_PAYMENT_MONEYORDER_TEXT_DESCRIPTION); } function process_button() { return false; } function before_process() { return false; } function after_process() { return false; } function get_error() { return false; } Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.