kernel/classes/ezorder.php
function productItems( $asObject = true, array $sorts = null )
    {
        $productItems = eZPersistentObject::fetchObjectList( eZProductCollectionItem::definition(),
                                                       null,
                                                       array( 'productcollection_id' => $this->ProductCollectionID ),
                                                       $sorts,
                                                       null,
                                                       $asObject );

        $addedProducts = array();
        foreach ( $productItems as  $productItem )
        {
            $contentObject = $productItem->attribute( 'contentobject' );

            if ( $this->IgnoreVAT == true )
            {
                $vatValue = 0;
            }
            else
            {
                $vatValue = $productItem->attribute( 'vat_value' );
            }
            if ( $contentObject )
            {
                $nodeID = $contentObject->attribute( 'main_node_id' );
                $objectName = $contentObject->attribute( 'name' );
            }
            else
            {
                $nodeID = false;
                $objectName = $productItem->attribute( 'name' );
            }

            $price = $productItem->attribute( 'price' );

            if ( $productItem->attribute( 'is_vat_inc' ) )
            {
                $priceExVAT = $price / ( 100 + $vatValue ) * 100;
                $priceIncVAT = $price;
            }
            else
            {
                $priceExVAT = $price;
                $priceIncVAT = $price * ( 100 + $vatValue ) / 100;
            }

            $count = $productItem->attribute( 'item_count' );
            $discountPercent = $productItem->attribute( 'discount' );
            $realPricePercent = ( 100 - $discountPercent ) / 100;
            $addedProducts[] = array( "id" => $productItem->attribute( 'id' ),
                                   "vat_value" => $vatValue,
                                   "item_count" => $count,
                                   "node_id" => $nodeID,
                                   "object_name" => $objectName,
                                   "price_ex_vat" => $priceExVAT,
                                   "price_inc_vat" => $priceIncVAT,
                                   "discount_percent" => $discountPercent,
                                   "total_price_ex_vat" => round( $count * $priceExVAT * $realPricePercent, 2 ),
                                   "total_price_inc_vat" => round( $count * $priceIncVAT * $realPricePercent, 2 ),
                                   'item_object' => $productItem );
        }
        return $addedProducts;
    }
function productItems( $asObject = true, array $sorts = null )
    {
        $productItems = eZPersistentObject::fetchObjectList( eZProductCollectionItem::definition(),
                                                       null,
                                                       array( 'productcollection_id' => $this->ProductCollectionID ),
                                                       $sorts,
                                                       null,
                                                       $asObject );

        $addedProducts = array();
        foreach ( $productItems as  $productItem )
        {
            $contentObject = $productItem->attribute( 'contentobject' );

            if ( $this->IgnoreVAT == true )
            {
                $vatValue = 0;
            }
            else
            {
                $vatValue = $productItem->attribute( 'vat_value' );
            }
            if ( $contentObject )
            {
                $nodeID = $contentObject->attribute( 'main_node_id' );
                $objectName = $contentObject->attribute( 'name' );
            }
            else
            {
                $nodeID = false;
                $objectName = $productItem->attribute( 'name' );
            }

            $price = $productItem->attribute( 'price' );

            if ( $productItem->attribute( 'is_vat_inc' ) )
            {
                $priceExVAT = $price / ( 100 + $vatValue ) * 100;
                $priceIncVAT = $price;
            }
            else
            {
                $priceExVAT = $price;
                $priceIncVAT = $price * ( 100 + $vatValue ) / 100;
            }

            $count = $productItem->attribute( 'item_count' );
            $discountPercent = $productItem->attribute( 'discount' );
            $realPricePercent = ( 100 - $discountPercent ) / 100;
            $addedProducts[] = array( "id" => $productItem->attribute( 'id' ),
                                   "vat_value" => $vatValue,
                                   "item_count" => $count,
                                   "node_id" => $nodeID,
                                   "object_name" => $objectName,
                                   "price_ex_vat" => $priceExVAT,
                                   "price_inc_vat" => $priceIncVAT,
                                   "discount_percent" => $discountPercent,
                                   "total_price_ex_vat" => round( $count * $priceExVAT * $realPricePercent, 2 ),
                                   "total_price_inc_vat" => round( $count * $priceIncVAT * $realPricePercent, 2 ),
                                   'item_object' => $productItem );
        }
        return $addedProducts;
    }
function productItems ( $ asObject = true , array $ sorts = null ) { $ productItems = eZPersistentObject :: fetchObjectList ( eZProductCollectionItem :: definition ( ) , null , array ( 'productcollection_id' => $ this -> ProductCollectionID ) , $ sorts , null , $ asObject ) ; $ addedProducts = array ( ) ; foreach ( $ productItems as $ productItem ) { $ contentObject = $ productItem -> attribute ( 'contentobject' ) ; if ( $ this -> IgnoreVAT == true ) { $ vatValue = 0 ; } else { $ vatValue = $ productItem -> attribute ( 'vat_value' ) ; } if ( $ contentObject ) { $ nodeID = $ contentObject -> attribute ( 'main_node_id' ) ; $ objectName = $ contentObject -> attribute ( 'name' ) ; } else { $ nodeID = false ; $ objectName = $ productItem -> attribute ( 'name' ) ; } $ price = $ productItem -> attribute ( 'price' ) ; if ( $ productItem -> attribute ( 'is_vat_inc' ) ) { $ priceExVAT = $ price / ( 100 + $ vatValue ) * 100 ; $ priceIncVAT = $ price ; } else { $ priceExVAT = $ price ; $ priceIncVAT = $ price * ( 100 + $ vatValue ) / 100 ; } $ count = $ productItem -> attribute ( 'item_count' ) ; $ discountPercent = $ productItem -> attribute ( 'discount' ) ; $ realPricePercent = ( 100 - $ discountPercent ) / 100 ; $ addedProducts [ ] = array ( "id" => $ productItem -> attribute ( 'id' ) , "vat_value" => $ vatValue , "item_count" => $ count , "node_id" => $ nodeID , "object_name" => $ objectName , "price_ex_vat" => $ priceExVAT , "price_inc_vat" => $ priceIncVAT , "discount_percent" => $ discountPercent , "total_price_ex_vat" => round ( $ count * $ priceExVAT * $ realPricePercent , 2 ) , "total_price_inc_vat" => round ( $ count * $ priceIncVAT * $ realPricePercent , 2 ) , 'item_object' => $ productItem ) ; } return $ addedProducts ; }
Fetch product items that bellongs ot the order

@param bool $asObject
@param array|null $sorts Array with sort data sent directly to {@link eZPersistentObject::fetchObjectList()}
Fetch product items that bellongs ot the order