Magento - 在collectRates方法之外保存运费

时间:2013-05-13 08:04:52

标签: magento shipping

我正在尝试根据尺寸,邮政编码和包裹类型(常规/快递)计算运费。我可以使用AUSPOST api来计算,但问题是在magento中将运费率保存在collectRates方法之外。如果我这样做......

$result = Mage::getModel('shipping/rate_result');


$method = Mage::getModel('shipping/rate_result_method');
$method->setCarrier("excellence_excellence");
$method->setMethod("excellence_excellence");
$method->setCarrierTitle("");
$method->setMethodTitle("");
$method->setPrice($myValue);
$method->setCost($myValue);
$result->append($method);

它不起作用,因为$ result必须保存在引用中。任何人都可以帮我吗?

0 个答案:

没有答案