Setting up different shipping rates, to different countries

Hi there

I'm setting up a international e-commerce site www.vacuumrack.com in webflow, and use your foxycart 2.0. The site is divided in to Norway, Europe, and America.

We are a Norwegian company, that will ship from Norway, (and Netherlands in the future). For our shipping we will use the Norwegian postal service, that offers flatt rates based on "per kg", 1 rate for domestic, 1 rate for EU, and 1 rate for international.

I have been trying for quite some time to set this up and make it work how we need it to. I have used the categories to set up the VAT rates, that will be included for customers in EU / NO, and also use the function for flat rate shipping fees. This category is set to 7 kg, and i will also set up a similar category for smaler packages, maybe 2kg.

The problem is: If a EU customer enters the Norwegian site, he will get the Norwegian shipping rate, if a International customer enters the EU or Norwegian site, he will also get the lower shipping rates.

Is there a solution that based on what shipping adress (country) the customer enters he will be shown the correct shipping rate ( NO / EU / international ) no matter wich of the landing pages he / she enters?

I guess this demands some custom code, wich I'm not very good at. Therfore i would really appreciate if someone could write the exact code that i can paste directly in to some place.. wich i also need a thourogh explanation on where to paste.


Thanks in advance for any help

Best Regards

Carl - VacuumRack
Comments
  • fc_adamfc_adam FoxyCart Team
    @VacuumRack,

    Thanks for posting. The approach you're taking can work - but does have the downside you noted. There are ways you can make it work, like dynamically restricting the shipping countries supported based on the categories present in the cart.

    That said, we're currently finalising a new feature for the admin that will allow custom shipping logic added to set what rates the customer can see beyond the single flat rate amounts per category that are supported now. With this approach, you can just have categories based on the product types you're selling, rather than also needing categories per shipping destination.

    While we're getting close to launching that new feature, there is also an approach you can take now to achieve the same kind of set up using a snippet on your store. I'll follow up this post with a whisper with details for setting that up on your store. Then once the new feature launches we can follow-up with details on moving over to the new feature.
  • @fc_adam

    Thank you for helping. I managed to paste the correct codes, with your solution. This is exactly what I needed, exept one little problem:

    Now i can choose the fixed price per country / EU / world, but this dosent consider the currency. If i set the shipping price to 10 in the coding, and use the same adress in the cart (ship to), it will show:
    10 NOK if I enter the cart from the Norwegian site, wich is configured to NOK.
    10 EUR if I enter the cart from my European site, wich is configured to EUR.
    And 10 USD if i enter the cart from the American site that is configured to USD.

    When i tried to set this up, using flat rates in the "categories", i did not have this problem because A category was connectet to the add to cart button, with one category per site / currency. In that way i set the shipping rate to e.g. 100 in the NO category, and 10 in the EU category wich is about the same price, but different currencies.

    So, how do I solve this problem? is there a way to connect these rates / part of code to a spesific category?


  • fc_adamfc_adam FoxyCart Team
    @VacuumRack,

    That's a great question, and it is possible to detect the template set that the customer is using within the logic, so you could key off of that to decide what the cost should be. That'll be a more direct route than relying on the category.

    I'm sorry as well, I just realised in the information I whispered to you that it didn't include the code I had made. It sounds like you got it working anyway based on the documentation which is great! I'll whisper that to you now, and it includes an update to it to allow for different currencies for each rate.
  • @fc_adam

    Tank you again. This works great for "Template set", wich gives the correct currency!
    This works great for my main product that has a weight of 7kg. But if I'm sending my customers spare parts with a weight of e.g. 2kg i also need to have a shipping rate for that.

    This was why i wanted to also connect it to the product category, where i could have a category for 7kg and one for 2kg.

    Also if you can explain the text that shows for shipping. Why it is divided in two?:
    ------1---------- ------2------
    'Norway Post', 'Standard'
  • fc_adamfc_adam FoxyCart Team
    @VacuumRack,

    I'm glad that's working for you!

    In terms of the weights - instead of handling that with categories, we'd recommend passing the weight of the product as a product attribute in your add to cart links/forms - and then the custom shipping logic can check what the total weight is to decide what the shipping rate should be.

    Could you confirm for us the different tiers you want to support based on weights? Is there any other conditions that you need to account for in the shipping?
  • @fc_adam

    With the Norwegian postal service we use, they have a flat Worldwide rate of 309 NOK in handling fee, then in addition they charge 28 NOK per kg for domestic, 45 NOK per kg for EU, and 103 NOK per kg for international.

    Some times e.g. in Norway there are cheaper shipping alternatives. therefore we need to be able to change the rates to what fit's us (as is no problem with your solution so far). and for Norway we may also have free shipping, (still no problem with your solution, where we can type 0,- and write "free shipping").

    Right now we only have one product + spare parts, that we are starting the web shop with. We expect this to grow to more products in the near future, but we dont know the exact weight of these products at this time. therefore we need to be able to add a price for the shipping of a specific product. this price is divided in to the 3 different price sones and reflects also the different currencies from wich country site of the website the customer has entered.

    E.g. using the method you have given us, where we can enter the price we want to charge per currency and shipping sone, but also have the possibility to set this price for each product.

    Hope this clarifies it.
  • fc_adamfc_adam FoxyCart Team
    @VacuumRack,

    Thanks for listing out the requirements - that's really helpful! Would it work for your needs then to check what the total weight of the cart is, round it up to the nearest kg, and use that to calculate the shipping rates for each region?

    So for example, if the cart had 3kg work of products in it, the charge for domestic would be 393 NOK.

    By basing it on the weight, you can add any new products you need over time, and the dynamic shipping rates will continue to be correct without needing to make any other changes.
  • @fc_adam

    Yes, that will work perfect, as long as the currencies, domestic / eu / international calculation, and posibility to name the shiping e.g. "free shiping" with value of 0,- is stil there. with this option when the shipping price is not per product, a option to set free shipping of products above a sertant price would be nice.
  • fc_adamfc_adam FoxyCart Team
    @VacuumRack,

    Thanks for confirming - we'll whisper you some new logic that should cover that.
  • @fc_adam

    Thank you so mouch for your help! It all seems to work perfect now.
  • @fc_adam

    a final question:

    Is there a way to change shipping text idividual for each "shipping category" and valuta like this:


    if (tier1.indexOf(address.country) > -1) {
    // Norway
    var prices = {
    "DEFAULT": defaultHandling + (weight * 28),
    "EUR": EURHandling + (weight * 2.89), Buy from Vacuumrack NO to get free shipping
    "NOK": 0 + (weight * 0), Free shipping in Norway
    "USD": USDHandling + (weight * 3.34) Shipps from US
    };
    FC.customFlatRates.add(1, prices[FC.json.template_set], 'Norway Post', 'Standard');


  • fc_adamfc_adam FoxyCart Team
    @VacuumRack,

    That is possible - but before we update the code here, I thought I'd just clarify that whatever values are entered for the shipping rate is what will display on their receipts. So for example, if someone purchased from Norway in the EU store, the shipping rate description shown on their receipts would be "Buy from VacuumRack NO to get free shipping". If someone purchases from the USD store from Norway, their shipping rate description on the receipt would be "Ships from US".

    Is that what you're looking to achieve? Or were you more wanting to be able to include some extra notes for customers if there was a better option available - like pointing Norway based customers to purchase from the NO store for free shipping?
  • @fc_adam

    It was what i wanted to achieve, because i want to write "free shipping from norway" for NO customers, and i have now in your code set the price to 0 NOK,- the problem with that, right now is that for EUR there is a shipping price, to prevent customers in NO to get the product ceaper from eu, wich is a higher cost for us with currency exchange etc.
    Therefore we want to have posibility to write the shipping info behind evry shipping + price option.

    But i dont know what the posibilities are to point NO customers to the NO store?

    I would like the solution for every shipping + price anyways.. giving us both solutions makes it more flexible, and it is sometimes hard to see what changes we may need in the future, as this project develops on the way.
  • @fc_adam

    What i also now realize that we need is the code to add a extra shipping option. can this also be added to the code? e.g.:

    if (tier1.indexOf(address.country) > -1) {
    // Norway
    var prices = {
    "DEFAULT": defaultHandling + (weight * 28),
    "EUR": EURHandling + (weight * 2.89), Buy from Vacuumrack NO to get free shipping
    "NOK": 0 + (weight * 0), Free shipping in Norway (pickup point)
    "NOK": 150 + (weight * 0), Home delivery
    "USD": USDHandling + (weight * 3.34) Shipps from US
    };
    FC.customFlatRates.add(1, prices[FC.json.template_set], 'Norway Post', 'Standard');


    So that for NOK (or if we add the code to another valuta) it is two different alternatives to choose from in the cart.
    * free shipping in norway (pickup point) 0,-
    * Home delivery carge 150,-

  • fc_adamfc_adam FoxyCart Team
    @VacuumRack,

    Ok no problems - I'll whisper you some updated code that allows for more flexibility in naming each rate differently.
Sign In or Register to comment.