我正在使用CMS页面和静态块,并希望隐藏文本段落以免将其显示给批发组。
magento有可能吗?请帮助。
Magento 1.8.1
如果要隐藏文本段落,然后首先签wholesaler is logged
入或不签入,则选中current customer group
是wholesaler
。
此处代码添加在header.phtml中
<?php
if(Mage::getSingleton('customer/session')->isLoggedIn() and Mage::getSingleton('customer/session')->getCustomerGroupId()==2 ){
?>
<script type="text/javascript">
document.getElementById("noforid").style.display=none;
</script>
/* using jquery*/
<?php
// do not show paragraph
//Get customer Group name
$group = Mage::getModel('customer/group')->load($groupId);
}
else{
?>
<?php
// text paragraph of your
}
?>
然后放您的内容,in a html element
然后放id of element
。使用java-script hide
该内容。
<p id="noforid">your text</p>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句