I have tried to redirect customer to a certain category after successful registration however I couldn't achieve it (even with the help in here, still didn't work stackexchange question)so I changed the plan to sort it out with redirecting the customer using $_SERVER['HTTP_REFERER']
and session variable where I put these in the header.phtml but this time I can't get the category URL for the custom category attribute. Anyone can help?
$session = Mage::getSingleton('customer/session');
if($session) {
$customerclass = $session->getPasscode();
if( $_SERVER['HTTP_REFERER'] == 'http://www.localhost.com/customer/account/create/' && $customerclass != ''){
$categories = Mage::getModel('catalog/category')
->getCollection()
->addAttributeToSelect('*')
->addAttributeToFilter('passcode', $customerclass)
->addIsActiveFilter()
->addUrlRewriteToResult();
if($categories->count()){
$url = $categories->getFirstItem()->getUrl();
Mage::app()->getFrontController()->getResponse()->setRedirect($url)->sendResponse();
exit;
}
}
}
$customerclass = $session->getPasscode();
@Abdul