【问题标题】:Magento: How to get the creditmemo by order item quote idMagento:如何通过订单项目报价 ID 获取 creditmemo
【发布时间】:2011-04-29 14:31:26
【问题描述】:

我有一个 magento 订单的增量 ID 和一个订单项目的报价 ID(我不是指订单项目 ID),我想要包含该订单项目的相应 creditmemo 项目的所有 creditmemos。

如果我在 magento 中使用 creditmemo 模型,我可以使用 getOrderItem() 来获取订单项目,然后我可以使用 getOrder() 来获取订单。但是magento中的订单模型没有getCreditmemoItems()。

有没有更好的方法来代替对订单的 getCreditmemosCollection() 和每个 creditmemo 项目进行迭代?

【问题讨论】:

    标签: php magento orders


    【解决方案1】:

    使用这个:

    $collection = Mage::getResourceModel('sales/order_creditmemo_collection')
            ->addAttributeToFilter('order_id', array('eq' => $order->getEntityId()))
            ->addAttributeToSelect('*');
    

    【讨论】:

      猜你喜欢
      • 2014-07-30
      • 2013-08-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-24
      • 2017-11-22
      • 1970-01-01
      • 2023-04-10
      相关资源
      最近更新 更多