1

There is "Logout" link all over the site. If we click on Logout, it will redirect to this page.

http://sitename/customer/account/logoutSuccess/

but in some phtml pages for example , in below page

http://sitename.com/marketplace/marketplaceaccount/myproductslist/

if we click on "Logout", it should logout but redirect to following url :

http://sitename.com/marketplace.

In google i found redirecting for entire site. but i need only for some pages.

Update

controllers

<?php



require_once 'Mage/Customer/controllers/AccountController.php';
class Webkul_Marketplace_AccountController extends Mage_Customer_AccountController
{
    public function logoutAction()
{
    $this->_getSession()->logout()
        ->renewSession();
      //add your code here
    $this->_redirect('marketplace');
}
}



require_once 'Mage/Customer/controllers/AccountController.php';
class Webkul_Marketplace_MarketplaceaccountController extends Mage_Customer_AccountController{  
    public function indexAction(){      
        $this->loadLayout();     
        $this->renderLayout();
    }

    public function newAction(){
        $set=$this->getRequest()->getParam('set');
        $type=$this->getRequest()->getParam('type');
        if(isset($set) && isset($type)){
            $allowedsets=explode(',',Mage::getStoreConfig('marketplace/marketplace_options/attributesetid'));
            $allowedtypes=explode(',',Mage::getStoreConfig('marketplace/marketplace_options/allow_for_seller'));
            if(!in_array($type,$allowedtypes) || !in_array($set,$allowedsets)){
                Mage::getSingleton('core/session')->addError(Mage::helper('marketplace')->__('Product Type Invalide Or Not Allowed'));
                $this->_redirect('marketplace/marketplaceaccount/new/');
            }
            Mage::getSingleton('core/session')->setAttributeSet($set);
            switch($type){
                case "simple":
                    $this->loadLayout(array('default','marketplace_account_simpleproduct'));
                    $this->getLayout()->getBlock('head')->setTitle(Mage::helper('marketplace')->__('MarketPlace Product Type: Simple Product'));
                    break;
                case "downloadable":
                    $this->loadLayout(array('default','marketplace_account_downloadableproduct'));
                    $this->getLayout()->getBlock('head')->setTitle(Mage::helper('marketplace')->__('MarketPlace Product Type: Downloabable Product'));
                    break;
                case "virtual":
                    $this->loadLayout(array('default','marketplace_account_virtualproduct'));
                    $this->getLayout()->getBlock('head')->setTitle(Mage::helper('marketplace')->__('MarketPlace Product Type: Virtual Product'));
                    break;
                case "configurable":
                    $this->loadLayout(array('default','marketplace_account_configurableproduct'));
                    $this->getLayout()->getBlock('head')->setTitle( Mage::helper('marketplace')->__('MarketPlace Product Type: Configurable Product'));
                    break;
            }
            Mage::dispatchEvent('mp_bundalproduct',array('layout'=>$this,'type'=>$type));
            Mage::dispatchEvent('mp_groupedproduct',array('layout'=>$this,'type'=>$type));

            $this->_initLayoutMessages('catalog/session');
            $this->renderLayout();
        }else{
          $this->loadLayout(array('default','marketplace_marketplaceaccount_newproduct'));     
          $this->renderLayout();
        }
    }

config .xml

<?xml version="1.0"?>
<config>
    <modules>
        <Webkul_Marketplace>
            <version>1.0.1</version>
        </Webkul_Marketplace>
    </modules>
    <default>
        <marketplace>
            <marketplace_options>
                <percent><![CDATA[20]]></percent>
                <partner_approval><![CDATA[1]]></partner_approval>
                <product_approval><![CDATA[1]]></product_approval>
                <allow_for_seller><![CDATA[simple,virtual,downloadable,configurable]]></allow_for_seller>
            </marketplace_options>
        </marketplace>
    </default>
    <frontend>
        <secure_url>
            <marketplace>/marketplace/marketplaceaccount/</marketplace>
        </secure_url>
        <routers>
            <marketplace>
                <use>standard</use>
                <args>
                    <module>Webkul_Marketplace</module>
                    <frontName>marketplace</frontName>
                </args>
            </marketplace>
        </routers>
        <layout>
            <updates>
                <marketplace>
                    <file>marketplace.xml</file>
                </marketplace>
            </updates>
        </layout>
        <translate>
            <modules>
                <webkul_marketplace>
                    <files>
                        <marketplace>Webkul_Marketplace.csv</marketplace>
                    </files>
                </webkul_marketplace>
            </modules>
        </translate>
    </frontend>

    **<!-- log out -->**


    <frontend>
            <routers>
                <customer>
                    <args>
                        <modules>
                            <Webkul_Marketplace before="Mage_Customer">Webkul_Marketplace</Webkul_Marketplace>
                        </modules>
                    </args>
                </customer>
            </routers>
     </frontend>

