[英]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. 我现在需要隐藏一个文本,其中包含SacToiledeJute.phtml页面中的按钮,用于未登录的客户,但不包括整个页面。
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: 只需在SacToiledeJute.phtml中添加此代码:
$isLoggedIn = Mage::getSingleton('customer/session')->isLoggedIn();
if($isLoggedIn){
// your code
// here
}
Please let me know if it works for you. 如果它适合您,请告诉我。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.