简体   繁体   中英

Hide text in category pages for not logged in customer in Magento

I need to hide a button that leads to a price list in my category pages.

I create my pages by creating static block and link that with code:

{{block type="core/template" template="catalog/category/SacToiledeJute.phtml"}}

I need now to hide a text that include the button in the SacToiledeJute.phtml page for not logged in customer but not the whole page.

I have searched in google on the code to hide that button with no luck.

I hope I can find this here.

Thanks in advance

Very simple..

Just add this code in SacToiledeJute.phtml:

$isLoggedIn = Mage::getSingleton('customer/session')->isLoggedIn();

if($isLoggedIn){
        // your code
        // here
}

Please let me know if it works for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM