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


PHP Object::getTaxAmount方法代码示例

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


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

示例1: _initGrandTotal

 /**
  * @return $this
  */
 protected function _initGrandTotal()
 {
     $store = $this->getStore();
     $parent = $this->getParentBlock();
     $grandototal = $parent->getTotal('grand_total');
     if (!$grandototal || !(double) $this->_source->getGrandTotal()) {
         return $this;
     }
     if ($this->_config->displaySalesTaxWithGrandTotal($store)) {
         $grandtotal = $this->_source->getGrandTotal();
         $baseGrandtotal = $this->_source->getBaseGrandTotal();
         $grandtotalExcl = $grandtotal - $this->_source->getTaxAmount();
         $baseGrandtotalExcl = $baseGrandtotal - $this->_source->getBaseTaxAmount();
         $grandtotalExcl = max($grandtotalExcl, 0);
         $baseGrandtotalExcl = max($baseGrandtotalExcl, 0);
         $totalExcl = new \Magento\Framework\Object(['code' => 'grand_total', 'strong' => true, 'value' => $grandtotalExcl, 'base_value' => $baseGrandtotalExcl, 'label' => __('Grand Total (Excl.Tax)')]);
         $totalIncl = new \Magento\Framework\Object(['code' => 'grand_total_incl', 'strong' => true, 'value' => $grandtotal, 'base_value' => $baseGrandtotal, 'label' => __('Grand Total (Incl.Tax)')]);
         $parent->addTotal($totalExcl, 'grand_total');
         $this->_addTax('grand_total');
         $parent->addTotal($totalIncl, 'tax');
     }
     return $this;
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:26,代码来源:Tax.php

示例2: getSubtotalInclTax

 /**
  * Get sales item (quote item, order item etc) row total price including tax
  *
  * @param   \Magento\Framework\Object $item
  * @return  float
  */
 public function getSubtotalInclTax($item)
 {
     if ($item->getRowTotalInclTax()) {
         return $item->getRowTotalInclTax();
     }
     $tax = $item->getTaxAmount() + $item->getDiscountTaxCompensation();
     return $item->getRowTotal() + $tax;
 }
开发者ID:zhangjiachao,项目名称:magento2,代码行数:14,代码来源:Data.php

示例3: displaySubtotalInclTax

 /**
  * Retrieve subtotal price include tax html formated content
  *
  * @param \Magento\Framework\Object $item
  * @return string
  */
 public function displaySubtotalInclTax($item)
 {
     $baseTax = $item->getTaxBeforeDiscount() ? $item->getTaxBeforeDiscount() : ($item->getTaxAmount() ? $item->getTaxAmount() : 0);
     $tax = $item->getBaseTaxBeforeDiscount() ? $item->getBaseTaxBeforeDiscount() : ($item->getBaseTaxAmount() ? $item->getBaseTaxAmount() : 0);
     return $this->displayPrices($item->getBaseRowTotal() + $baseTax, $item->getRowTotal() + $tax);
 }
开发者ID:Atlis,项目名称:docker-magento2,代码行数:12,代码来源:AbstractItems.php

示例4: _getInitialItem

 /**
  * Create and return new order item based on payment item data and $itemInfo
  * for initial payment
  *
  * @param \Magento\Framework\Object $itemInfo
  * @return \Magento\Sales\Model\Order\Item
  */
 protected function _getInitialItem($itemInfo)
 {
     $price = $itemInfo->getPrice() ? $itemInfo->getPrice() : $this->getInitAmount();
     $shippingAmount = $itemInfo->getShippingAmount() ? $itemInfo->getShippingAmount() : 0;
     $taxAmount = $itemInfo->getTaxAmount() ? $itemInfo->getTaxAmount() : 0;
     $item = $this->_orderItemFactory->create()->setStoreId($this->getStoreId())->setProductType(\Magento\Catalog\Model\Product\Type::TYPE_VIRTUAL)->setIsVirtual(1)->setSku('initial_fee')->setName(__('Recurring Payment Initial Fee'))->setDescription('')->setWeight(0)->setQtyOrdered(1)->setPrice($price)->setOriginalPrice($price)->setBasePrice($price)->setBaseOriginalPrice($price)->setRowTotal($price)->setBaseRowTotal($price)->setTaxAmount($taxAmount)->setShippingAmount($shippingAmount);
     $option = array('label' => __('Payment type'), 'value' => __('Initial period payment'));
     $this->_addAdditionalOptionToItem($item, $option);
     return $item;
 }
开发者ID:aiesh,项目名称:magento2,代码行数:17,代码来源:Payment.php


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