Forums / General Questions / How to hide or disable the big royal mail mod in certain country?

How to hide or disable the big royal mail mod in certain country?

Locked

Started by gamenano on 6 Aug 2009, 12:59 PM · Views: 995

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
6 Aug 2009, 12:59 PM
#1
gamenano avatar

gamenano

Zen Follower

Join Date:
Apr 2009
Location:
London
Posts:
127
Plugin Contributions:
0

How to hide or disable the big royal mail mod in certain country?

:hug:Hi,

This is the situation, I have warehouse in the UK and I also have an warehouse in france. If customer buy from us in any part of the world apart from France, we will ship from the UK. But if the shipping address is in france, we will ship from france.

So this is what I did. I have installed "The Big Royal Mail" mod and the "La poste" French shipping mod.

I have disable the ship international option in the french shipping mod. would be nice to have a hide invalid shipping option. But that is ok.

The problem I have got. Customer from france will see two set of shipping option, French and UK. I guess it will look very strange to them.

So I wonder, would that be a way to** hide or disable Big Royal Mail if the shipping address is in France.**

Thank you in advance for help and suggustion.

Genesis

6 Aug 2009, 3:00 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: How to hide or disable the big royal mail mod in certain country?

Create a zone for all countries except France, and set your Big Royal Mail module to only show if the customer's shipping address is in that zone.

And, create another zone for France, and limit your La France addon to only the France zone.

Creating a zone:

  1. Admin->Locations/Taxes->Zone Definitions.
  2. Click Insert
  3. Enter a name for the zone and a description to help you understand what you're using this zone for (this is just an internal name/description, seen only by you). Save by clicking the Insert button.
  4. Now that you have a zone named, you need to actually specify the countries/regions that apply for that zone.
    So, with that new zone highlighted (it will be if you just created it), click on the "Details" button.
  5. Now click the Insert button
  6. Choose the country and zone from the list. After choosing a country, if your zone applies to the entire country, you can leave the zone set to "All Zones". Click Insert to save.
  7. If you have more countries to add to this same zone definition, repeat steps 5 & 6 as necessary.

Assigning a zone to the shipping module:

  1. Admin->Modules->Shipping
  2. Click on your shipping module, then click Edit
  3. Scroll down to the "Zone" choice, and from that pulldown, select the zone that you want this shipping module to be limited to. Save the change.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

6 Aug 2009, 3:56 PM
#3
gamenano avatar

gamenano

Zen Follower

Join Date:
Apr 2009
Location:
London
Posts:
127
Plugin Contributions:
0

Re: How to hide or disable the big royal mail mod in certain country?

Thank you Br Byte,

I have follow your very detailed instruction to added a zone.

However, when I try to instruct the shipping module to use the zone I have just defined I can not find the drop down,

Now is that becuase of the shipping mod or is me? :oops:

6 Aug 2009, 6:32 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: How to hide or disable the big royal mail mod in certain country?

Must be a limitation of the shipping module. I guess the author of the addon decided they didn't want to include the code to handle that feature.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

6 Aug 2009, 7:51 PM
#5
gamenano avatar

gamenano

Zen Follower

Join Date:
Apr 2009
Location:
London
Posts:
127
Plugin Contributions:
0

Re: How to hide or disable the big royal mail mod in certain country?

yeah, must be.

I am looking at some code on the mod.

There is a line in teh rmamassmallpacket.php as follow:

<SNIP: large amount of PHP code removed by moderator >

But cannot find where to put a code to not allow this mod to use in france.

Could you help please.

Many many thanks.

:hug: Genesis

6 Aug 2009, 7:54 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: How to hide or disable the big royal mail mod in certain country?

I recommend that you ask the author of that addon for specific help, or at least discuss your needs in that module's support thread.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

6 Aug 2009, 7:57 PM
#7
gamenano avatar

gamenano

Zen Follower

Join Date:
Apr 2009
Location:
London
Posts:
127
Plugin Contributions:
0

Re: How to hide or disable the big royal mail mod in certain country?

Oh oh.....

Maybe something here.

// ship to country is invalid for this service
if ($dest_zone == 0) {
$this->enabled = false;
return ;
}else{

    $this->enabled = false;  // enabled set to true if valid shipping weight found

    $zones_cost = constant('MODULE_SHIPPING_RMAMASSMALLPACKET_ZONES_COST0_' . $dest_zone)
       . ',' . constant('MODULE_SHIPPING_RMAMASSMALLPACKET_ZONES_COST1_' . $dest_zone)
       . ',' . constant('MODULE_SHIPPING_RMAMASSMALLPACKET_ZONES_COST2_' . $dest_zone)
       . ',' . constant('MODULE_SHIPPING_RMAMASSMALLPACKET_ZONES_COST3_' . $dest_zone)
       . ',' . constant('MODULE_SHIPPING_RMAMASSMALLPACKET_ZONES_COST4_' . $dest_zone)
       . ',' . constant('MODULE_SHIPPING_RMAMASSMALLPACKET_ZONES_COST5_' . $dest_zone);

Maybe I can add some code here to stop the mod to all French destinations. But I don't know what code to add....

:lookaroun

6 Aug 2009, 7:58 PM
#8
gamenano avatar

gamenano

Zen Follower

Join Date:
Apr 2009
Location:
London
Posts:
127
Plugin Contributions:
0

Re: How to hide or disable the big royal mail mod in certain country?

And also something here....

// check that it is a valid country being shipped to.
$dest_country_code = $order->delivery['country']['iso_code_2'];
$dest_country_title = $order->delivery['country']['title'];
$dest_zone = 0;

    for ($i=1; $i<=$this->num_zones; $i++) {
      $countries_table = constant('MODULE_SHIPPING_RMAMASSMALLPACKET_ZONES_COUNTRIES_' . $i);
      $country_zones = preg_split("/,/", preg_replace('/\s*/','',$countries_table) );
      if (in_array($dest_country_code, $country_zones)) {
        $dest_zone = $i;
        break;
      }
    }

:frusty: