Originally Posted by
Ajeh
You can test for the customer's group and and enable and disable the modules that way by controlling the $this->enabled based on the results ...
I thought I was doing that (it doesn't help that my php is a bit too rusty). I have got one file table.php where I'm testing if the customer's group is NULL (which would mean it is retail) and disabling the wholeasle shipping module by doing $this->enabled = false.
I have also got another tableretail.php where I'm testing the opposite. The first (above works) but this one doesn't. In a case the customer is wholesale (i.e. it belongs to this "Trade Group") both modules are displayed. Here is my code:
PHP Code:
// disable if customer is wholesale
if($_SESSION['customer_id']) {
$customer_group_query = "select gp.group_name
from " . TABLE_CUSTOMERS . " cu
left join " . TABLE_GROUP_PRICING . " gp on cu.customers_group_pricing=gp.group_id
where cu.customers_id = " . $_SESSION['customer_id'];
if($customer_group = $db->Execute($customer_group_query)) {
$customers_group=$customer_group->fields['group_name'];
if($customers_group == "Trade Group") {
$this->enabled = false;
}
}
}
What am I doing wrong?
Thanks,
Maja
Bookmarks