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


PHP Config::displayCartSubtotalBoth方法代碼示例

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


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

 /**
  * Check if we need display both sobtotals
  *
  * @return bool
  */
 public function displayBoth()
 {
     /**
      * Check without store parameter - we wil get admin configuration value
      */
     return $this->_taxConfig->displayCartSubtotalBoth();
 }
開發者ID:zhangjiachao,項目名稱:magento2,代碼行數:12,代碼來源:Subtotal.php

示例3: fetch

 /**
  * Add tax totals information to address object
  *
  * @param \Magento\Quote\Model\Quote $quote
  * @param Address\Total $total
  * @return array|null
  * @SuppressWarnings(PHPMD.CyclomaticComplexity)
  * @SuppressWarnings(PHPMD.NPathComplexity)
  */
 public function fetch(\Magento\Quote\Model\Quote $quote, \Magento\Quote\Model\Quote\Address\Total $total)
 {
     $totals = [];
     $store = $quote->getStore();
     $applied = $total->getAppliedTaxes();
     if (is_string($applied)) {
         $applied = unserialize($applied);
     }
     $amount = $total->getTaxAmount();
     if ($amount == null) {
         $this->enhanceTotalData($quote, $total);
         $amount = $total->getTaxAmount();
     }
     $taxAmount = $amount + $total->getTotalAmount('discount_tax_compensation');
     $area = null;
     if ($this->_config->displayCartTaxWithGrandTotal($store) && $total->getGrandTotal()) {
         $area = 'taxes';
     }
     $totals[] = ['code' => $this->getCode(), 'title' => __('Tax'), 'full_info' => $applied ? $applied : [], 'value' => $amount, 'area' => $area];
     /**
      * Modify subtotal
      */
     if ($this->_config->displayCartSubtotalBoth($store) || $this->_config->displayCartSubtotalInclTax($store)) {
         if ($total->getSubtotalInclTax() > 0) {
             $subtotalInclTax = $total->getSubtotalInclTax();
         } else {
             $subtotalInclTax = $total->getSubtotal() + $taxAmount - $total->getShippingTaxAmount();
         }
         $totals[] = ['code' => 'subtotal', 'title' => __('Subtotal'), 'value' => $subtotalInclTax, 'value_incl_tax' => $subtotalInclTax, 'value_excl_tax' => $total->getSubtotal()];
     }
     if (empty($totals)) {
         return null;
     }
     return $totals;
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:44,代碼來源:Tax.php

示例4: fetch

 /**
  * Add tax totals information to address object
  *
  * @param   Address $address
  * @return  $this
  * @SuppressWarnings(PHPMD.CyclomaticComplexity)
  */
 public function fetch(Address $address)
 {
     $applied = $address->getAppliedTaxes();
     $store = $address->getQuote()->getStore();
     $amount = $address->getTaxAmount();
     $items = $this->_getAddressItems($address);
     $discountTaxCompensation = 0;
     foreach ($items as $item) {
         $discountTaxCompensation += $item->getDiscountTaxCompensation();
     }
     $taxAmount = $amount + $discountTaxCompensation;
     $area = null;
     if ($this->_config->displayCartTaxWithGrandTotal($store) && $address->getGrandTotal()) {
         $area = 'taxes';
     }
     if ($amount != 0 || $this->_config->displayCartZeroTax($store)) {
         $address->addTotal(['code' => $this->getCode(), 'title' => __('Tax'), 'full_info' => $applied ? $applied : [], 'value' => $amount, 'area' => $area]);
     }
     $store = $address->getQuote()->getStore();
     /**
      * Modify subtotal
      */
     if ($this->_config->displayCartSubtotalBoth($store) || $this->_config->displayCartSubtotalInclTax($store)) {
         if ($address->getSubtotalInclTax() > 0) {
             $subtotalInclTax = $address->getSubtotalInclTax();
         } else {
             $subtotalInclTax = $address->getSubtotal() + $taxAmount - $address->getShippingTaxAmount();
         }
         $address->addTotal(['code' => 'subtotal', 'title' => __('Subtotal'), 'value' => $subtotalInclTax, 'value_incl_tax' => $subtotalInclTax, 'value_excl_tax' => $address->getSubtotal()]);
     }
     return $this;
 }
開發者ID:nja78,項目名稱:magento2,代碼行數:39,代碼來源:Tax.php

示例5: getReviewTotalsDisplayMode

 /**
  * Get review item price display mode
  *
  * @return string 'both', 'including', 'excluding'
  */
 public function getReviewTotalsDisplayMode()
 {
     if ($this->taxConfig->displayCartSubtotalBoth()) {
         return 'both';
     }
     if ($this->taxConfig->displayCartSubtotalExclTax()) {
         return 'excluding';
     }
     return 'including';
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:15,代碼來源:TaxConfigProvider.php

示例6: displayTotalsIncludeTax

 /**
  * Check if we need display grid totals include tax
  *
  * @return bool
  */
 public function displayTotalsIncludeTax()
 {
     $result = $this->_taxConfig->displayCartSubtotalInclTax($this->getStore()) || $this->_taxConfig->displayCartSubtotalBoth($this->getStore());
     return $result;
 }
開發者ID:nja78,項目名稱:magento2,代碼行數:10,代碼來源:Grid.php

示例7: displayBoth

 /**
  * @return bool
  */
 public function displayBoth()
 {
     return $this->_taxConfig->displayCartSubtotalBoth($this->getStore());
 }
開發者ID:tingyeeh,項目名稱:magento2,代碼行數:7,代碼來源:Subtotal.php

示例8: getDisplaySubtotalBoth

 /**
  * Return whether subtotal should be displayed excluding and including tax
  *
  * @return bool
  */
 public function getDisplaySubtotalBoth()
 {
     return $this->_taxConfig->displayCartSubtotalBoth();
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:9,代碼來源:Totals.php


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