he events catalog_product_type_prepare_full_options
and catalog_product_type_prepare_lite_options
are your friends
<?xml version="1.0"?>
<config>
<modules>
<Fooman_Example>
<version>0.1.0</version>
</Fooman_Example>
</modules>
<global>
<models>
<fooman_example>
<class>Fooman_Example_Model</class>
</fooman_example>
</models>
<helpers>
<fooman_example>
<class>Fooman_Example_Helper</class>
</fooman_example>
</helpers>
</global>
<frontend>
<events>
<catalog_product_type_prepare_full_options>
<observers>
<fooman_example_catalog_product_type_prepare>
<class>Fooman_Example_Model_Observer</class>
<method>catalogProductTypePrepare</method>
</fooman_example_catalog_product_type_prepare>
</observers>
</catalog_product_type_prepare_full_options>
</events>
</frontend>
</config>
Then in your Observer class
class Fooman_Example_Model_Observer
{
public function catalogProductTypePrepare($observer)
{
$quote = Mage::getSingleton('checkout/session')->getQuote();
if($quote->getItemsCount()>=1){
Mage::throwException('You can only buy one product at a time.');
}
}
}