Shopping Cart Configuration - Shipping
Shipping Calculator Types
The SonicSpider Shopping cart system has a plugin architecture for shipping calculation. There are currently two plugins available
- USPS rate calculator
- INTERNAL custom rate calculator
This document will introduce you to the basic settings and concepts and focus on setting up and using the USPS and INTERNAL shipping calculators.
While in the Administration module, Click the menu "System Settings" to access the configuration options.
System Settings & Shipping Configuration
![]()
First you need to make sure the shipping system is turned on. Check that the above setting is "true" and if not change it and click the button "Update"
IMPORTANT: When ever you make a change to any setting you MUST remember to click the "Update" button FOR THAT SETTING.
Note: In the following discsussions the above setting would be referred to as "shipping.system.enable=true", where the "dots" refer to each part of the property structure: "function.type,name=value"
Note: Each Product has a "Packaging" field that you can set for each product. The following discussion does not include that parameter. This is considered an "extra charge" that is added on a "product by product" basis and is "per product item". You can also used this setting to make "adjustments" to the calculations you need to see the system generate.
Next, to select the desired calculator, the default setting is shown below:

If you want to use the INTERNAL calculator, that will be discribed below your settings will look lik this:

There are three sets of these settings for each of the general categories: "air, ground, and regular". All three need to be changed and should all be the same. YOU CAN NOT MIX AND MATCH SHIPPING CALCULATOR SYSTEMS.
Shipping Category Labels

There are three general categories that you can assign in any way you want. It is important that you understand that the terms "air, ground, and regular" are just for internal use and you can re-define them in any way you desire. Change the labels to suite your needs. Make sure you inderstand that these three categories are used through out this discussion and they refer to general "categories" that you can customize.
USPS Calculator
The USPS Calculator using the USPS Web Tools Service API to get rates from the USPS system based on four parameters:
- Weight
- Volume
- Box Size
- Service Type
Within the system you need to insure that the Weight for each product is configured and if possible the "volume" (width and length). This is configure in each product, therefore you would need to edit each product and supply these values.
The box size is configured internally for you using the "ITEMS" table (This will be surface to the admin console in the near future). This is where you provide the system with some estimated "numbers per box" and how that would relate to the box size. There is also an override for this settingin the product table where you can force the box size based on what you feel is appropriate.
Service types
The basic service types for the customer to view are:
- Priority
- Express
- Parcel
You can also customize on a product basis the following additional service types:
- BPM
- Media
- Library
- First Class
Factor Types
There are two "factor" types; item and bulk. The default is "item" but often the "bulk" setting will provide more consistent results where customers are purchasing larger quantities of a single item because the bulk setting works "per line" versus "per item"
THE INTERNAL calculator ONLY uses the "item" type.
What remains is to do some testing with the system so that you find the right balance between the four parameters and the cost you want to charge for shipping.
INTERNAL Calculator
The internal calculator depends on the following settings to work correctly:
- Product "Packaging" field
- Product "Weight" field
- System Region Zone table
- System State Zone table
- System Factoring settings
- System Weight cost settings
We well be reviewing the settings found in the "System Settings" module:
System Settings & Shipping Configuration
Region Zone Table

These setting are made based on the three general categories "regular, ground, and air" These categories are defined in the "labels" setting described above.
State Zone Table

You can assign a charge to each state as well. This is frequently used for "special" charges that are unique to that state.
Shipping Factoring

This allows you to control how the charges are dispursed in situations where there are mulitple products purchased. In the example above the first item would be charge the "full" rate, the second item by 50%, the third by 25% and the remaining items by 15%. This can be turned off by setting the enable to false.
Factor Types: shipping.factor.type
There are two "factor" types; item and bulk. THE INTERNAL calculator ONLY uses the "item" type.
Weight Cost Settings

The weight is considered an "optional" setting and will be ignore for a given product if that is not set for that product. IF it is set then these setting will take effect and that setting is the cost per unit. The above setting would read "$1.00 per pound" The units are "oz, lbs, grams, kilograms" The units in the products can be different and the system will convert those units to the unit shown here. (For example if a product is in grams, the system will convert the grams to lbs before doing this calculation)
How does all if this come together?
Using the flow chart below as a reference:
- System looks up the assigned shipping values for:
- State
- Region by zone by mode (air,ground,regular)
- Country (if configured)
- Country region by mode (air, ground, regular)
- This value is summed and use as a "Base" value when calculating each line item.
- The system then walks the cart line items and:
- The "Base" is run through the "factoring engine" for each line item and multiplied times the quantitiy
- The Weight factor is calculated if defined for that product
- These two (#1 and #2) are added together and recorded per line item
- A running total is recorded as "BaseTotal"
- Packaging is summed as a running Total
- System takes the Packaging total and records in master invoice
- System takes BaseTotal and records in master invoice
- System will display Package total plus BaseTotal as "Shipping Total" in invoice
Flow Chart of Process

The final total reflects the interaction of all the the parameter settings. Therefore you will probably need to do some tests and adjustments until you get the numbers that you require. It is important to remember that:
- Packaging setting in Product table is NOT FACTORED and used "raw" and multiplied times the Quantity
- State/Region/Country totals are applied TO EACH LINE ITEM times the Quantity (Therefore keep these values small, they will grow fast)
- The Factoring engine will reduce the State/Region/Country total ON EACH LINE ITEM based on the settings you set.
- Weight setting in Product table is NOT FACTORED and also used "raw" and multiplied times the Quantity.