在客户帐户

时间:2017-06-03 11:20:29

标签: php magento magento-1.9.1

当客户登录他/她的帐户时,当前在默认magento中,显示给客户的Active菜单是帐户信息中心

我想在客户登入帐户时显示我的订单。 我使用了这种代码的和平。

<customer_account>
<reference name="customer_account_navigation">
            <action method="setActive"><name>orders</name><path>sales/order/history/</path></action>
        </reference>
</customer_account>

但它不起作用。请建议我任何解决方案或给我一个替代的想法来做到这一点。

2 个答案:

答案 0 :(得分:1)

您可以在控制器中尝试以下代码。

$this->loadLayout();

// add layout handle so that we will have the customer navigation on the right hand side

    $layout = $this->getLayout();
    $update = $layout->getUpdate();
    $this->addActionLayoutHandles();
    $update->addHandle('customer_account'); // add the customer navigation bar on the side
    $this->loadLayoutUpdates();
    $this->generateLayoutXml();
    $this->generateLayoutBlocks();
    $navigationBlock = $layout->getBlock('customer_account_navigation');
    // make sure we have an instantiation    
    if ($navigationBlock) {
        $navigationBlock->setActive('path/to/highlight'); // example: 'customer/address'
    }
    $this->_isLayoutLoaded = true;

    // render the layout
    $this->renderLayout();

所以,请尝试这个,如果有任何疑问,请告诉我。

由于

答案 1 :(得分:0)

打开app\code\core\Mage\Customer\controllers\AccountController.php

在公共函数$this->_loginPostRedirect()中查找代码loginPostAction() 替换为$this->_redirect('sales/order/history/');

相关问题