protected function _createOrderProductAttributes( MShop_Price_Item_Interface $price, $prodid, $quantity,
		array $attributeIds, $type )
	{
		if( empty( $attributeIds ) ) {
			return array();
		}

		$attrTypeId = $this->_getProductListTypeItem( 'attribute', $type )->getId();
		$this->_checkReferences( $prodid, 'attribute', $attrTypeId, $attributeIds );

		$list = array();
		$context = $this->_getContext();

		$priceManager = MShop_Factory::createManager( $context, 'price' );
		$orderProductAttributeManager = MShop_Factory::createManager( $context, 'order/base/product/attribute' );

		foreach( $this->_getAttributes( $attributeIds ) as $attrItem )
		{
			$prices = $attrItem->getRefItems( 'price', 'default', 'default' );

			if( !empty( $prices ) ) {
				$price->addItem( $priceManager->getLowestPrice( $prices, $quantity ) );
			}

			$item = $orderProductAttributeManager->createItem();
			$item->copyFrom( $attrItem );
			$item->setType( $type );

			$list[] = $item;
		}

		return $list;
	}
protected function _createOrderProductAttributes( MShop_Price_Item_Interface $price, $prodid, $quantity,
		array $attributeIds, $type )
	{
		if( empty( $attributeIds ) ) {
			return array();
		}

		$attrTypeId = $this->_getProductListTypeItem( 'attribute', $type )->getId();
		$this->_checkReferences( $prodid, 'attribute', $attrTypeId, $attributeIds );

		$list = array();
		$context = $this->_getContext();

		$priceManager = MShop_Factory::createManager( $context, 'price' );
		$orderProductAttributeManager = MShop_Factory::createManager( $context, 'order/base/product/attribute' );

		foreach( $this->_getAttributes( $attributeIds ) as $attrItem )
		{
			$prices = $attrItem->getRefItems( 'price', 'default', 'default' );

			if( !empty( $prices ) ) {
				$price->addItem( $priceManager->getLowestPrice( $prices, $quantity ) );
			}

			$item = $orderProductAttributeManager->createItem();
			$item->copyFrom( $attrItem );
			$item->setType( $type );

			$list[] = $item;
		}

		return $list;
	}
protected function _createOrderProductAttributes ( MShop_Price_Item_Interface $ price , $ prodid , $ quantity , array $ attributeIds , $ type ) { if ( empty ( $ attributeIds ) ) { return array ( ) ; } $ attrTypeId = $ this -> _getProductListTypeItem ( 'attribute' , $ type ) -> getId ( ) ; $ this -> _checkReferences ( $ prodid , 'attribute' , $ attrTypeId , $ attributeIds ) ; $ list = array ( ) ; $ context = $ this -> _getContext ( ) ; $ priceManager = MShop_Factory :: createManager ( $ context , 'price' ) ; $ orderProductAttributeManager = MShop_Factory :: createManager ( $ context , 'order/base/product/attribute' ) ; foreach ( $ this -> _getAttributes ( $ attributeIds ) as $ attrItem ) { $ prices = $ attrItem -> getRefItems ( 'price' , 'default' , 'default' ) ; if ( ! empty ( $ prices ) ) { $ price -> addItem ( $ priceManager -> getLowestPrice ( $ prices , $ quantity ) ) ; } $ item = $ orderProductAttributeManager -> createItem ( ) ; $ item -> copyFrom ( $ attrItem ) ; $ item -> setType ( $ type ) ; $ list [ ] = $ item ; } return $ list ; }
Creates the order product attribute items from the given attribute IDs and updates the price item if necessary.

@param MShop_Price_Item_Interface $price Price item of the ordered product
@param string $prodid Unique product ID where the given attributes must be attached to
@param integer $quantity Number of products that should be added to the basket
@param array $attributeIds List of attributes IDs of the given type
@param string $type Attribute type
@return array List of items implementing MShop_Order_Item_Product_Attribute_Interface
Creates the order product attribute items from the given attribute IDs and updates the price item if necessary .