[英]hide price and add_cart for anonymous user in drupal
如何在Drupal中為匿名用戶隱藏價格和add_to_cart選項?
我認為,您可以進入dmin / people / permissions頁,然后取消選中匿名選項。
要隱藏字段,您可以創建節點--YOUR_CONTENT_TYPE.tpl.php
在此模板中,您可以檢查用戶角色:
global $user;
// Check if the user has the 'authenticated user' role.
if (in_array('authenticated user', $user->roles)) {
//show your field
}
你也總是可以從CSS隱藏-)
.not-logged-in .YOUR_CLASS_FIELD {display:none;}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.