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


PHP Order::getShippingInclTax方法代码示例

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


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

示例1: getTotal

 /**
  * @return TotalInterface
  */
 private function getTotal()
 {
     /** @var TotalInterface $total */
     $total = $this->totalFactory->create();
     $total->setBaseShippingAmount($this->order->getBaseShippingAmount());
     $total->setBaseShippingCanceled($this->order->getBaseShippingCanceled());
     $total->setBaseShippingDiscountAmount($this->order->getBaseShippingDiscountAmount());
     $total->setBaseShippingDiscountTaxCompensationAmnt($this->order->getBaseShippingDiscountTaxCompensationAmnt());
     $total->setBaseShippingInclTax($this->order->getBaseShippingInclTax());
     $total->setBaseShippingInvoiced($this->order->getBaseShippingInvoiced());
     $total->setBaseShippingRefunded($this->order->getBaseShippingRefunded());
     $total->setBaseShippingTaxAmount($this->order->getBaseShippingTaxAmount());
     $total->setBaseShippingTaxRefunded($this->order->getBaseShippingTaxRefunded());
     $total->setShippingAmount($this->order->getShippingAmount());
     $total->setShippingCanceled($this->order->getShippingCanceled());
     $total->setShippingDiscountAmount($this->order->getShippingDiscountAmount());
     $total->setShippingDiscountTaxCompensationAmount($this->order->getShippingDiscountTaxCompensationAmount());
     $total->setShippingInclTax($this->order->getShippingInclTax());
     $total->setShippingInvoiced($this->order->getShippingInvoiced());
     $total->setShippingRefunded($this->order->getShippingRefunded());
     $total->setShippingTaxAmount($this->order->getShippingTaxAmount());
     $total->setShippingTaxRefunded($this->order->getShippingTaxRefunded());
     return $total;
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:27,代码来源:ShippingBuilder.php

示例2: getShippingData

 /**
  * @param \Magento\Sales\Model\Order $order
  * @return array|null
  */
 public function getShippingData(\Magento\Sales\Model\Order $order)
 {
     if ($order->getShippingMethod()) {
         $shippingInclTax = (double) $order->getShippingInclTax();
         if ($shippingInclTax) {
             return ['name' => __('Shipping Method') . ': ' . $order->getShippingDescription(), 'unitPrice' => $shippingInclTax * 100, 'quantity' => 1];
         }
     }
     return null;
 }
开发者ID:tozwierz,项目名称:magento2_payupl,代码行数:14,代码来源:DataGetter.php

示例3: startTransaction

 public function startTransaction(Order $order, UrlInterface $url)
 {
     $config = new Config($this->_scopeConfig);
     $config->configureSDK();
     $additionalData = $order->getPayment()->getAdditionalInformation();
     $bankId = null;
     if (isset($additionalData['bank_id'])) {
         $bankId = $additionalData['bank_id'];
     }
     $total = $order->getGrandTotal();
     $items = $order->getAllVisibleItems();
     $orderId = $order->getIncrementId();
     $quoteId = $order->getQuoteId();
     $currency = $order->getOrderCurrencyCode();
     $returnUrl = $url->getUrl('paynl/checkout/finish/');
     $exchangeUrl = $url->getUrl('paynl/checkout/exchange/');
     $paymentOptionId = $this->getPaymentOptionId();
     $arrBillingAddress = $order->getBillingAddress();
     if ($arrBillingAddress) {
         $arrBillingAddress = $arrBillingAddress->toArray();
         $enduser = array('initials' => substr($arrBillingAddress['firstname'], 0, 1), 'lastName' => $arrBillingAddress['lastname'], 'phoneNumber' => $arrBillingAddress['telephone'], 'emailAddress' => $arrBillingAddress['email']);
         $invoiceAddress = array('initials' => substr($arrBillingAddress['firstname'], 0, 1), 'lastName' => $arrBillingAddress['lastname']);
         $arrAddress = \Paynl\Helper::splitAddress($arrBillingAddress['street']);
         $invoiceAddress['streetName'] = $arrAddress[0];
         $invoiceAddress['houseNumber'] = $arrAddress[1];
         $invoiceAddress['zipCode'] = $arrBillingAddress['postcode'];
         $invoiceAddress['city'] = $arrBillingAddress['city'];
         $invoiceAddress['country'] = $arrBillingAddress['country_id'];
     }
     $arrShippingAddress = $order->getShippingAddress();
     if ($arrShippingAddress) {
         $arrShippingAddress = $arrShippingAddress->toArray();
         $shippingAddress = array('initials' => substr($arrShippingAddress['firstname'], 0, 1), 'lastName' => $arrShippingAddress['lastname']);
         $arrAddress2 = \Paynl\Helper::splitAddress($arrShippingAddress['street']);
         $shippingAddress['streetName'] = $arrAddress2[0];
         $shippingAddress['houseNumber'] = $arrAddress2[1];
         $shippingAddress['zipCode'] = $arrShippingAddress['postcode'];
         $shippingAddress['city'] = $arrShippingAddress['city'];
         $shippingAddress['country'] = $arrShippingAddress['country_id'];
     }
     $data = array('amount' => $total, 'returnUrl' => $returnUrl, 'paymentMethod' => $paymentOptionId, 'bank' => $bankId, 'description' => $orderId, 'extra1' => $orderId, 'extra2' => $quoteId, 'exchangeUrl' => $exchangeUrl, 'currency' => $currency);
     if (isset($shippingAddress)) {
         $data['address'] = $shippingAddress;
     }
     if (isset($invoiceAddress)) {
         $data['invoiceAddress'] = $invoiceAddress;
     }
     if (isset($enduser)) {
         $data['enduser'] = $enduser;
     }
     $arrProducts = array();
     foreach ($items as $item) {
         $arrItem = $item->toArray();
         if ($arrItem['price_incl_tax'] != null) {
             // taxamount is not valid, because on discount it returns the taxamount after discount
             $taxAmount = $arrItem['price_incl_tax'] - $arrItem['price'];
             $product = array('id' => $arrItem['product_id'], 'name' => $arrItem['name'], 'price' => $arrItem['price_incl_tax'], 'qty' => $arrItem['qty_ordered'], 'tax' => $taxAmount);
         }
         $arrProducts[] = $product;
     }
     //shipping
     $shippingCost = $order->getShippingInclTax();
     $shippingTax = $order->getShippingTaxAmount();
     $shippingDescription = $order->getShippingDescription();
     $arrProducts[] = array('id' => 'shipping', 'name' => $shippingDescription, 'price' => $shippingCost, 'qty' => 1, 'tax' => $shippingTax);
     // kortingen
     $discount = $order->getDiscountAmount();
     $discountDescription = $order->getDiscountDescription();
     if ($discount != 0) {
         $arrProducts[] = array('id' => 'discount', 'name' => $discountDescription, 'price' => $discount, 'qty' => 1, 'tax' => $order->getDiscountTaxCompensationAmount() * -1);
     }
     $data['products'] = $arrProducts;
     if ($config->isTestMode()) {
         $data['testmode'] = 1;
     }
     $data['ipaddress'] = $order->getRemoteIp();
     $transaction = \Paynl\Transaction::start($data);
     return $transaction->getRedirectUrl();
 }
开发者ID:paynl,项目名称:magento2-plugin,代码行数:79,代码来源:PaymentMethod.php


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