Magento:根据客户群获取产品价格 [英] Magento: Get product price given a customer group
本文介绍了Magento:根据客户群获取产品价格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在magento 1.7上 我为特殊会员"客户组创建了20%折扣的促销价格规则.
On magento 1.7 I created a promotional price rule of 20% discount for "special members" customer group.
我想同时显示两个价格.我以为会有
I'd like to display both prices. I thought there would be something like
$_product->getPriceByCustomerGroup( $groupId );
目标
(未登录):
- 正常价格:10.99美元
- 会员价:$ 5.99
(成员已登录):
- 正常价格:10.99美元
- 会员价:$ 5.99
推荐答案
在破解了一段时间后实现了自己的愿望
Fished my own wish after hacking on it for a while
$now = Mage::getSingleton('core/date')->timestamp( time() );
$websiteId = Mage::app()->getStore()->getWebsiteId();
$customerGroup = 4;
Mage::getResourceModel('catalogrule/rule')->getRulePrice( $now, $websiteId, $customerGroup, $_productId);
这篇关于Magento:根据客户群获取产品价格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文