2010-04-14 4 views
7

I Link im oberen Menü muss hinzufügen LinksWie i-Register Link oben Links in magento

Register hinzufügen

Also das ich habe, aber ich weiß nicht, was ist der Helfer für das Register. Bitte helfen Sie mir

<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> 
+0

Es ist nicht ganz klar, was Sie hier suchen. Könntest du mehr erklären, was du zu tun versuchst und warum du "Helper for register" willst? Erklären, dass es klarer machen könnte, was Sie suchen. –

+0

Ich möchte Register Seite Link in der Oberseite als Login-Seite Link in der Spitze hinzufügen, – Elamurugan

Antwort

11

Verwenden customer/getRegisterUrl als Helfer die Registrierungs-URL zu erhalten. Dies bedeutet, dass Magento etwas wie das tun:

$helper = Mage::helper("customer"); // gets Mage_Customer_Helper_Data 
$url = $helper->getRegisterUrl(); 

Hoffe, dass hilft.

Danke, Joe

+0

Ja, ich habe es getan, aber es funktioniert nicht für mich. – Elamurugan

14

Was Sie wurden fast richtig zu tun, aber statt customer/getAccountUrl sollten Sie customer/getRegisterUrl verwenden.

Also im Grunde sollten Sie die folgende XML-Linie in customer_logged_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> 

hinzufügen So Ihr Code wie folgt aussehen:

<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> 

hoffe, das hilft niemandem.

+0

DANKE DU !!!! –

-2
<action method="addLink" 
    translate="label title" 
    module="customer"> 
    <label> 
     Register 
    </label> 
    <url helper="customer/getCreateUrl"/> 
    <title>Register</title> 
    <prepare/> 
    <urlParams/> 
    <position>100</position> 
</action> 
+0

Versuchen Sie, eine kleine Beschreibung in Ihre Antworten einzugeben und formatieren Sie das Code-Snippet korrekt. – simonmorley

+0

Es tut mir leid, aber ich stimme das ab. Ich kann die Funktion 'customer/getCreateUrl' nicht finden. Wenn es für Sie funktioniert, liegt das wahrscheinlich daran, dass Sie eine Erweiterung installiert haben. – Dan

Verwandte Themen