當前位置: 首頁>>代碼示例>>PHP>>正文


PHP OrderInjectable::getPrice方法代碼示例

本文整理匯總了PHP中Magento\Sales\Test\Fixture\OrderInjectable::getPrice方法的典型用法代碼示例。如果您正苦於以下問題:PHP OrderInjectable::getPrice方法的具體用法?PHP OrderInjectable::getPrice怎麽用?PHP OrderInjectable::getPrice使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Magento\Sales\Test\Fixture\OrderInjectable的用法示例。


在下文中一共展示了OrderInjectable::getPrice方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: prepareExpectedResult

 /**
  * Prepare expected result
  *
  * @param array $expectedInvoiceData
  * @return array
  */
 protected function prepareExpectedResult(array $expectedInvoiceData)
 {
     $totalInvoice = $this->order->getPrice()[0]['grand_invoice_total'];
     $expectedInvoiceData['invoiced'] += 1;
     $expectedInvoiceData['qty'] += 1;
     $expectedInvoiceData['total-invoiced'] += $totalInvoice;
     return $expectedInvoiceData;
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:14,代碼來源:AbstractAssertInvoiceReportResult.php

示例2: prepareExpectedResult

 /**
  * Prepare expected result
  *
  * @param array $expectedSalesData
  * @return array
  */
 protected function prepareExpectedResult(array $expectedSalesData)
 {
     $salesItems = 0;
     $invoice = $this->order->getPrice()[0]['grand_invoice_total'];
     $salesTotal = $this->order->getPrice()[0]['grand_order_total'];
     foreach ($this->order->getEntityId()['products'] as $product) {
         $salesItems += $product->getCheckoutData()['qty'];
     }
     $expectedSalesData['orders'] += 1;
     $expectedSalesData['sales-items'] += $salesItems;
     $expectedSalesData['sales-total'] += $salesTotal;
     $expectedSalesData['invoiced'] += $invoice;
     return $expectedSalesData;
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:20,代碼來源:AbstractAssertSalesReportResult.php

示例3: processAssert

 /**
  * Assert that invoiced Grand Total amount is equal to placed order Grand total amount on invoice page (frontend)
  *
  * @param OrderHistory $orderHistory
  * @param OrderInjectable $order
  * @param CustomerOrderView $customerOrderView
  * @param InvoiceView $invoiceView
  * @param array $ids
  * @return void
  */
 public function processAssert(OrderHistory $orderHistory, OrderInjectable $order, CustomerOrderView $customerOrderView, InvoiceView $invoiceView, array $ids)
 {
     $this->loginCustomerAndOpenOrderPage($order->getDataFieldConfig('customer_id')['source']->getCustomer());
     $orderHistory->getOrderHistoryBlock()->openOrderById($order->getId());
     $customerOrderView->getOrderViewBlock()->openLinkByName('Invoices');
     foreach ($ids['invoiceIds'] as $key => $invoiceId) {
         \PHPUnit_Framework_Assert::assertEquals(number_format($order->getPrice()[$key]['grand_invoice_total'], 2), $invoiceView->getInvoiceBlock()->getItemBlock($invoiceId)->getGrandTotal());
     }
 }
開發者ID:andrewhowdencom,項目名稱:m2onk8s,代碼行數:19,代碼來源:AssertInvoicedAmountOnFrontend.php

示例4: processAssert

 /**
  * Assert that refund is present in the tab with ID and refunded amount(depending on full/partial refund).
  *
  * @param SalesOrderView $salesOrderView
  * @param OrderIndex $orderIndex
  * @param OrderInjectable $order
  * @param array $ids
  * @return void
  */
 public function processAssert(SalesOrderView $salesOrderView, OrderIndex $orderIndex, OrderInjectable $order, array $ids)
 {
     $orderIndex->open();
     $orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]);
     $salesOrderView->getOrderForm()->openTab('creditmemos');
     /** @var Grid $grid */
     $grid = $salesOrderView->getOrderForm()->getTab('creditmemos')->getGridBlock();
     $amount = $order->getPrice();
     foreach ($ids['creditMemoIds'] as $key => $creditMemoId) {
         $filter = ['id' => $creditMemoId, 'amount_from' => $amount[$key]['grand_creditmemo_total'], 'amount_to' => $amount[$key]['grand_creditmemo_total']];
         \PHPUnit_Framework_Assert::assertTrue($grid->isRowVisible($filter, true, false), 'Credit memo is absent on credit memos tab.');
     }
 }
