Hide Zone Shipping from Group
Hi,
I am trying to hide Zone Shipping from a certain group. I have done this for another shipping module by entering this code:
Code:
// do not show to customers_group_pricing 32
$chk_group_query = $db->Execute("select customers_group_pricing from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");
if ($chk_group_query->fields['customers_group_pricing'] == 32) {
$this->enabled = false;
}
I am pretty sure that the code will remain the same for the zone module; however, I don't know where in the file I should put the code... everywhere I have tried just breaks the shipping page and prevents it from loading.
Any help is appreciated.
Thanks!
Re: Hide Zone Shipping from Group
Put the code under:
Code:
// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_ZONES_STATUS == 'True') ? true : false);
}
But add to it, under the line:
Code:
// do not show to customers_group_pricing 32
the line:
Re: Hide Zone Shipping from Group
excellent! worked like a charm. thanks so much!
Re: Hide Zone Shipping from Group
Thanks for the update that this was able to work for you ... :smile:
Re: Hide Zone Shipping from Group
Sorry to add to this thread but I'm trying to do something similar but rather than hiding from a Group I need to hide from a destination country. Reason is I have two zones shipping modules and want one to manage UK shipping and the other International. (Usual sledgehammer to crack a nut approach but there is method in my madness). Problem is they both appear all the time.
I need similar code to above but can't work out the expression to compare the country code. Simplified version is as follows:
// do not show to destination country UK
$value = expression to return 2 digit iso country code
if ($value <> UK) {
$this->enabled = false;
}
I have played around with $dest_country = $order->delivery['country']['iso_code_2']; but can't seem to get it working. If anyone can point me in the right direction it would be appreciated.
Re: Hide Zone Shipping from Group
What shipping modules are you trying to use for this?
Re: Hide Zone Shipping from Group
Thanks for your reply.
zones.php
I have a second one, zones2.php and I only want one to appear at a time. I've edited the language files differently for both hence the reason for using 2 rather than just increasing the number of zones.
Re: Hide Zone Shipping from Group
What are your settings on the Zone Rates zones shipping module in the right hand panel?
What are your settings on the Zone2 Rates zones2 shipping module in the right hand panel?
Re: Hide Zone Shipping from Group
zones - I have UK as zone 1
zones2 - I have ROW as zone 1 and EU as zone 2. I will add more zones later.
if someone in the UK goes to checkout zones displays correctly but zones2 also displays stating option not available
if someone from EU or ROW goes to checkout zones2 displays correctly but agan zones dispalys stating opion not available
I thought if I checked if UK or not in both I could disable one so not to confuse customer. More worrying I now seem to have lost both from Admin although they still work fine in the cart so may have screwed something in experimenting.
Thanks again for your interest.
Re: Hide Zone Shipping from Group
The 2 character ISO code for United Kingdom is: GB ...
Set that on Zone 1 ... in Zone Rates zones ...
There is no EU ISO code, you need to list the 2 character ISO code of each country you want ...
The 2 character ISO Codes can be seen in the Locations / Taxes ... Countries ...
But before worrying about Zone2 Rates zones2 ... why do you think you need a separate shipping module file? Zone Rates zones has multiple Zones that you can setup ... by default that is 3 Zones ... if you need more Zones, you can customize it to add more ...