        **<!-- log out -->**



    <admin>
        <routers>
            <marketplace>
                <use>admin</use>
                <args>
                    <module>Webkul_Marketplace</module>
                    <frontName>marketplace</frontName>
                </args>
            </marketplace>
        </routers>
    </admin>
    <adminhtml>
        <layout>
            <updates>
                <marketplace>
                    <file>marketplace.xml</file>
                </marketplace>
            </updates>
        </layout>
    </adminhtml>   
    <global>
        <events>
            <catalog_product_delete_after>
                <observers>
                   <Webkul_Marketplace_Model_Observer>
                      <type>singleton</type>
                      <class>Webkul_Marketplace_Model_Observer</class>
                      <method>DeleteProduct</method>
                   </Webkul_Marketplace_Model_Observer>
               </observers>
            </catalog_product_delete_after>
            <customer_register_success>
                <observers>
                   <Webkul_Marketplace_Model_Observer>
                      <type>singleton</type>
                        <class>Webkul_Marketplace_Model_Observer</class>
                        <method>CustomerRegister</method>
                   </Webkul_Marketplace_Model_Observer>
               </observers>
            </customer_register_success>
            <customer_delete_commit_after>
                <observers>
                    <Webkul_Marketplace_Model_Observer>
                        <class>Webkul_Marketplace_Model_Observer</class>
                        <method>deleteCustomer</method>
                    </Webkul_Marketplace_Model_Observer>
                </observers>
            </customer_delete_commit_after>
            <sales_order_place_after>
              <observers>
               <Webkul_Marketplace_Model_Observer>
                <type>singleton</type>
                 <class>Webkul_Marketplace_Model_Observer</class>
                  <method>afterPlaceOrder</method>
               </Webkul_Marketplace_Model_Observer>
              </observers>
            </sales_order_place_after>

