Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezdefaultbasketinfohandler.php
Go to the documentation of this file.
1 <?php
11 class eZDefaultBasketInfoHandler
12 {
16 function updatePriceInfo( $productCollectionID, &$basketInfo )
17 {
18 $shippingInfo = eZShippingManager::getShippingInfo( $productCollectionID );
19 $additionalShippingValues = eZShippingManager::vatPriceInfo( $shippingInfo );
20 $returnValue = false;
21 foreach ( $additionalShippingValues['shipping_vat_list'] as $vatValue => $additionalShippingValueArray )
22 {
23 $shippingExVAT = $additionalShippingValueArray['shipping_ex_vat'];
24 $shippingIncVAT = $additionalShippingValueArray['shipping_inc_vat'];
25 $shippingVat = $additionalShippingValueArray['shipping_vat'];
26
27 if ( !isset( $basketInfo['price_info'][$vatValue]['total_price_ex_vat'] ) )
28 {
29 $basketInfo['price_info'][$vatValue]['total_price_ex_vat'] = $shippingExVAT;
30 $basketInfo['price_info'][$vatValue]['total_price_inc_vat'] = $shippingIncVAT;
31 $basketInfo['price_info'][$vatValue]['total_price_vat'] = $shippingVat;
32
33 $basketInfo['total_price_info']['total_price_ex_vat'] = $shippingExVAT;
34 $basketInfo['total_price_info']['total_price_inc_vat'] = $shippingIncVAT;
35 $basketInfo['total_price_info']['total_price_vat'] = $shippingVat;
36 }
37 else
38 {
39 $basketInfo['price_info'][$vatValue]['total_price_ex_vat'] += $shippingExVAT;
40 $basketInfo['price_info'][$vatValue]['total_price_inc_vat'] += $shippingIncVAT;
41 $basketInfo['price_info'][$vatValue]['total_price_vat'] += $shippingVat;
42
43 $basketInfo['total_price_info']['total_price_ex_vat'] += $shippingExVAT;
44 $basketInfo['total_price_info']['total_price_inc_vat'] += $shippingIncVAT;
45 $basketInfo['total_price_info']['total_price_vat'] += $shippingVat;
46 }
47
48 if ( !isset( $basketInfo['additional_info']['shipping_items'][$vatValue]['total_price_ex_vat'] ) )
49 {
50 $basketInfo['additional_info']['shipping_items'][$vatValue]['total_price_ex_vat'] = $shippingExVAT;
51 $basketInfo['additional_info']['shipping_items'][$vatValue]['total_price_inc_vat'] = $shippingIncVAT;
52 $basketInfo['additional_info']['shipping_items'][$vatValue]['total_price_vat'] = ( $shippingIncVAT - $shippingExVAT );
53 }
54 else
55 {
56 $basketInfo['additional_info']['shipping_items'][$vatValue]['total_price_ex_vat'] += $shippingExVAT;
57 $basketInfo['additional_info']['shipping_items'][$vatValue]['total_price_inc_vat'] += $shippingIncVAT;
58 $basketInfo['additional_info']['shipping_items'][$vatValue]['total_price_vat'] += ( $shippingIncVAT - $shippingExVAT );
59 }
60
61 if ( !isset( $basketInfo['additional_info']['shipping_total']['total_price_ex_vat'] ) )
62 {
63 $basketInfo['additional_info']['shipping_total']['total_price_ex_vat'] = $shippingExVAT;
64 $basketInfo['additional_info']['shipping_total']['total_price_inc_vat'] = $shippingIncVAT;
65 $basketInfo['additional_info']['shipping_total']['total_price_vat'] = ( $shippingIncVAT - $shippingExVAT );
66 }
67 else
68 {
69 $basketInfo['additional_info']['shipping_total']['total_price_ex_vat'] += $shippingExVAT;
70 $basketInfo['additional_info']['shipping_total']['total_price_inc_vat'] += $shippingIncVAT;
71 $basketInfo['additional_info']['shipping_total']['total_price_vat'] += ( $shippingIncVAT - $shippingExVAT );
72 }
73 }
74
75 if ( count( $additionalShippingValues['shipping_vat_list'] ) > 0 )
76 {
77 $returnValue = true;
78 }
79
80 return $returnValue;
81 }
82 }
83
84 ?>
eZDefaultBasketInfoHandler
Definition: ezdefaultbasketinfohandler.php:12
eZDefaultBasketInfoHandler\updatePriceInfo
updatePriceInfo( $productCollectionID, &$basketInfo)
Definition: ezdefaultbasketinfohandler.php:16
eZShippingManager\vatPriceInfo
static vatPriceInfo( $shippingInfo)
Definition: ezshippingmanager.php:274
eZShippingManager\getShippingInfo
static getShippingInfo( $productCollectionID)
Definition: ezshippingmanager.php:66
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.