Select version
v7.7 v7.6 v7.5 v7.3 v7.1 v7.0 v6.8 v6.7 v6.6 v6 v5 v4 v3 v2

Setup Multiple Shipping Methods for Multiple Countries

In some cases you do not want your delivery drones to fly across the atlantic ocean to deliver your hardware to the customer. Luckily uCommerce offers great capabilities to prevent those scenarios. In this article we'll cover how exactly that works and how easiy it is to limit available shipping methods for your customers based on either their billing address, delivery address or something completely different.

If you're interested

Setting Up Your Shipping Methods

Shipping methods can be created directly in the backend. If you're in how shipping methods works I recommend that you take a look at How to configure a shipping method.

Custom prices for shipping methods

The Single price that allows to be configured in the pricing tabs on your shipping method is some times enough for calculting the shipping costs. However if the costs are more dynamically based on some other criteria, custom calculations may be required. In that case I recommend that you take a look at How to create a custom shipping method service.

Dividing shipping methods into different stores and countries

Under the access tab on each shipping method you have the ability to divide its access per store and country.

image

Front-end API

On the front-end it's really easy to figure out what shipping methods is available for the customer. The only thing you need to do is the following:

    
    
    	UCommerce.Api.TransactionLibrary.GetShippingMethods(UCommerce.EntitiesV2.Country);
    
    

The country passed into GetShippingMethods can be any Country coming from where-ever. The available shipping methods is per design not tied to either Shipping or Billing country. If you prefer you can even use GEO-location as base for what country is needed.

Once you pass in the country, uCommerce will automatially figure out the store your customer are visiting and use that as base for what shipping methods should be returned. Thus the shipping methods will be filtered on store first and secondly per country.

Once shipping methods has been returned you just need to create it using the following:

    
    
    	UCommerce.Api.TransactionLibrary.CreateShipment(shippingMethodId, overwriteExisting: true);
    
    

Of course you're free to let the customer choose, but if there for some reason is only a single option you can easily just skip the step.

Once the shipment is being created the calculation of the shipping costs will be calculated by the service attached to the shipping method.

uCommerce Aps - Studsgade 29B - 8000 Aarhus C - Denmark
Phone +45 61 799 997 - Email info@ucommerce.dk uCommerce logo