Shipping with Hazel

The good news? Hazel can adapt to just about any shipping method. The bad news? Well, you've got to implement it. The other good news? Hazel makes this almost painless (somewhere between a pinch and a bee sting) via her rules files.

If you haven't read the rules files, absorb them now. This document begins with a closer examination of shipping rules, and ends with a primer on per-item shipping charges.

The total calculated shipping charge can be accessed in your templates via the HZML token %HZT_SHIPPING.


shipping.rules

There should be a shipping rules file METHOD.rules for each shipping method you provide, where METHOD is the shipping method that file describes. These files should be placed in the shipping directory under the rules directory in your catalog root.

[Header] Type Description number below is the numeric part of the rule's action.
+ (default) x
PRICE
WEIGHT
QUANTITY
NUM The price, weight, total quantity, or total unique SKUID of items unhandled by per-item shipping. add number to total add header value multiplied by number to total
REGION STR The selected SHIP_REGION. add number to total multiply total by number
STATE
COUNTRY
STR The state or country of the shipping address. add number to total multiply total by number
POSTAL_CODE ZIP The postal code of the shipping address. add number to total multiply total by number
  • total is the total shipping calculated thus far, including per-item shipping.

Properties

Shipping rules may contain a special PROPERTIES header. Its contents are key:value pairs which describe the shipping method. They are NAME (the pretty word for the shipping method), and TAXABLE (1 if the shipping method is taxable.) Here's an example:

[PROPERTIES]
NAME: My Wicked Shipping Rules  # Its name, accessed by %HZE_SHIP_METHOD_NAME.
TAXABLE: 1                      # Whether or not it is taxable.


Per-Item Shipping

If you need to charge special shipping for certain products, add a SHIPPING field to its entry in your products file with a value of the flat charge for shipping each item.


  SKUID: MWAND
  NAME: Magic Wand
  PRICE: 7.99
  SHIPPING: 5.00   # $5 shipping and handling per magic wand.

  SKUID: PCLIP
  NAME: Paper Clip
  PRICE: 0.01
  SHIPPING: 0.00   # Paper clips shipped FREE!

Per-item shipping is useful for clumsy items which would break the financial poetry of your shipping rules, or for tiny items which require neglible shipping and handling.

Normally, when all selected products have their own shipping values, Hazel doesn't bother interpreting the chosen ship method's rules file. Prefixing a per-item shipping value with a plus sign (+) will ensure that shipping rules are executed even if all items have a custom shipping value. This is useful if, for example, you want to add a shipping surcharge for a particular ship method.


Getting Started HZML Rules Extras Advanced Reference
Walkthrough
Configuration
Products File
Order Reporting
Platforms
Upgrading
Known Problems
Actions
HZML Tokens
HZML Tags
HZML Loops
HZML & HAM
Overview
Shipping
Sales Tax
Discounts
Surcharges
Tweaking
Customization
Input Fields
Softgoods
Search Engine
Optioned Products
Plugins
Design Tips
Themes
Currency
Payment Methods
Coupons
Regular Expressions
Perl API
hazel.config
Templates
HTML Basics
CGI and You
ChangeLog

Hazel Home - Help Contents - Searchable Knowledge Base - Live Technical Support