我现在有一个类名为
class Address{
       public function getGroupedAllShippingRates()
    {
        $rates = array();
        foreach ($this->getShippingRatesCollection() as $rate) {
            if (!$rate->isDeleted() && $rate->getCarrierInstance()) {
                if (!isset($rates[$rate->getCarrier()])) {
                
                    $rates[$rate->getCarrier()] = array();
                }                $rates[$rate->getCarrier()][] = $rate;
                $rates[$rate->getCarrier()][0]->carrier_sort_order = $rate->getCarrierInstance()->getSortOrder();
            }
        }
        uasort($rates, array($this, '_sortRates'));
        return $rates;
    }    public function getShippingRatesCollection()
    {
        我在这里用 echo "打印不了数据";
        if (is_null($this->_rates)) {            $this->_rates = Mage::getModel('sales/quote_address_rate')->getCollection()
                ->setAddressFilter($this->getId());
            if ($this->getId()) {
                foreach ($this->_rates as $rate) {
                    $rate->setAddress($this);
                }
            }
        }        return $this->_rates;
    }}请各位帮忙求解

解决方案 »

  1.   

    可以打印,你怎么调用的?$c=new Address();
    $c->getShippingRatesCollection();
      

  2.   


    这个是magento里的代码,我是直接在public function getShippingRatesCollection()这里打印,我的目的是想确定一下,是不是调用这个方法,因为我现在在做运费修改的功能,想要找到运费的逻辑代码