我已经启用了两种运输方式。1. 表率 2. 免费送货
我只需要显示一种运输方式,还需要启用两种运输方式。我在 app\code\core\Mage\Checkout\Block\Onepage\Shipping\Method\Available.php 中自定义了代码
if (!empty($groups)) {
$ratesFilter = new Varien_Filter_Object_Grid();
$ratesFilter->addFilter(Mage::app()->getStore()->getPriceFilter(), 'price');
$custom = array();
$k=0;
foreach ($groups as $code => $groupItems) {
$custom['shippingmethod'][$k] = $code;
$k++;
}
$check = array('tablerate','freeshipping');
if(in_array($check,$custom)){
foreach ($groups as $code => $groupItems) {
if($code == 'tablerate')
$groups[$code] = $ratesFilter->filter($groupItems);
}
} else {
foreach ($groups as $code => $groupItems) {
$groups[$code] = $ratesFilter->filter($groupItems);
}
}
}
但它没有给我运输方式的价格。有没有其他解决方案?