2010-04-14 22 views
7

मैं शीर्ष मेनू में रजिस्टर लिंक जोड़ने के लिए में शीर्ष लिंक में रजिस्टर लिंक जोड़ सकते हैं लिंककैसे मैं Magento

तो मैं इस किया था, लेकिन मुझे नहीं पता क्या रजिस्टर के लिए सहायक। कृपया अपने सहायक पंजीकरण URL प्राप्त करने के रूप में मेरे

<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

यह स्पष्ट नहीं है कि आप यहां क्या हैं। क्या आप और अधिक समझा सकते हैं कि आप क्या करने की कोशिश कर रहे हैं और आप "रजिस्टर के लिए सहायक" क्यों चाहते हैं? समझाते हुए कि यह स्पष्ट हो सकता है कि आप क्या कर रहे हैं। –

+0

मैं शीर्ष पर रजिस्टर पेज लिंक जोड़ना चाहता हूं जैसे शीर्ष पर लॉगिन पेज लिंक, – Elamurugan

उत्तर

11

मदद उपयोग customer/getRegisterUrl। इसका मतलब है कि Magento इस तरह कुछ करते हैं:

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

आशा है कि मदद करता है।

धन्यवाद, जो

+0

हाँ मैंने इसे किया, लेकिन यह मेरे लिए काम नहीं कर रहा है। – Elamurugan

14

आप क्या कर रहे थे लगभग सही है, लेकिन customer/getAccountUrl के बजाय आप customer/getRegisterUrl उपयोग करना चाहिए।

तो बुनियादी तौर पर आप 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> 

में निम्नलिखित एक्सएमएल लाइन जोड़ने चाहिए तो अपने कोड इस तरह दिखेगा:

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

आशा इस किसी को भी मदद करता है।

+0

धन्यवाद यूयूयूयूयूयू !!! –

-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

अपने उत्तरों में थोड़ा विवरण डालें और अपने कोड स्निपेट को सही तरीके से प्रारूपित करें। – simonmorley

+0

मुझे खेद है, लेकिन मैं इसे कम वोट दे रहा हूं। मुझे 'ग्राहक/getCreateUrl' फ़ंक्शन नहीं मिल रहा है। यदि यह आपके लिए काम करता है, तो शायद यह इसलिए है क्योंकि आपके पास कुछ एक्सटेंशन इंस्टॉल हैं। – Dan