If you have carried out a related observer, you lack the necessary information. You must add the request to your dispatch manager to verify that the user has selected:
public function addProduct($productInfo, $requestInfo=null) { $product = $this->_getProduct($productInfo); $request = $this->_getProductRequest($requestInfo); Mage::dispatchEvent('checkout_cart_product_add_before', array( 'product' => $product, 'request' => $request )); return parent::addProduct($productInfo, $requestInfo); }
Then you can get the number of users in your observer with:
$observer->getEvent()->getRequest()->getQty();
The method ->getRequest() refers to the magic getter for the request parameter of your dispatcher.
source share