            <sales_order_invoice_save_after>
                <observers>
                    <Webkul_Marketplace_Model_Observer>
                        <class>Webkul_Marketplace_Model_Observer</class>
                        <method>checkInvoiceSubmit</method>
                    </Webkul_Marketplace_Model_Observer>
                </observers>
            </sales_order_invoice_save_after>
            <adminhtml_customer_save_after>
                <observers>
                    <Webkul_Marketplace_Model_Observer>
                        <type>singleton</type>
                        <class>Webkul_Marketplace_Model_Observer</class>
                        <method>afterSaveCustomer</method>
                    </Webkul_Marketplace_Model_Observer>
               </observers>
            </adminhtml_customer_save_after>
            <sales_order_save_commit_after>
                <observers>
                    <Webkul_Marketplace_Model_Observer>
                        <class>Webkul_Marketplace_Model_Observer</class>
                        <method>commissionCalculationOnComplete</method>
                    </Webkul_Marketplace_Model_Observer>
                </observers>
            </sales_order_save_commit_after>
        </events>
        <template>
            <email>
                <adminnotifymoney>
                    <label>Admin Notify For Credit</label>
                    <file>marketplacepartner/notifyadminformoney.html</file>
                    <type>html</type>
                </adminnotifymoney>
                <partnerrequest>
                    <label>Partner Request</label>
                    <file>marketplacepartner/partnerrequest.html</file>
                    <type>html</type>
                </partnerrequest>
                <partnerapprove>
                    <label>Partner Approved</label>
                    <file>marketplacepartner/partnerapprove.html</file>
                    <type>html</type>
                </partnerapprove>
                <partnerdisapprove>
                    <label>Partner Disapprove</label>
                    <file>marketplacepartner/partnerdisapprove.html</file>
                    <type>html</type>
                </partnerdisapprove>
                <partnerdeny>
                    <label>Partner Deny</label>
                    <file>marketplacepartner/denypartnermail.html</file>
                    <type>html</type>
                </partnerdeny>
                <productdeny>
                    <label>Product Deny</label>
                    <file>marketplacepartner/productdenymail.html</file>
                    <type>html</type>
                </productdeny>
                <partnercreditinfo>
                    <label>partner Notify for Credit</label>
                    <file>marketplacepartner/partnercreditinfo.html</file>
                    <type>html</type>
                </partnercreditinfo>
                <approveproduct>
                    <label>Approve My Product</label>
                    <file>marketplacepartner/admininformnewpro.html</file>
                    <type>html</type>
                </approveproduct>
                <customerpartner_email_template>
                    <label>Admin mail to check that some product is sold</label>
                    <file>marketplacepartner/customer_partner.html</file>
                    <type>html</type>
                </customerpartner_email_template>
                <customerpartner_email>
                    <label>Notify Partner when its product sold</label>
                    <file>marketplacepartner/notifycheckoutpartner.html</file>
                    <type>html</type>
                </customerpartner_email>
                <requesttobecomepartner_email>
                    <label>Notify Admin to make me partner</label>
                    <file>marketplacepartner/webkulcustomerpartnewreqest.html</file>
                    <type>html</type>
                </requesttobecomepartner_email>
                <querypartner_email>
                    <label>Ask question from partner for its particular product</label>
                    <file>marketplacepartner/webkulquerypartneremail.html</file>
                    <type>html</type>
                </querypartner_email>
                <askquerypartner_email>
                    <label>Ask question from partner</label>
                    <file>marketplacepartner/askquerypartneremail.html</file>
                    <type>html</type>
                </askquerypartner_email>                
                <queryadminemail>
                    <label>Ask question from admin by seller</label>
                    <file>marketplacepartner/webkulqueryadminemail.html</file>
                    <type>html</type>
                </queryadminemail>
                <whenproductapproved>
                    <label>When the product is Approved mail send to partner</label>
                    <file>marketplacepartner/admininapprovedit.html</file>
                    <type>html</type>
                </whenproductapproved>
                <orderinvoice>
                    <label>When invoice is created for an order</label>
                    <file>marketplacepartner/partener_order_invoice.html</file>
                    <type>html</type>
                </orderinvoice> 
                <webkulorderinvoice>
                    <label>When invoice is created for an order</label>
                    <file>marketplacepartner/webkul_order_invoice.html</file>
                    <type>html</type>
                </webkulorderinvoice>
                <sellertransactionmail>
                    <label>When transaction is created by for seller's order</label>
                    <file>marketplacepartner/sellertransactionmail.html</file>
                    <type>html</type>
                </sellertransactionmail>
            </email>            
        </template>
        <models>
            <marketplace>
                <class>Webkul_Marketplace_Model</class>
                <resourceModel>marketplace_mysql4</resourceModel>
            </marketplace>
            <marketplace_mysql4>
                <class>Webkul_Marketplace_Model_Mysql4</class>
                <entities>
                    <product>
                        <table>marketplace_product</table>
                    </product>
                    <userprofile> 
                        <table>marketplace_userdata</table>
                    </userprofile>
                    <feedback> 
                        <table>marketplace_datafeedback</table>
                    </feedback>
                    <feedbackcount> 
                        <table>marketplace_feedbackcount</table>
                    </feedbackcount>
                    <saleperpartner> 
                        <table>marketplace_saleperpartner</table>
                    </saleperpartner>
                    <saleslist> 
                        <table>marketplace_saleslist</table>
                    </saleslist>
                    <sellertransaction> 
                        <table>marketplace_sellertransaction</table>
                    </sellertransaction>
                </entities>
            </marketplace_mysql4>
        </models>
        <resources>
            <marketplace_setup>
                <setup>
                    <module>Webkul_Marketplace</module>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </marketplace_setup>
            <marketplace_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </marketplace_write>
            <marketplace_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </marketplace_read>
        </resources>
        <blocks>
            <adminhtml>
                <rewrite>
                    <customer_edit_tabs>Webkul_Marketplace_Block_Adminhtml_Customer_Edit_Tabs</customer_edit_tabs>
                </rewrite>
            </adminhtml>
            <marketplace>
                <class>Webkul_Marketplace_Block</class>
            </marketplace>
        </blocks>
        <helpers>
            <marketplace>
                <class>Webkul_Marketplace_Helper</class>
            </marketplace>
        </helpers>
    </global>
</config>
  • you need to override the customer controller for that – Qaisar Satti Nov 30 '15 at 7:12
  • can you please give the answer with code – user33510 Nov 30 '15 at 7:14
0

add in your confix.xml in

<frontend>
            <routers>
                <customer>
                    <args>
                        <modules>
                            <company_modulename before="Mage_Customer">Company_Modulename</company_modulename>
                        </modules>
                    </args>
                </customer>
            </routers>
        </frontend>

these is you controller

require_once 'Mage/Customer/controllers/AccountController.php';
class Company_Modulename_AccountController extends Mage_Customer_AccountController
{
    public function logoutAction()
{
    $this->_getSession()->logout()
        ->renewSession();
      //add your code here
    $this->_redirect('*/*/logoutSuccess');
}
}
  • i replaced company_modulename and in controller , i changed $this->_redirect('*/*/logoutSuccess'); to $this->_redirect('marketplace'); but its not working.... – user33510 Nov 30 '15 at 7:31
  • did you added the config.xml too? – Qaisar Satti Nov 30 '15 at 7:31
  • yes i added in config.xml . also cleared cache. – user33510 Nov 30 '15 at 7:35
  • did your url is customer/logout – Qaisar Satti Nov 30 '15 at 7:39
  • please check here : 2.kidsdial.com , i need this = > $this->_redirect('marketplace'); – user33510 Nov 30 '15 at 7:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy