Zen Cart Rule #1: Shipping Module Names
There are rules everywhere. In the kitchen, my #1 rule is “Never try to catch a falling knife“; it apparently applies to investments, too! In Zen Cart, my current #1 rule (having spent an inordinate amount of time debugging its misuse) is “Never use an underscore (_) in a shipping module’s name“.
A shipping module (unlike a payment or order-total module) can have multiple methods that it supports, so the built-in Zen Cart processing uses an underscore (_) to record both the Shipping Module and Shipping Method chosen for an order as a single string value. For example, using Zen Cart v1.5.4, the Store Pickup shipping module supports multiple stores. When the customer chooses the first store location, the id associated to the shipping selection is
Once the shipping selection is made, the Zen Cart processing maps that selection back to the Store Pickup module (
storepickup.php) and its
storepickup0 method by splitting (via the PHP explode function) that id value at the (presumed single) underscore. If there’s an underscore in the shipping module’s name, the association between the shipping module and selected method can never be resolved so the customer is always redirected back to the checkout_shipping page (with no message).
Repeat after me: I will never (again) use an underscore in a shipping module’s name.
Latest Blog [View All]
If I've helped you on the Zen Cart forums or you've found one of my free plugins helpful, feel free to give a little back by clicking here.