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:
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,

Type: Discussion
Status: Archived
JohntheFish
View Replies:

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.