開發者ID:andrewhowdencom,項目名稱:m2onk8s,代碼行數:22,代碼來源:AssertRefundInCreditMemoTab.php

示例5: processAssert

 /**
  * Assert invoice with corresponding order ID is present in the invoices grid with corresponding amount
  *
  * @param InvoiceIndex $invoiceIndex
  * @param OrderInjectable $order
  * @param array $ids
  * @return void
  */
 public function processAssert(InvoiceIndex $invoiceIndex, OrderInjectable $order, array $ids)
 {
     $invoiceIndex->open();
     $amount = $order->getPrice();
     $orderId = $order->getId();
     foreach ($ids['invoiceIds'] as $key => $invoiceId) {
         $filter = ['id' => $invoiceId, 'order_id' => $orderId, 'grand_total_from' => $amount[$key]['grand_invoice_total'], 'grand_total_to' => $amount[$key]['grand_invoice_total']];
         $invoiceIndex->getInvoicesGrid()->search($filter);
         $filter['grand_total_from'] = number_format($amount[$key]['grand_invoice_total'], 2);
         $filter['grand_total_to'] = number_format($amount[$key]['grand_invoice_total'], 2);
         \PHPUnit_Framework_Assert::assertTrue($invoiceIndex->getInvoicesGrid()->isRowVisible($filter, false, false), 'Invoice is absent in invoices grid on invoice index page.');
     }
 }
開發者ID:andrewhowdencom,項目名稱:m2onk8s,代碼行數:21,代碼來源:AssertInvoiceInInvoicesGrid.php

示例6: processAssert

 /**
  * Assert that refund is present in the 'Refunds' grid with correct ID, order ID, refunded amount
  *
  * @param CreditMemoIndex $creditMemoIndex
  * @param OrderInjectable $order
  * @param array $ids
  * @return void
  */
 public function processAssert(CreditMemoIndex $creditMemoIndex, OrderInjectable $order, array $ids)
 {
     $creditMemoIndex->open();
     $amount = $order->getPrice();
     $orderId = $order->getId();
     foreach ($ids['creditMemoIds'] as $key => $creditMemoId) {
         $filter = ['id' => $creditMemoId, 'order_id' => $orderId, 'grand_total_from' => $amount[$key]['grand_creditmemo_total'], 'grand_total_to' => $amount[$key]['grand_creditmemo_total']];
         $creditMemoIndex->getCreditMemoGrid()->search($filter);
         $filter['grand_total_from'] = number_format($amount[$key]['grand_creditmemo_total'], 2);
         $filter['grand_total_to'] = number_format($amount[$key]['grand_creditmemo_total'], 2);
         \PHPUnit_Framework_Assert::assertTrue($creditMemoIndex->getCreditMemoGrid()->isRowVisible($filter, false, false), "Credit memo '#{$creditMemoId}' is absent in credit memos grid on credit memo index page.");
     }
 }
開發者ID:andrewhowdencom,項目名稱:m2onk8s,代碼行數:21,代碼來源:AssertRefundInRefundsGrid.php

示例7: processAssert

 /**
  * Assert that invoice is present in the invoices tab of the order with corresponding amount(Grand Total)
  *
  * @param SalesOrderView $salesOrderView
  * @param OrderIndex $orderIndex
  * @param OrderInjectable $order
  * @param array $ids
  * @return void
  */
 public function processAssert(SalesOrderView $salesOrderView, OrderIndex $orderIndex, OrderInjectable $order, array $ids)
 {
     $orderIndex->open();
     $orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $order->getId()]);
     $salesOrderView->getOrderForm()->openTab('invoices');
     /** @var Grid $grid */
     $grid = $salesOrderView->getOrderForm()->getTabElement('invoices')->getGridBlock();
     $amount = $order->getPrice();
     foreach ($ids['invoiceIds'] as $key => $invoiceId) {
         $filter = ['id' => $invoiceId, 'amount_from' => $amount[$key]['grand_invoice_total'], 'amount_to' => $amount[$key]['grand_invoice_total']];
         $grid->search($filter);
         $filter['amount_from'] = number_format($amount[$key]['grand_invoice_total'], 2);
         $filter['amount_to'] = number_format($amount[$key]['grand_invoice_total'], 2);
         \PHPUnit_Framework_Assert::assertTrue($grid->isRowVisible($filter, false, false), 'Invoice is absent on invoices tab.');
     }
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:25,代碼來源:AssertInvoiceInInvoicesTab.php


注:本文中的Magento\Sales\Test\Fixture\OrderInjectable::getPrice方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。