|
eZ Publish
[4.2]
|
The class eZShippingManager does. More...
Static Public Member Functions | |
| static | getShippingInfo ($productCollectionID) |
| static | purgeShippingInfo ($productCollectionID) |
| static | updatePriceInfo ($productCollectionID, &$basketInfo) |
| static | updateShippingInfo ($productCollectionID) |
| static | vatPriceInfo ($shippingInfo) |
Static Private Member Functions | |
| static | loadBasketInfoHandler () |
| static | loadShippingHandler () |
The class eZShippingManager does.
Definition at line 39 of file ezshippingmanager.php.
| static eZShippingManager::getShippingInfo | ( | $ | productCollectionID | ) | [static] |
The function are fetching the shipping info and need to be reimplemented in a new shippinghandler. It's also possible to return additional parameters to use in the templates.
array( 'shipping_items' => array( array( 'description' => 'Shipping vat: 12%', 'cost' => 50.25, 'vat_value' => 12, 'is_vat_inc' => 0, 'management_link' => '/myshippingmodule/options/12' ), array( 'description' => 'Shipping vat: 25%', 'cost' => 100.75, 'vat_value' => 25, 'is_vat_inc' => 1, 'management_link' => '/myshippingmodule/options/25' ) ), 'description' => 'Total Shipping', 'cost' => 10.25, 'vat_value' => false, 'is_vat_inc' => 1, 'management_link' => '/myshippingmodule/options' );
An example for the shippingvalues with only one shippingitem.
array( 'description' => 'Total Shipping vat: 16%', 'cost' => 10.25, 'vat_value' => 16, 'is_vat_inc' => 1, 'management_link' => '/myshippingmodule/options/1234' );
The returned array for each shipping item should consist of these keys:
Definition at line 89 of file ezshippingmanager.php.
Referenced by eZDefaultBasketInfoHandler\updatePriceInfo().
| static eZShippingManager::loadBasketInfoHandler | ( | ) | [static, private] |
Load basketinfo handler (if specified).
Definition at line 201 of file ezshippingmanager.php.
Referenced by updatePriceInfo().
| static eZShippingManager::loadShippingHandler | ( | ) | [static, private] |
Load shipping handler (if specified).
Definition at line 140 of file ezshippingmanager.php.
Referenced by getShippingInfo(), purgeShippingInfo(), and updateShippingInfo().
| static eZShippingManager::purgeShippingInfo | ( | $ | productCollectionID | ) | [static] |
Purge shipping information for a stale product collection that is about to be removed.
Should be used when a basket is removed. All shipping information related to the productCollectionID should be removed.
Definition at line 125 of file ezshippingmanager.php.
Referenced by eZProductCollection\cleanupList().
| static eZShippingManager::updatePriceInfo | ( | $ | productCollectionID, |
| &$ | basketInfo | ||
| ) | [static] |
Update shipping price with calculated information based on original values. All values are changed or added directly in the array $basketInfo
Example on a calculated $basketInfo variable:
array( 'price_info' => array( 0 => array( 'price_ex_vat' => 231, 'price_inc_vat' => 231, 'price_vat' => 0, 'total_price_ex_vat' => 231, 'total_price_inc_vat' => 231, 'total_price_vat' => 0 ), 12 => array( 'total_price_ex_vat' => 50.25, 'total_price_inc_vat' => 56.28, 'total_price_vat' => 6.03 ), 25 => array( 'total_price_ex_vat' => 80.6, 'total_price_inc_vat' => 100.75, 'total_price_vat' => 20.15 ) ), 'total_price_info' => array( 'price_ex_vat' => 231, 'price_inc_vat' => 231, 'price_vat' => 0, 'total_price_ex_vat' => 361.85, 'total_price_inc_vat' => 388.03, 'total_price_vat' => 26.18 ), 'additional_info' => array( 'shipping_items' => array( 12 => array( 'total_price_ex_vat' => 50.25, 'total_price_inc_vat' => 56.28, 'total_price_vat' => 6.03 ), 25 => array( 'total_price_ex_vat' => 80.6, 'total_price_inc_vat' => 100.75, 'total_price_vat' => 20.15 ) ), 'shipping_total' => array( 'total_price_ex_vat' => 130.85, 'total_price_inc_vat' => 157.03, 'total_price_vat' => 26.18 ) ) );
Definition at line 442 of file ezshippingmanager.php.
Referenced by eZBasket\itemsInfo().
| static eZShippingManager::updateShippingInfo | ( | $ | productCollectionID | ) | [static] |
The function to update any additional shippinginfo and need to be reimplemented in a new shippinghandler.
Definition at line 107 of file ezshippingmanager.php.
Referenced by eZBasket\updatePrices().
| static eZShippingManager::vatPriceInfo | ( | $ | shippingInfo | ) | [static] |
Calculate the vat prices returned by the shippinghandler.
Need to receive the following values (In the arrays will also consist of additional parameters, see the function getShippingInfo() for more information):
Option 1: An array with shipping items with atleast these values:
array( 'shipping_items' => array( array( 'cost' => 50.25, 'vat_value' => 12, 'is_vat_inc' => 0 ), array( 'cost' => 100.75, 'vat_value' => 25, 'is_vat_inc' => 1 ) ), 'cost' => 157.03, 'vat_value' => false, 'is_vat_inc' => 1 );
Option 2, backwards compatible:
array( 'cost' => 50.25, 'vat_value' => 12, 'is_vat_inc' => 0 );
array( 'vat_shipping_list_ex_vat' => array( 5 => 345.25, 25 => 112.50 ), 'vat_shipping_list_inc_vat' => array( 5 => 125, 25 => 150.50 ), 'total_shipping_ex_vat' => 1234, 'total_shipping_inc_vat' => 2345 );
Definition at line 299 of file ezshippingmanager.php.
Referenced by eZDefaultBasketInfoHandler\updatePriceInfo().