2010-04-14 7 views
7

tengo que añadir registro de enlace en el menú superior enlaces¿Cómo puedo agregar enlace de registro en los eslabones superiores en Magento

así que hice esto, pero no sé cuál es el ayudante de registro. Por favor me ayude a

<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

No está muy claro lo que estás buscando aquí. ¿Podría explicar más qué está tratando de hacer y por qué quiere "ayuda para el registro"? Explicar eso podría aclarar lo que estás buscando. –

+0

Quiero agregar el enlace de la página de registro en la parte superior como el enlace de la página de inicio de sesión en la parte superior, – Elamurugan

Respuesta

11

Uso customer/getRegisterUrl como su ayudante para obtener la URL de registro. Esto significa que Magento hace algo como esto:

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

Espero que ayude.

Gracias, Joe

+0

Sí, lo hice, pero no funciona para mí. – Elamurugan

14

Lo que estaba haciendo es casi correcta, pero en lugar de customer/getAccountUrl debe utilizar customer/getRegisterUrl.

Así que básicamente se debe añadir la siguiente línea de XML en 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> 

Así que el código se vería así:

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

Espero que esto ayude a nadie.

+0

¡¡¡GRACIAS YOUUUUUU !!! –

-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

Intenta poner una pequeña descripción en tus respuestas y formatea el fragmento de código correctamente. – simonmorley

+0

Lo siento, pero estoy bajando la votación de esto. No puedo encontrar la función 'customer/getCreateUrl'. Si funciona para usted, esto es probablemente porque tiene alguna extensión instalada. – Dan

Cuestiones relacionadas