当前位置: 首页>>代码示例>>PHP>>正文


PHP Item::getOrderId方法代码示例

本文整理汇总了PHP中Magento\Sales\Model\Order\Item::getOrderId方法的典型用法代码示例。如果您正苦于以下问题:PHP Item::getOrderId方法的具体用法?PHP Item::getOrderId怎么用?PHP Item::getOrderId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Magento\Sales\Model\Order\Item的用法示例。


在下文中一共展示了Item::getOrderId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: assertOrderItem

 /**
  * @param \Magento\Sales\Model\Order\Item $orderItem
  * @param array $response
  * @return void
  */
 protected function assertOrderItem(\Magento\Sales\Model\Order\Item $orderItem, array $response)
 {
     $this->assertEquals($orderItem->getId(), $response['item_id']);
     $this->assertEquals($orderItem->getOrderId(), $response['order_id']);
     $this->assertEquals($orderItem->getProductId(), $response['product_id']);
     $this->assertEquals($orderItem->getProductType(), $response['product_type']);
     $this->assertEquals($orderItem->getBasePrice(), $response['base_price']);
     $this->assertEquals($orderItem->getRowTotal(), $response['row_total']);
 }
开发者ID:whoople,项目名称:magento2-testing,代码行数:14,代码来源:OrderItemGetListTest.php

示例2: testSetOrder

 public function testSetOrder()
 {
     $orderId = 123;
     $order = $this->getMock('Magento\\Sales\\Model\\Order', [], [], '', false);
     $order->expects($this->once())->method('getId')->willReturn($orderId);
     $this->assertEquals($this->model, $this->model->setOrder($order));
     $this->assertEquals($orderId, $this->model->getOrderId());
 }
开发者ID:tingyeeh,项目名称:magento2,代码行数:8,代码来源:ItemTest.php

示例3: refundOrder

 /**
  * @param \Magento\Sales\Model\Order\Item $orderItem
  * @return void
  */
 protected function refundOrder(\Magento\Sales\Model\Order\Item $orderItem)
 {
     $creditmemoLoader = $this->creditmemoLoaderFactory->create();
     $creditmemoLoader->setOrderId($orderItem->getOrderId());
     $creditmemoLoader->setCreditmemo($this->getCreditmemoData($orderItem));
     $creditmemo = $creditmemoLoader->load();
     if ($creditmemo && $creditmemo->isValidGrandTotal()) {
         $creditmemo->setOfflineRequested(true);
         $this->creditmemoManagement->refund($creditmemo, true);
     }
 }
开发者ID:vinai-drive-by-commits,项目名称:magento2-sample-data,代码行数:15,代码来源:Processor.php

示例4: refundOrder

 /**
  * @param \Magento\Sales\Model\Order\Item $orderItem
  * @return void
  */
 protected function refundOrder(\Magento\Sales\Model\Order\Item $orderItem)
 {
     $creditmemoLoader = $this->creditmemoLoaderFactory->create();
     $creditmemoLoader->setOrderId($orderItem->getOrderId());
     $creditmemoLoader->setCreditmemo($this->getCreditmemoData($orderItem));
     $creditmemo = $creditmemoLoader->load();
     if ($creditmemo && $creditmemo->isValidGrandTotal()) {
         $creditmemo->setOfflineRequested(true);
         $creditmemo->register();
         $creditmemoTransaction = $this->transactionFactory->create()->addObject($creditmemo)->addObject($creditmemo->getOrder());
         $creditmemoTransaction->save();
     }
 }
开发者ID:ktplKunj,项目名称:TestMagento,代码行数:17,代码来源:Processor.php


注:本文中的Magento\Sales\Model\Order\Item::getOrderId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。