当前位置: 首页>>代码示例>>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;未经允许,请勿转载。