Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tito 313 posts 622 karma points
    May 09, 2016 @ 09:59
    Tito
    0

    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?

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    May 09, 2016 @ 22:44
    Rusty Swayne
    0

    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.

  • Tito 313 posts 622 karma points
    May 10, 2016 @ 08:26
    Tito
    0

    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.

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    May 10, 2016 @ 20:00
    Rusty Swayne
    0

    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.

  • Tito 313 posts 622 karma points
    May 11, 2016 @ 12:11
    Tito
    0

    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.

  • Rusty Swayne 1655 posts 4993 karma points c-trib
    May 12, 2016 @ 14:05
    Rusty Swayne
    0

    Awesome - so to clarify, you are filtering on positive (non zero value) overrides ... right? Sounds like a neat solution!

  • Tito 313 posts 622 karma points
    May 12, 2016 @ 15:34
    Tito
    101

    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();
    
  • Jesus 7 posts 75 karma points
    Sep 20, 2017 @ 19:27
    Jesus
    0

    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

     <region code="MX" requirePostalCode="false">
      <provinces>
        <province name="Aguascalientes" code="AG" />
        <province name="Baja California" code="BC" />
        <province name="Baja California Sur" code="BS" />
        <province name="Campeche" code="BC" />
        <province name="Chiapas" code="CP" />
        <province name="Chihuahua" code="CH" />
        <province name="Coahuila" code="CO" />
        <province name="Colima" code="CL" />
        <province name="Ciudad de México" code="CM" />
        <province name="Durango" code="DN" />
        <province name="Estado de México" code="EM" />
        <province name="Guanajuato" code="GJ" />
        <province name="Guerrero" code="GR" />
        <province name="Hidalgo" code="HD" />
        <province name="Jalisco" code="JL" />
        <province name="Michoacán" code="MC" />
        <province name="Morelos" code="MR" />
        <province name="Nayarit" code="NY" />
        <province name="Nuevo León" code="NL" />
        <province name="Oaxaca" code="OX" />
        <province name="Puebla" code="PB" />
        <province name="Querétaro" code="QT" />
        <province name="Quintana Roo" code="QR" />
        <province name="San Luis Potosí" code="SP" />
        <province name="Sinaloa" code="SL" />
        <province name="Sonora" code="SN" />
        <province name="Tabasco" code="TB" />
        <province name="Tamaulipas" code="TM" />
        <province name="Tlaxcala" code="TX" />
        <province name="Veracruz" code="VC" />
        <province name="Yucatán" code="YT" />
        <province name="Zacatecas" code="ZC" />
      </provinces>
    </region>
    

    Im doing something wrong??

    Thanks in advance

  • Jesus 7 posts 75 karma points
    Sep 20, 2017 @ 21:13
    Jesus
    0

    Sorry... i found the error, i have a code duplicate.... what a dummy way to make an error. thanks anyway

Please Sign in or register to post replies

Write your reply to:

Draft