By mistake i have deleted "Anywhere else" in shipments, how can i take it back?
Also, I would like to restrict some shipping methods to regions inside Spain. I can see i can adjust the fee for a region, but how could i create a method only available for an specific region and not for others?
You can add the everywhere else country back by looking for it in the add country ... I think it's named "Everywhere Else"
For regions, you can add regions via country code to the merchello.config file (just follow Canada ... shorter than US) as an example. You will have to make up a region code if there is not one.
Once entered, the Spanish regions will appear in the back office UI.
Thanks Rusty, thats what i did, i already have my regions.
As i understand, once i have my regions i can adjust the fees for each region.
What i need is to restrict the shipping method for a region inside a country.
An USA example would be to have a method only available for Alabama and another method for the rest of regions of USA. Is that possible? I have tried with no success.
Ah - there's really no way to do that in the Core. It could be pretty easily accomplished by filter the returned shipping methods in the controller based on the region in passed and return the filtered list to the UI.
Rusty, it works as expected by default, the problem was that i was not passing the region code.
So if you check only some regions (letting the fee as zero) the method only becomes available for that regions.
No, no, i have not changed anything in the way merchello works.
For instance, you need a method only for Alabama and another for the rest of usa regions. Enter the backoffice and add USA country.
Then add the Alabama method and set your prices ranges. In regions, only check Alabama (leave zero fee).
Add the other method and set your prices ranges again. In regions check all the regions but Alabama (leave zero fee).
Then this is my code:
var shipAd = new Address()
{
AddressType = AddressType.Shipping,
CountryCode = yourCountryCOD,
Region = yourRegionCOD
};
var shipment = Basket.PackageBasket(shipAd).FirstOrDefault();
var shipmentRateQuotes = shipment.ShipmentRateQuotes().ToArray();
Problem with shipping methods
By mistake i have deleted "Anywhere else" in shipments, how can i take it back? Also, I would like to restrict some shipping methods to regions inside Spain. I can see i can adjust the fee for a region, but how could i create a method only available for an specific region and not for others?
Hey Tito,
You can add the everywhere else country back by looking for it in the add country ... I think it's named "Everywhere Else"
For regions, you can add regions via country code to the merchello.config file (just follow Canada ... shorter than US) as an example. You will have to make up a region code if there is not one.
Once entered, the Spanish regions will appear in the back office UI.
Thanks Rusty, thats what i did, i already have my regions. As i understand, once i have my regions i can adjust the fees for each region. What i need is to restrict the shipping method for a region inside a country. An USA example would be to have a method only available for Alabama and another method for the rest of regions of USA. Is that possible? I have tried with no success.
Ah - there's really no way to do that in the Core. It could be pretty easily accomplished by filter the returned shipping methods in the controller based on the region in passed and return the filtered list to the UI.
Rusty, it works as expected by default, the problem was that i was not passing the region code. So if you check only some regions (letting the fee as zero) the method only becomes available for that regions.
Awesome - so to clarify, you are filtering on positive (non zero value) overrides ... right? Sounds like a neat solution!
No, no, i have not changed anything in the way merchello works.
For instance, you need a method only for Alabama and another for the rest of usa regions. Enter the backoffice and add USA country. Then add the Alabama method and set your prices ranges. In regions, only check Alabama (leave zero fee). Add the other method and set your prices ranges again. In regions check all the regions but Alabama (leave zero fee).
Then this is my code:
Hi Rusty, When I Add a region code in merchello.config throw me an error
When i delete it. my page works normally.
This is my code in merchello.config
Im doing something wrong??
Thanks in advance
Sorry... i found the error, i have a code duplicate.... what a dummy way to make an error. thanks anyway
is working on a reply...