I have some issue in my Event Observer in config.xml whose the class doesn't work:
config.xml
<?xml version="1.0"?>
<config>
<modules>
<Prince_Cart>
<version>0.0.1</version>
</Prince_Cart>
</modules>
<global>
<models>
<cart>
<class>Prince_Cart_Model</class>
</cart>
</models>
<resources>
<prince_cart_setup>
<setup>
<module>Prince_Cart</module>
</setup>
</prince_cart_setup>
</resources>
</global>
<frontend>
<events>
<controller_action_predispatch_checkout_onepage_index>
<observers>
<Prince_Cart_Model_Observer>
<type>singleton</type>
<class>prince_cart/observer</class> <!--This doesn't work-->
<!--<class>Prince_Cart_Model_Observer</class>--> <!--This works but is not a good practice! -->
<method>blockProceedToCheckout</method>
</Prince_Cart_Model_Observer>
</observers>
</controller_action_predispatch_checkout_onepage_index>
</events>
</frontend>
</config>
Another detail: in which case we know that we can put <type>singleton</type>
or <type>model</type>
or nothing ?
Observer.php
class Prince_Cart_Model_Observer extends Varien_Event_Observer {
public function blockProceedToCheckout($observer){
...
}
}