Zen Follower
- Join Date:
- Oct 2005
- Location:
- Finland
- Posts:
- 186
- Plugin Contributions:
- 0
Doing a tax-included/excluded override based on customers group
I'm trying to do a simple override, at least I thought so, to hide tax from prices for resellers.
Tried adding a new file to 'includes/extra_configures', 'includes/extra_datafiles' etc. but it seems like $_SESSION['customer_id'] isn't loaded at this point? Wonder where I went wrong, and if anyone can get me back on track.
<?php
// get customers group
if($_SESSION['customer_id']) {
global $db, $customers_group;
$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 reseller display prices ex tax
if ($customers_group == 'Reseller') {
define('DISPLAY_PRICE_WITH_TAX', 'false');
}