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


PHP Data::displayPriceIncludingTax方法代碼示例

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


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

示例1: afterPrepareAdjustmentConfig

 /**
  * Get Tax Adjustments for configurable product
  *
  * @param \Magento\ConfigurableProduct\Pricing\Price\AttributePrice $attribute
  * @param array $result
  * @return array
  */
 public function afterPrepareAdjustmentConfig(\Magento\ConfigurableProduct\Pricing\Price\AttributePrice $attribute, array $result)
 {
     $product = $result['product'];
     $productClassId = $product->getTaxClassId();
     $defaultValue = $this->taxCalculationService->getDefaultCalculatedRate($productClassId, $result['customerId']);
     $result['defaultTax'] = $defaultValue + $result['defaultTax'];
     $currentTax = $this->taxCalculationService->getCalculatedRate($productClassId, $result['customerId']);
     $result['currentTax'] = $currentTax + $result['currentTax'];
     $adjustment = $product->getPriceInfo()->getAdjustment(\Magento\Tax\Pricing\Adjustment::ADJUSTMENT_CODE);
     $result['includeTax'] = $adjustment->isIncludedInBasePrice();
     $result['showIncludeTax'] = $this->taxHelper->displayPriceIncludingTax();
     $result['showBothPrices'] = $this->taxHelper->displayBothPrices();
     return $result;
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:21,代碼來源:AttributePrice.php

示例2: execute

 /**
  * Modify the bundle config for the front end to resemble the tax included price when tax included prices
  *
  * @param \Magento\Framework\Event\Observer $observer
  * @return $this
  * @SuppressWarnings(PHPMD.CyclomaticComplexity)
  */
 public function execute(\Magento\Framework\Event\Observer $observer)
 {
     if ($this->taxData->displayPriceIncludingTax()) {
         /** @var \Magento\Catalog\Model\Product $product */
         $product = $this->registry->registry('current_product');
         if ($product->getTypeId() == \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE) {
             $priceConfigObj = $observer->getData('configObj');
             try {
                 $priceConfig = $this->recurConfigAndUpdatePrice($priceConfigObj->getConfig(), 'prices');
                 $priceConfigObj->setConfig($priceConfig);
             } catch (\Exception $e) {
                 return $this;
             }
         }
     }
     return $this;
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:24,代碼來源:GetPriceConfigurationObserver.php

示例3: displayPriceIncludingTax

 /**
  * Should be displayed price including tax
  *
  * @return bool
  */
 public function displayPriceIncludingTax()
 {
     return $this->taxHelper->displayPriceIncludingTax();
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:9,代碼來源:Adjustment.php

示例4: isIncludedInDisplayPrice

 /**
  * Define if adjustment is included in display price
  *
  * @return bool
  */
 public function isIncludedInDisplayPrice()
 {
     return $this->taxHelper->displayPriceIncludingTax() || $this->taxHelper->displayBothPrices();
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:9,代碼來源:Adjustment.php


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