Using ZBS outside of C5 eCommerce
Permalink Browser Info Environment
With v1.5 ZBS code was revised so that developers can interface to ZBS functionality outside of eCommerce.
To edit ZBS rules, ZBS has its own dashboard interface (functionality previously under the eCommerce shipping type editor).
All the clever rule engines are now in library classes, so developers can integrate the ZBS rule engines into other add-ons, blocks or single pages.
For example, ZBS could be built into a shipping estimate calculator block, where a site visitor enters an address and weight and the block then displays the shipping zone and cost.
The following code is greatly abbreviated:
To edit ZBS rules, ZBS has its own dashboard interface (functionality previously under the eCommerce shipping type editor).
All the clever rule engines are now in library classes, so developers can integrate the ZBS rule engines into other add-ons, blocks or single pages.
For example, ZBS could be built into a shipping estimate calculator block, where a site visitor enters an address and weight and the block then displays the shipping zone and cost.
The following code is greatly abbreviated:
class ZbsAddressZones { public function lookup ( $addresslines='', $city='', $stateprovince='', $postcode='', $country='' ) { // returns the $shipping_zone (used below) }
class ZbsCartCalculation { public function __construct($shipping_zone){ // creates a cart calculator for a zone } public function add_product( $product_name, $product_quantity, $product_price_to_pay, $product_weight_units, $product_dimension_units, $product_weight, $product_length, $product_width, $product_height, $product_shipping_modifier,
Viewing 15 lines of 23 lines. View entire code block.
Type: | Discussion |
---|---|
Status: | Archived |