如何在magento的顶部链接中添加注册链接
我必须在顶部菜单链接中添加注册链接 所以我做了这个,但是我不知道注册的助手是什么。请帮帮我如何在magento的顶部链接中添加注册链接,magento,Magento,我必须在顶部菜单链接中添加注册链接 所以我做了这个,但是我不知道注册的助手是什么。请帮帮我 <customer_logged_in> <reference name="top.links"> <action method="addLink" translate="label title" module="customer"><label>Log Out</label><url help
<customer_logged_in>
<reference name="top.links">
<action method="addLink" translate="label title" module="customer"><label>Log Out</label><url helper="customer/getLogoutUrl"/><title>Log Out</title><prepare/><urlParams/><position>100</position></action>
<action method="addLink" translate="label title" module="customer"><label>My Account</label><url helper="customer/getAccountUrl"/><title>My Account</title><prepare/><urlParams/><position>10</position></action>
</reference>
</customer_logged_in>
<customer_logged_out>
<reference name="top.links">
<action method="addLink" translate="label title" module="customer"><label>My Account</label><url helper="customer/getLoginUrl"/><title>My Account</title><prepare/><urlParams/><position>100</position></action>
<action method="addLink" translate="label title" module="customer"><label>Register</label><url helper="customer/getAccountUrl"/><title>Register</title><prepare/><urlParams/><position>10</position></action>
</reference>
<remove name="wishlist_sidebar"></remove>
<remove name="reorder"></remove>
</customer_logged_out>
注销注销注销100
我的帐户我的帐户
我的账户我的账户100
注册表注册表10
使用customer/getRegisterUrl
作为您的助手来获取注册URL。这意味着Magento可以执行以下操作:
$helper = Mage::helper("customer"); // gets Mage_Customer_Helper_Data
$url = $helper->getRegisterUrl();
<customer_logged_in>
<reference name="top.links">
<action method="addLink" translate="label title" module="customer"><label>Log Out</label><url helper="customer/getLogoutUrl"/><title>Log Out</title><prepare/><urlParams/><position>100</position></action>
<action method="addLink" translate="label title" module="customer"><label>My Account</label><url helper="customer/getAccountUrl"/><title>My Account</title><prepare/><urlParams/><position>10</position></action>
</reference>
</customer_logged_in>
<customer_logged_out>
<reference name="top.links">
<action method="addLink" translate="label title" module="customer"><label>My Account</label><url helper="customer/getLoginUrl"/><title>My Account</title><prepare/><urlParams/><position>100</position></action>
<action method="addLink" translate="label title" module="customer"><label>Register</label><url helper="customer/getRegisterUrl"/><title>Register</title><prepare/><urlParams/><position>10</position></action>
</reference>
<remove name="wishlist_sidebar"></remove>
<remove name="reorder"></remove>
</customer_logged_out>
希望有帮助
谢谢,
Joe您所做的几乎是正确的,但是您应该使用
customer/getAccountUrl
而不是customer/getRegisterUrl
因此,基本上您应该在customer\u logged\u out\reference
<action method="addLink" translate="label title" module="customer"><label>Register</label><url helper="customer/getRegisterUrl"/><title>Register</title><prepare/><urlParams/><position>10</position></action>
RegisterRegister10
因此,您的代码将如下所示:
$helper = Mage::helper("customer"); // gets Mage_Customer_Helper_Data
$url = $helper->getRegisterUrl();
<customer_logged_in>
<reference name="top.links">
<action method="addLink" translate="label title" module="customer"><label>Log Out</label><url helper="customer/getLogoutUrl"/><title>Log Out</title><prepare/><urlParams/><position>100</position></action>
<action method="addLink" translate="label title" module="customer"><label>My Account</label><url helper="customer/getAccountUrl"/><title>My Account</title><prepare/><urlParams/><position>10</position></action>
</reference>
</customer_logged_in>
<customer_logged_out>
<reference name="top.links">
<action method="addLink" translate="label title" module="customer"><label>My Account</label><url helper="customer/getLoginUrl"/><title>My Account</title><prepare/><urlParams/><position>100</position></action>
<action method="addLink" translate="label title" module="customer"><label>Register</label><url helper="customer/getRegisterUrl"/><title>Register</title><prepare/><urlParams/><position>10</position></action>
</reference>
<remove name="wishlist_sidebar"></remove>
<remove name="reorder"></remove>
</customer_logged_out>
注销注销注销100
我的帐户我的帐户
我的账户我的账户100
注册表注册表10
希望这对任何人都有帮助。
<action method="addLink"
translate="label title"
module="customer">
<label>
Register
</label>
<url helper="customer/getCreateUrl"/>
<title>Register</title>
<prepare/>
<urlParams/>
<position>100</position>
</action>
登记
登记
100
现在还不太清楚您想要什么。你能解释一下你想做什么,为什么你想要“注册助手”吗?解释这一点可能会使您更清楚地了解您的目的。我想在顶部添加注册页面链接,就像在顶部添加登录页面链接一样,尝试在您的答案中添加一些描述,并正确设置代码片段的格式。很抱歉,我投了反对票。我找不到customer/getCreateUrl
函数。如果它适合您,这可能是因为您安装了一些扩展。