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


PHP Config::displaySalesShippingBoth方法代码示例

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


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

示例1: checkDisplaySettings

 /**
  * Check if tax calculation type and price display settings are compatible
  *
  * Invalid settings if
  *      Tax Calculation Method Based On 'Total' or 'Row'
  *      and at least one Price Display Settings has 'Including and Excluding Tax' value
  *
  * @param null|int|bool|string|\Magento\Store\Model\Store $store $store
  * @return bool
  */
 public function checkDisplaySettings($store = null)
 {
     if ($this->taxConfig->getAlgorithm($store) == \Magento\Tax\Model\Calculation::CALC_UNIT_BASE) {
         return true;
     }
     return $this->taxConfig->getPriceDisplayType($store) != \Magento\Tax\Model\Config::DISPLAY_TYPE_BOTH && $this->taxConfig->getShippingPriceDisplayType($store) != \Magento\Tax\Model\Config::DISPLAY_TYPE_BOTH && !$this->taxConfig->displayCartPricesBoth($store) && !$this->taxConfig->displayCartSubtotalBoth($store) && !$this->taxConfig->displayCartShippingBoth($store) && !$this->taxConfig->displaySalesPricesBoth($store) && !$this->taxConfig->displaySalesSubtotalBoth($store) && !$this->taxConfig->displaySalesShippingBoth($store);
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:17,代码来源:Notifications.php

示例2: getTotalsForDisplay

 /**
  * Get array of arrays with totals information for display in PDF
  * array(
  *  $index => array(
  *      'amount'   => $amount,
  *      'label'    => $label,
  *      'font_size'=> $font_size
  *  )
  * )
  * @return array
  */
 public function getTotalsForDisplay()
 {
     $store = $this->getOrder()->getStore();
     $amount = $this->getOrder()->formatPriceTxt($this->getAmount());
     $amountInclTax = $this->getSource()->getShippingInclTax();
     if (!$amountInclTax) {
         $amountInclTax = $this->getAmount() + $this->getSource()->getShippingTaxAmount();
     }
     $amountInclTax = $this->getOrder()->formatPriceTxt($amountInclTax);
     $fontSize = $this->getFontSize() ? $this->getFontSize() : 7;
     if ($this->_taxConfig->displaySalesShippingBoth($store)) {
         $totals = [['amount' => $this->getAmountPrefix() . $amount, 'label' => __('Shipping (Excl. Tax)') . ':', 'font_size' => $fontSize], ['amount' => $this->getAmountPrefix() . $amountInclTax, 'label' => __('Shipping (Incl. Tax)') . ':', 'font_size' => $fontSize]];
     } elseif ($this->_taxConfig->displaySalesShippingInclTax($store)) {
         $totals = [['amount' => $this->getAmountPrefix() . $amountInclTax, 'label' => __($this->getTitle()) . ':', 'font_size' => $fontSize]];
     } else {
         $totals = [['amount' => $this->getAmountPrefix() . $amount, 'label' => __($this->getTitle()) . ':', 'font_size' => $fontSize]];
     }
     return $totals;
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:30,代码来源:Shipping.php

示例3: getShippingLabel

 /**
  * Get label for shipping total based on configuration settings
  *
  * @return string
  */
 public function getShippingLabel()
 {
     $source = $this->getSource();
     if ($this->_taxConfig->displaySalesShippingInclTax($source->getOrder()->getStoreId())) {
         $label = __('Refund Shipping (Incl. Tax)');
     } elseif ($this->_taxConfig->displaySalesShippingBoth($source->getOrder()->getStoreId())) {
         $label = __('Refund Shipping (Excl. Tax)');
     } else {
         $label = __('Refund Shipping');
     }
     return $label;
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:17,代码来源:Adjustments.php

示例4: _initShipping

 /**
  * @return $this
  */
 protected function _initShipping()
 {
     $store = $this->getStore();
     $parent = $this->getParentBlock();
     $shipping = $parent->getTotal('shipping');
     if (!$shipping) {
         return $this;
     }
     if ($this->_config->displaySalesShippingBoth($store)) {
         $shipping = (double) $this->_source->getShippingAmount();
         $baseShipping = (double) $this->_source->getBaseShippingAmount();
         $shippingIncl = (double) $this->_source->getShippingInclTax();
         if (!$shippingIncl) {
             $shippingIncl = $shipping + (double) $this->_source->getShippingTaxAmount();
         }
         $baseShippingIncl = (double) $this->_source->getBaseShippingInclTax();
         if (!$baseShippingIncl) {
             $baseShippingIncl = $baseShipping + (double) $this->_source->getBaseShippingTaxAmount();
         }
         $totalExcl = new \Magento\Framework\DataObject(['code' => 'shipping', 'value' => $shipping, 'base_value' => $baseShipping, 'label' => __('Shipping & Handling (Excl.Tax)')]);
         $totalIncl = new \Magento\Framework\DataObject(['code' => 'shipping_incl', 'value' => $shippingIncl, 'base_value' => $baseShippingIncl, 'label' => __('Shipping & Handling (Incl.Tax)')]);
         $parent->addTotal($totalExcl, 'shipping');
         $parent->addTotal($totalIncl, 'shipping');
     } elseif ($this->_config->displaySalesShippingInclTax($store)) {
         $shippingIncl = $this->_source->getShippingInclTax();
         if (!$shippingIncl) {
             $shippingIncl = $this->_source->getShippingAmount() + $this->_source->getShippingTaxAmount();
         }
         $baseShippingIncl = $this->_source->getBaseShippingInclTax();
         if (!$baseShippingIncl) {
             $baseShippingIncl = $this->_source->getBaseShippingAmount() + $this->_source->getBaseShippingTaxAmount();
         }
         $total = $parent->getTotal('shipping');
         if ($total) {
             $total->setValue($shippingIncl);
             $total->setBaseValue($baseShippingIncl);
         }
     }
     return $this;
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:43,代码来源:Tax.php


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