1

I am working on https://www.depoto.com/bulkorders/ website, if any customer clicks on Bulk order page, need to ask for login for non-loggedin users. I created this Bulk order page in cms.

My customer.xml file is as below:

<default>
        <!-- Mage_Customer -->
        <reference name="top.links">
            <action method="addLink" translate="label title" module="cms"><label>Bulk orders</label><URL><![CDATA[https://www.depoto.com/bulkorders/]]></URL><title>Bulk orders</title><prepare/><urlParams/><position>10</position></action>
        </reference>
</default>
1

simple add restriction on link

if(Mage::getSingleton('customer/session')->isLoggedIn()) {
 ?>
<a href="<?php echo Mage::getUrl('bulkorders'); ?>">bulkorders</a>
<?php
} else {
?>
<a href="<?php echo Mage::getUrl('customer/account/login'); ?>">bulkorders</a>
<?php 
} ?>

for login user

<customer_logged_in>
    <reference name="top.links">
        <action method="addLink" translate="label title" module="cms"><label>Bulk orders</label><URL><![CDATA[https://www.depoto.com/bulkorders/]]></URL><title>Bulk orders</title><prepare/><urlParams/><position>10</position></action>
    </reference>
</customer_logged_in>

not login user

<customer_logged_out>
 <reference name="top.links">
     <action method="addLink" translate="label title" module="customer"><label>Bulk orders</label><url helper="customer/getLoginUrl"/><title>Bulk orders</title><prepare/><urlParams/><position>100</position></action>
 </reference>
</customer_logged_out>
  • @TejabhagavanKollepara updated the answer too.. – Qaisar Satti Aug 23 '16 at 7:19
  • where and how can i have to add this code at my customer.xml plz tell me – Teja Bhagavan Kollepara Aug 23 '16 at 7:25
  • @TejabhagavanKollepara in the place of your existing code.. – Qaisar Satti Aug 23 '16 at 7:26
  • Means, i have to replace my customer.xml with above both? – Teja Bhagavan Kollepara Aug 23 '16 at 7:28
  • nope replace with this code <reference name="top.links"> <action method="addLink" translate="label title" module="cms"><label>Bulk orders</label><URL><![CDATA[https://www.depoto.com/bulkorders/]]></URL><title>Bulk orders</title><prepare/><urlParams/><position>10</position></action> </reference> – Qaisar Satti Aug 23 '16 at 7:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.