Shipping API

Firstly we need to install the Shipping API and at least one shipping module; by default there is only one shipping module, which is Shipcalc, a module containing APIs for UPS and FedEx. We install them from the Modules section from Site building:

m

S hi pea le

5.X-3.4

UPS, Fedex shipping API for I-Cornmrrce. Depends on: Shipping API (disabled)

£nabie a shipping module API for etommerce-, You

m

Shipping API

5.X-3.4

must also install and enable at least one shipping module to use the API. Depends on; Store [enabled) Required by: Shiptalc (disabled)

The modules should now be installed.

If we now go to the Shipping section within the E-Commerce configuration area, we will see the following screen:

Shipping

Products

Australia Post

CanadaPost

UPS

USPS

Shipping partner

Operations

Australia Post

Configure

CartadaPost

Configure

UPS

Configure

USPS

Configure

This area lists the shipping APIs that are installed; the module includes APIs for:

• Australia post

These APIs are used to calculate shipping costs, as they communicate with the appropriate companies to determine the cost.

To use the Australia Post module we need to enter our Post code, Turn Around Time, and the Domestic Registered Post Cost. CanadaPost requires a Merchant

ID, which is obtained free when registering at: http://www.canadapost.com/ business/intsol/sb/ventureone/default-e.asp?source=web as well as a Potal Code and Turn Around Time.

UPS requires us to register and obtain an API key, and USPS requires us to register too. To register for a UPS account we need to go to: https://www.ups. com/servlet/registration?loc=en_US, and then to this website to obtain a developer API key: https://www.ups.com/e_comm_access/laServ?CURRENT_ PAGE=INTRO&OPTION=ACCESS_LICENSE&loc=en_US.

Once we have set up the APIs we need to set which shipping methods we want to use with which product type; we do this by clicking the Products link next to APIs.

Next we select the type of products for which we want to enable the shipping APIs. This then lists all of the different shipping methods available; we can select the ones we want to enable for that particular product type.

UPS:

SI

Next Day Air Early AM

El

Next Day Air

IB

Next Day Air Saver

3

2nd Day Air AM

m

2nd Day Air

HI

3 Day Select

HI

Ground

■>

Canada Standard

El

Worldwide Express

El

Worldwide Express Plus

0

Worldwide Expedited

With the shipping options configured and installed, we now have some extra settings available for each product. If we create a new shippable product or edit an existing shippable product there is a new section called Shipping methods.

This new section includes all of the shipping APIs that allow us to select the available shipping methods (the same as when we were editing the shipping settings) as well as settings for:

• Product Weight

• Product Height

• Product Length

Both values for width must be completed with the same value due to the way certain shipping companies use the data.

Both values for width must be completed with the same value due to the way certain shipping companies use the data.

By setting these options for each product our store can link into the various shipping providers' API, send these details to it and obtain an accurate shipping cost to charge the customer. The cost is added to the order summary towards the end of the shopping process.

Flexicharge

Flexicharge is a simpler method of adding charges to orders, instead of linking in with shipping providers; it allows us to create simple rules that add charges to the order, similar to how the tax system works, although it supports more options. Let's take a look!

The Flexicharge settings are found under E-Commerce configuration, and on the

Flexicharge page any charges previously set up are listed and there is the option to create a new charge, either a Site-wide charge (dependent on roles and products, and which can be used to reduce costs depending on conditions) or a Simple shipping charge. It is the Simple shipping charge we want, so let's create one of those.

The flexicharge page has a link called Unallocated locations along with options for:

• Enabling or Disabling a charge

• Base cost—A charge added to the item regardless of weight

• Cost per lb — Used to calculate shipping cost

This allows us to specify a standard shipping cost as well as a variable cost depending on the weight of the item, and of course we can enable or disable the charge at the check of a box.

These charges can be applied to a specific geographical region; we can even create a region and add countries or states to the region.

Doug wants to add a charge to a number of non-UK countries, so in order to create a charge for this we need to create the region. To create the region we need to follow the link to Shipping regions and configuration, which is in the same area as creating a new flexicharge.

Unallocated locations

These are the locations which have not been allocated to a region. You can edit your regions n the Shipping regions configuration page-

On the page to which we are taken to there is a link for Add region.

Region name:

Europe: Non-UK

The na-ne of this region. Example; i Interstate 'Taxable destinations'

Region used by:

Shipping *

The an i af E'ComrntiLfi t'jh.era thrs region vJII used

| Submit J

We can now assign countries to the region by clicking the Configure link next to the region. To assign a country to the region we click the radio button for Europe: Non-UK for each country we wish to assign to this region.

Non-UK

Algeria

# 0

Now if we return to the flexicharge area and select the region, we can create a charge for those countries.

The charge above would add a cost of $5 to each purchase in that region and an additional $1.20 for every pound of weight.

If creating this flexicharge results in an error, you may need to create a x } charge for all regions (all are on the same screen) at the same time, using 0 as the values.

There is only one final thing to do in order for this charge to work fully, and that is assign weight to the products.

Although there was a weight setting in the shipping modules earlier, if we are using a flexicharge, we need to set a separate weight setting (as flexicharge does not depend on having the shipping module installed, it cannot rely on using the shipping module's weight settings for each product).

If we create a new product or edit an existing product, we should now have options for weight under a heading of flexicharge attributes.

Flexicharge attributes

Additional attributes required for this product.

Product weight:

Now if we try to purchase a product that has a weight using a shipping address to which the flexicharge rule will apply, we should see an additional charge for the shipping.

Qtv

Item

Price

Subtotal

1

some test

331.02

$31.02 Change

Subtotal

$31.02

Tax

É5A3

Simple shipping

$11.00

Total

$47.45

It works! So we can now use flexicharges to add shipping charges to orders. Discounts

Don't forget, flexicharges can be used to create discounts too! This can be useful if we wanted to offer a discount on shipping when products are over a specific weight; this could be an incentive to customers put off ordering heavy or large products.

It works! So we can now use flexicharges to add shipping charges to orders. Discounts

Don't forget, flexicharges can be used to create discounts too! This can be useful if we wanted to offer a discount on shipping when products are over a specific weight; this could be an incentive to customers put off ordering heavy or large products.

Summary

In this chapter, we set up Doug's website to accept payments online using PayPal as well as looking at how payment gateways work and which other payment gateways are available. We also set up tax rules, configured shipping rules, and APIs to add shipping costs to orders. We now have a completely functioning store! In the next chapter we will look at getting our store online, as well as securing and maintaining our store.

Was this article helpful?

0 0

Post a comment