【问题标题】:Magento: Get all configured rates of the tablerate shipping moduleMagento:获取 tablerate 运输模块的所有配置费率
【发布时间】:2023-03-15 17:09:01
【问题描述】:

我被困在我认为应该是小问题的问题上,但我还没有找到解决方案。

我正在开发一个模块,该模块必须通过 tablerate 运输模块的所有配置费率。但是如何获得所有配置的费率,而不仅仅是适合给定条件的费率?我查看了相应资源模型(“shipping/carrier_tablerate”)的代码,发现 getRate($request) 方法将 select 查询限制为 1,因此只返回 1 个费率。

有没有一种简单的方法来获取所有配置的费率?有没有内置的方法可以做到这一点,还是我必须执行自己的数据库操作?

【问题讨论】:

    标签: magento shipping


    【解决方案1】:
    $tablerateColl = Mage::getResourceModel('shipping/carrier_tablerate_collection');
    /* @var $tablerateColl Mage_Shipping_Model_Resource_Carrier_Tablerate_Collection */
    
    foreach ($tablerateColl as $tablerate) {
        /* @var $tablerate Mage_Shipping_Model_Carrier_Tablerate */
        Zend_Debug::dump($tablerate->debug());
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-09-22
      • 2013-05-11
      • 1970-01-01
      • 1970-01-01
      • 2012-07-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多