magento - To redirect the page to current instead of logout page -
i working on logout button of magento. when click on logout button going logout page , redirect current page.
in logout page template
<div class="page-head"> <h3><?php echo $this->__("you're logged out") ?></h3> </div> <p><?php echo $this->__('you have been logged out , redirected our homepage in 5 seconds.') ?></p> <script type="text/javascript"> settimeout(function(){ location.href = '<?php echo $this->geturl() ?>'},5000); </script> and in customer.xml found
<reference name="root"> <action method="settemplate"><template>page/1column.phtml</template></action> </reference> <reference name="content"> <block type="core/template" name="customer_logout" template="customer/logout.phtml"/> </reference> now want redirect page direct current page instead of going logout page. hope understand , me.
have took @ existing magento code handles logout ?
class mage_customer_accountcontroller
/** * customer logout action */ public function logoutaction() { $this->_getsession()->logout() ->setbeforeauthurl(mage::geturl()); $this->_redirect('*/*/logoutsuccess'); } see "setbeforeauthurl()" function ? try play inject current url can retrieve : mage::helper('core/url')->getcurrenturl();
Comments
Post a Comment