I have made some modifications to my system to allow a second "wholesale" price for customers who have been approved as "retail" and items which have a wholesale price.
I need to look at the customer record during checkout/shipping calculations in order to determine if free shipping should be DISabled.
I cannot figure out why, but I can't access the TABLE_CUSTOMER, because there appears to be no "$_SESSION('customer_id') during the FREEOPTIONS.PHP processing.
It errors out with a "PHP Fatal error: Call to a member function Execute() on a non-object in ...modules\shipping\freeoptions.php on line 80"
Can somebody tell me how to get the customer info, using customer_id, in the freeoptions module?
The code I'm TRYING to use unsuccessfully is here
PHP Code:
// RCC 6/10/2007 Add wholesale pricing - SKIP FREE SHIPPING FOR WHOLESALE CUSTOMERS
// NOTE: removed next line for testing, to find why erroring out...
// if (isset($_SESSION['customer_id']) and $_SESSION['customer_id'] != '') {
$customer_is_wholesale = $db->Execute("select customers_whole from " . TABLE_CUSTOMERS . " where customers_id = '" . $_SESSION['customer_id'] . "'");
if ($customer_is_wholesale->RecordCount() > 0) {
if ($customer_is_wholesale->fields['customers_whole'] == '1') {
$this->enabled = false;
$this->ck_freeoptions_total = false;
$this->ck_freeoptions_weight = false;
$this->ck_freeoptions_items = false;
}
}
// }
// EOM RCC
Thanks!
Bookmarks