使用价格规则解决
我已根据客户群按百分比更改了价格方案。所以我在这里为产品做了诀窍
if ($group->getCode() == "High ST. Shops") {
$percent = 100 - $_product->getHighstshopPerc();
$percent = "0." . $percent;
$srrp = $_product->getPrice() * $percent;
echo "Your Price £" . number_format($srrp, 2, '.', '');
}
现在我需要getPrice()来自我的新方案price.php,所以它正确地添加到购物车。我尝试了下面的代码,但我不能让getCode()给我客户组,所以我可以计算/覆盖getPrice
public function getPrice($product)
{
//$groupId = Mage::getSingleton('customer/session')->getCustomerGroupId();
//$group = Mage::getModel('customer/group')->load($groupId);
//return $product->getData('price');
//return $product->getTradePerc();
//echo $product->getCode(); exit();
if ($product->getCode() == "NOT LOGGED IN")
return 1;
else return 2;
}