0
我使用Magento的1.4Magento的Overiding购物车价格问题
我在由 /httpdocs资料/应用/代码创建一个脚本乘坐购物车的价格/本地/法师/销售/型号/报价/项目.PHP
在Item.php,我有这样的代码:
public function setPrice($price) //set the unit price
{
$qty = $this->getQty;
$_helper = Mage::helper('catalog/output');
Mage::getModel('catalog/product')->load($_product->getId);
$_product = $this->getProduct();
$childProducts = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null,$_product);
foreach($childProducts as $_attribute){
$tierPrices = $_helper->productAttribute($_attribute,$_attribute->getFormatedTierPrice());
foreach($tierPrices as $tierPrice){
if($qty == $tierPrice['price_qty']){
$price = $tierPrice['price'];
break;
}
}
}
$this->price = $price;
}
每次我添加到购物车产品,它应该进入到购物车页面,但现在会发生什么是我刚得到一个空白的白页。 当我也检查我的FireBug的控制台时,我得到一个网络错误:500内部服务器错误。
我觉得为什么出现这种情况的原因是我在这行代码:
![$childProducts = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null,$_product);][1]
当我试图取消对一个,一切都没问题。
我附上了一些图片。
你能告诉我这个解决方案吗?你的帮助将不胜感激。 谢谢!
我仍然遇到同样的问题。我仍然在前往白色的空白页面。 '$ _product = $ this-> getProduct(); (Mage :: app() - > getStore() - > getId()) - > load($ _ product-> getID); $ productProducts = Mage :: getModel('catalog/product_type_configurable') - > getUsedProducts(null,$ _ product);' – PinoyStackOverflower