限制用户在magento中查看产品

发布于 2024-10-04 21:28:14 字数 31 浏览 0 评论 0原文

限制登录用户的产品详细信息页面的最佳方法是什么?

What is the best way to restrict product detail page for logged in user?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

请叫√我孤独 2024-10-11 21:28:14

将登录检查添加到控制器,或者如果必须,则添加到具有以下条件的视图

$this->helper('customer')->isLoggedIn();

add the login check to controller, or if you must then to the view with the following condition

$this->helper('customer')->isLoggedIn();
撞了怀 2024-10-11 21:28:14

谢谢各位的回复。我找到了另一种选择,通过添加您的受限参考 <删除名称=“wishlist_sidebar”>< /删除>
在这个标签中< customer_logged_out >在 customer.xml 中。
现在,如果客户注销,他将看不到 Wishlist_sidbar 块。
你对这个方法的看法。

Thanks guyes for your reply. I found one more option to do that by adding your restricted referance < remove name="wishlist_sidebar" >< /remove >
in this tag < customer_logged_out > at customer.xml.
now if customer is logged out he will not see the wishlist_sidbar block.
What you say about this approch.

燃情 2024-10-11 21:28:14
<?php 
   if(Mage::getSingleton('customer/session')->isLoggedIn()){ 
      echo "loggein user";
   else{
      echo "no loggein user";
   }
?> 
<?php 
   if(Mage::getSingleton('customer/session')->isLoggedIn()){ 
      echo "loggein user";
   else{
      echo "no loggein user";
   }
?> 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文