简体   繁体   English

Magento:如果已记录,则隐藏Msrp价格以指定客户组

[英]Magento: Hide Msrp price if is logged specify customer group

Is possible hide in Magento msrp price if is logged specify customer group? 如果记录下来,可以指定客户组隐藏在Magento MSRP价格中吗?

We have this in our template: 我们的模板中包含以下内容:

 <?php if ($_product->getMsrp()): ?> <?php $_msrpPrice = $this->helper('core')->currency($_product->getMsrp(),true,true) ?> <p class="beznacena"> <span ><?php echo $this->__('Manufacture price:'); ?><?php echo $_msrpPrice ?></span> </p> <?php endif; ?> 

I would really appreciate any help. 我真的很感谢您的帮助。

use this code to find logged in user group ID then use if else in template to hide prices. 使用此代码查找登录的用户组ID,然后在模板中使用if(否则)隐藏价格。

if(Mage::getSingleton('customer/session')->isLoggedIn())
{
      // Get group Id
      $groupId = Mage::getSingleton('customer/session')->getCustomerGroupId();
      //Get customer Group name
      $group = Mage::getModel('customer/group')->load($groupId);
      echo $group->getCode();
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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