i want to redirect all my customers after login or registration to Dashboard if their cart is empty and to Checkout if they have products in cart. I use extension to do this redirection after login but is work only if is a product in cart. How I can sort this? This is my code:
if (Mage::helper('customerredirect')->isEnabled() && !Mage::getSingleton("core/session")->getRedirectregister()){ $lasturl = Mage::getSingleton('core/session')->getLastUrl(); if (strpos(Mage::helper('core/http')->getHttpReferer(), 'checkout') === false){ if (! preg_match("#customer/account/create#", $lasturl) && Mage::helper('customerredirect')->isoptionEnabled('login_customerredirect')) { if($this->_CustomerGroup()) { $_session = $this->_getSession(); $_session->setBeforeAuthUrl(Mage::helper('customerredirect')->setRedirectOnLogin()); } } }