Re: different shipping for different customers
I have a similar situation, where we need to offer different shipping for retail or wholesale customers. I have not installed the Dual pricing or any other wholesale pricing module yet and first would like to know if that is the best option. We only have two customer types, retail and wholesale. Retail will have a flat rate of $5.00 per order and wholesale will need to be charged actual fedex ground rates. (I assume I will also need to install the fedex module but have not done that yet either).
So is the dual pricing module the best option and how do I make mods to get this working correctly?
Thanks,
Paul
Re: different shipping for different customers
You need to install the FedEX shipping module and make sure it is working ...
Once working, you need to customize the Flat Rate flat shipping module to only work for regular customers by setting the $this->enabled to false when the customer is a wholesale customer ...
Then customize the FedEX shipping module to set the $this->enabled to false when the customer is a regular customer ...
Re: different shipping for different customers
Okay here is what I have tried and it did not seem to work, but maybe I am missing something. I have installed all the shipping modules and have them configured and working, fedex, fedex grd, and usps for our wholesale customers and then it should be just flat rate for our retail customers. To implement wholesale pricing we went with the group pricing per item module because we will have different types of wholesalers and need to offer multiple levels of pricing based on customer type. Now I inserted this:
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'];
$check_flag = false;
if($customer_group = $db->Execute($customer_group_query)) {
$check_flag = true;
}
}
at line 54 in the /includes/modules/shipping/fedexexpress.php file right before:
if ($check_flag == false) {
$this->enabled = false;
}
Then tested with a retail customer account but the fedex pricing still shows up. Does this look like it will work? What did I do wrong? Do I need to remove and then add back the module to get it work?
Thanks,
Paul
Re: different shipping for different customers
I figured out my problem. I Changed the code to this:
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 == NULL) {
$this->enabled = false;
}
}
}
And then I inserted it at the top of the function for fedexexpress and WHOO HOO, it works.
Re: different shipping for different customers
I have installed the dual pricing option and need to price wholesale customers at flat rate ($2 per order) and retail customers at table rate (25:15,50:19,75:23,100:27,125:31,150:35,175:39,200:43).
How can I set shipping so that Wholesale customers are offered only flat rate and retail customers only table rate?
Thank you,
Re: different shipping for different customers
I have the same issue as above. I have used grouping functionlity to create a wholesale group, and also dual table shipping extention to create a shipping charges for the whlesale. The retail (nongrouped) customer can see correct information - only the retail shipping charge, however, the wholesale (grouped customer) can see both shipping charges. I have tried adding to the wholesale table (in /httpdocs/includes/modules/shipping) the same code as above, but its not working... I still get shown both shipping charges.
(Don't know if this would make any difference but) I have also setup (in the admin side) the two shipping modules to have equal priority of 0.
Thanks,
Maja
Re: different shipping for different customers
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 ...
Re: different shipping for different customers
Quote:
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
Re: different shipping for different customers
Example for the Flat Rate flat.php shipping module:
Code:
// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false);
}
if (!IS_ADMIN_FLAG) {
// disable if customer is wholesale
$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'];
$customer_group = $db->Execute($customer_group_query);
if ($customer_group->fields['group_name'] == 'Trade Group') {
$this->enabled = false;
}
}
Re: different shipping for different customers
I'm having a problem with the solution above. I'm using dual pricing and using some of the info in these posts I was able to make separate shipping for wholesale and retail by doing this
In includes/modules/shipping/zones2.php file
Around line 95 find
// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_ZONES2_STATUS == 'True') ? true : false);
}
ADD UNDERNEATH IT
// disables wholesale shipping when you are retail customer
$this->enabled = ((MODULE_SHIPPING_ZONES2_STATUS == 'True') ? true : false);
if($_SESSION['customers_wholesale']=='1' && $this->enabled==true)
{
$this->enabled=true;
}else{
$this->enabled=false;
}
In includes/modules/shipping/zones.php file
Around line 95 find
// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_ZONES_STATUS == 'True') ? true : false);
}
ADD underneath it
// disables retail shipping when you are wholesale customer
$this->enabled = ((MODULE_SHIPPING_ZONES_STATUS == 'True') ? true : false);
if($_SESSION['customers_wholesale']=='0' && $this->enabled==true)
{
$this->enabled=true;
}else{
$this->enabled=false;
}
This works....except when a NEW customer signs up for a new account, and goes to checkout they get this error: Sorry, we are not shipping to your region at this time. BUT if they logoff and log back in, it works =) Is there a small piece of code that is incorrect or a piece of code that is missing that would make it not do this? ANY help would be greatly appreciated!!!
Thank you!
=0)