public function addProduct( $prodid, $quantity = 1, array $options = array(), array $variantAttributeIds = array(),
		array $configAttributeIds = array(), array $hiddenAttributeIds = array(), $warehouse = 'default' )
	{
		$this->_checkCategory( $prodid );

		$context = $this->_getContext();

		$productManager = MShop_Factory::createManager( $context, 'product' );
		$productItem = $productManager->getItem( $prodid, array( 'media', 'price', 'product', 'text' ) );

		$orderBaseProductItem = MShop_Factory::createManager( $context, 'order/base/product' )->createItem();
		$orderBaseProductItem->copyFrom( $productItem );
		$orderBaseProductItem->setQuantity( $quantity );
		$orderBaseProductItem->setWarehouseCode( $warehouse );

		$attr = array();
		$prices = $productItem->getRefItems( 'price', 'default', 'default' );

		switch( $productItem->getType() ) {
			case 'select':
				$attr = $this->_getVariantDetails( $orderBaseProductItem, $productItem, $prices, $variantAttributeIds, $options );
				break;
			case 'bundle':
				$this->_addBundleProducts( $orderBaseProductItem, $productItem, $variantAttributeIds, $warehouse );
				break;
		}

		$priceManager = MShop_Factory::createManager( $context, 'price' );
		$price = $priceManager->getLowestPrice( $prices, $quantity );

		$attr = array_merge( $attr, $this->_createOrderProductAttributes( $price, $prodid, $quantity, $configAttributeIds, 'config' ) );
		$attr = array_merge( $attr, $this->_createOrderProductAttributes( $price, $prodid, $quantity, $hiddenAttributeIds, 'hidden' ) );

		// remove product rebate of original price in favor to rebates granted for the order
		$price->setRebate( '0.00' );

		$orderBaseProductItem->setPrice( $price );
		$orderBaseProductItem->setAttributes( $attr );

		$this->_addProductInStock( $orderBaseProductItem, $productItem->getId(), $quantity, $options, $warehouse );
	}
public function addProduct( $prodid, $quantity = 1, array $options = array(), array $variantAttributeIds = array(),
		array $configAttributeIds = array(), array $hiddenAttributeIds = array(), $warehouse = 'default' )
	{
		$this->_checkCategory( $prodid );

		$context = $this->_getContext();

		$productManager = MShop_Factory::createManager( $context, 'product' );
		$productItem = $productManager->getItem( $prodid, array( 'media', 'price', 'product', 'text' ) );

		$orderBaseProductItem = MShop_Factory::createManager( $context, 'order/base/product' )->createItem();
		$orderBaseProductItem->copyFrom( $productItem );
		$orderBaseProductItem->setQuantity( $quantity );
		$orderBaseProductItem->setWarehouseCode( $warehouse );

		$attr = array();
		$prices = $productItem->getRefItems( 'price', 'default', 'default' );

		switch( $productItem->getType() ) {
			case 'select':
				$attr = $this->_getVariantDetails( $orderBaseProductItem, $productItem, $prices, $variantAttributeIds, $options );
				break;
			case 'bundle':
				$this->_addBundleProducts( $orderBaseProductItem, $productItem, $variantAttributeIds, $warehouse );
				break;
		}

		$priceManager = MShop_Factory::createManager( $context, 'price' );
		$price = $priceManager->getLowestPrice( $prices, $quantity );

		$attr = array_merge( $attr, $this->_createOrderProductAttributes( $price, $prodid, $quantity, $configAttributeIds, 'config' ) );
		$attr = array_merge( $attr, $this->_createOrderProductAttributes( $price, $prodid, $quantity, $hiddenAttributeIds, 'hidden' ) );

		// remove product rebate of original price in favor to rebates granted for the order
		$price->setRebate( '0.00' );

		$orderBaseProductItem->setPrice( $price );
		$orderBaseProductItem->setAttributes( $attr );

		$this->_addProductInStock( $orderBaseProductItem, $productItem->getId(), $quantity, $options, $warehouse );
	}
public function addProduct ( $ prodid , $ quantity = 1 , array $ options = array ( ) , array $ variantAttributeIds = array ( ) , array $ configAttributeIds = array ( ) , array $ hiddenAttributeIds = array ( ) , $ warehouse = 'default' ) { $ this -> _checkCategory ( $ prodid ) ; $ context = $ this -> _getContext ( ) ; $ productManager = MShop_Factory :: createManager ( $ context , 'product' ) ; $ productItem = $ productManager -> getItem ( $ prodid , array ( 'media' , 'price' , 'product' , 'text' ) ) ; $ orderBaseProductItem = MShop_Factory :: createManager ( $ context , 'order/base/product' ) -> createItem ( ) ; $ orderBaseProductItem -> copyFrom ( $ productItem ) ; $ orderBaseProductItem -> setQuantity ( $ quantity ) ; $ orderBaseProductItem -> setWarehouseCode ( $ warehouse ) ; $ attr = array ( ) ; $ prices = $ productItem -> getRefItems ( 'price' , 'default' , 'default' ) ; switch ( $ productItem -> getType ( ) ) { case 'select' : $ attr = $ this -> _getVariantDetails ( $ orderBaseProductItem , $ productItem , $ prices , $ variantAttributeIds , $ options ) ; break ; case 'bundle' : $ this -> _addBundleProducts ( $ orderBaseProductItem , $ productItem , $ variantAttributeIds , $ warehouse ) ; break ; } $ priceManager = MShop_Factory :: createManager ( $ context , 'price' ) ; $ price = $ priceManager -> getLowestPrice ( $ prices , $ quantity ) ; $ attr = array_merge ( $ attr , $ this -> _createOrderProductAttributes ( $ price , $ prodid , $ quantity , $ configAttributeIds , 'config' ) ) ; $ attr = array_merge ( $ attr , $ this -> _createOrderProductAttributes ( $ price , $ prodid , $ quantity , $ hiddenAttributeIds , 'hidden' ) ) ; // remove product rebate of original price in favor to rebates granted for the order $ price -> setRebate ( '0.00' ) ; $ orderBaseProductItem -> setPrice ( $ price ) ; $ orderBaseProductItem -> setAttributes ( $ attr ) ; $ this -> _addProductInStock ( $ orderBaseProductItem , $ productItem -> getId ( ) , $ quantity , $ options , $ warehouse ) ; }
Adds a categorized product to the basket of the user stored in the session.

@param string $prodid ID of the base product to add
@param integer $quantity Amount of products that should by added
@param array $options Possible options are: 'stock'=>true|false and 'variant'=>true|false
The 'stock'=>false option allows adding products without being in stock.
The 'variant'=>false option allows adding the selection product to the basket
instead of the specific sub-product if the variant-building attribute IDs
doesn't match a specific sub-product or if the attribute IDs are missing.
@param array $variantAttributeIds List of variant-building attribute IDs that identify a specific product
in a selection products
@param array $configAttributeIds  List of attribute IDs that doesn't identify a specific product in a
selection of products but are stored together with the product (e.g. for configurable products)
@param array $hiddenAttributeIds List of attribute IDs that should be stored along with the product in the order
@param string $warehouse Unique code of the warehouse to deliver the products from
@throws Controller_Frontend_Basket_Exception If the product isn't available
Adds a categorized product to the basket of the user stored in the session .