计算从旧价格到新价格的折扣百分比时出现问题。当旧价格超过100美元时,折扣价值的百分比是错误的,但当低于100美元时,折扣的百分比是正确的。这个脚本有什么问题?真的需要你的帮助家伙.. 我使用Magento的1.4,折扣产品的错误计算
$_oldprice= substr(Mage::helper('core')->currency($_regularPrice,true,false),2);
$_newprice= substr(Mage::helper('core')->currency($_finalPrice,true,false),2);
$_discountprice= $_oldprice- $_newprice;
$count1 = $_discountprice/$_oldprice;
$count2 = $count1 * 100;
$count = number_format($count2, 0);
有人帮我请.. –
再次有人帮我请.. –