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


PHP Data::displayPriceExcludingTax方法代码示例

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


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

示例1: getWhichCalcPriceToUse

 /**
  * Returns which product price to use as a basis for the Weee's final price
  *
  * @param  int|null $storeId
  * @return string
  */
 protected function getWhichCalcPriceToUse($storeId = null)
 {
     $calcPrice = 'finalPrice';
     if ($this->weeeData->geDisplayExcl($storeId) || $this->weeeData->geDisplayExlDescIncl($storeId) || $this->taxData->priceIncludesTax() && $this->taxData->displayPriceExcludingTax()) {
         $calcPrice = 'basePrice';
     }
     return $calcPrice;
 }
开发者ID:whoople,项目名称:magento2-testing,代码行数:14,代码来源:UpdateProductOptionsObserver.php

示例2: isIncludedInDisplayPrice

 /**
  * Define if adjustment is included in display price
  *
  * @return bool
  */
 public function isIncludedInDisplayPrice()
 {
     if ($this->taxHelper->displayPriceExcludingTax()) {
         return false;
     }
     if ($this->weeeHelper->isEnabled() == true && $this->weeeHelper->isTaxable() == true && $this->weeeHelper->typeOfDisplay([\Magento\Weee\Model\Tax::DISPLAY_EXCL]) == false) {
         return true;
     } else {
         return false;
     }
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:16,代码来源:TaxAdjustment.php

示例3: getPriceConfiguration

 /**
  * Modify the options config for the front end to resemble the weee final price
  *
  * @param   \Magento\Framework\Event\Observer $observer
  * @return  $this
  * @SuppressWarnings(PHPMD.CyclomaticComplexity)
  */
 public function getPriceConfiguration(\Magento\Framework\Event\Observer $observer)
 {
     if ($this->_weeeData->isEnabled()) {
         $priceConfigObj = $observer->getData('configObj');
         $priceConfig = $priceConfigObj->getConfig();
         try {
             if (is_array($priceConfig)) {
                 foreach ($priceConfig as $keyConfigs => $configs) {
                     if (is_array($configs)) {
                         foreach ($configs as $keyConfig => $config) {
                             $calcPrice = 'finalPrice';
                             if ($this->_taxData->priceIncludesTax() && $this->_taxData->displayPriceExcludingTax()) {
                                 $calcPrice = 'basePrice';
                             }
                             if (array_key_exists('prices', $configs)) {
                                 $priceConfig[$keyConfigs]['prices']['weeePrice'] = ['amount' => $configs['prices'][$calcPrice]['amount']];
                             } else {
                                 foreach ($configs as $keyConfig => $config) {
                                     $priceConfig[$keyConfigs][$keyConfig]['prices']['weeePrice'] = ['amount' => $config['prices'][$calcPrice]['amount']];
                                 }
                             }
                         }
                     }
                 }
             }
             $priceConfigObj->setConfig($priceConfig);
         } catch (Exception $e) {
             return $this;
         }
     }
     return $this;
 }
开发者ID:nja78,项目名称:magento2,代码行数:39,代码来源:Observer.php

示例4: getWhichCalcPriceToUse

 /**
  * Returns which product price to use as a basis for the Weee's final price
  *
  * @param  int|null $storeId
  * @param  array|null $weeeAttributesForBundle
  * @return string
  */
 protected function getWhichCalcPriceToUse($storeId = null, $weeeAttributesForBundle = null)
 {
     $calcPrice = 'finalPrice';
     if (!empty($weeeAttributesForBundle)) {
         if ($this->weeeData->isDisplayExcl($storeId) || $this->weeeData->isDisplayExclDescIncl($storeId) || $this->taxData->priceIncludesTax() && $this->taxData->displayPriceExcludingTax()) {
             $calcPrice = 'basePrice';
         }
     }
     return $calcPrice;
 }
开发者ID:koliaGI,项目名称:magento2,代码行数:17,代码来源:GetPriceConfigurationObserver.php

示例5: execute

 /**
  * Change default JavaScript templates for options rendering
  *
  * @param \Magento\Framework\Event\Observer $observer
  * @return $this
  */
 public function execute(\Magento\Framework\Event\Observer $observer)
 {
     $response = $observer->getEvent()->getResponseObject();
     $options = $response->getAdditionalOptions();
     $_product = $this->registry->registry('current_product');
     if (!$_product) {
         return $this;
     }
     $algorithm = $this->taxData->getCalculationAlgorithm();
     $options['calculationAlgorithm'] = $algorithm;
     // prepare correct template for options render
     if ($this->taxData->displayBothPrices()) {
         $options['optionTemplate'] = sprintf('<%%= data.label %%>' . '<%% if (data.finalPrice.value) { %%>' . ' +<%%= data.finalPrice.formatted %%> (%1$s <%%= data.basePrice.formatted %%>)' . '<%% } %%>', __('Excl. tax:'));
     } elseif ($this->taxData->priceIncludesTax() && $this->taxData->displayPriceExcludingTax()) {
         $options['optionTemplate'] = sprintf('<%%= data.label %%>' . '<%% if (data.basePrice.value) { %%>' . ' +<%%= data.basePrice.formatted %%>' . '<%% } %%>');
     }
     $response->setAdditionalOptions($options);
     return $this;
 }
开发者ID:tingyeeh,项目名称:magento2,代码行数:25,代码来源:UpdateProductOptionsObserver.php

示例6: getPriceConfiguration

 /**
  * Modify the options config for the front end to resemble the weee final price
  *
  * @param   \Magento\Framework\Event\Observer $observer
  * @return  $this
  * @SuppressWarnings(PHPMD.CyclomaticComplexity)
  */
 public function getPriceConfiguration(\Magento\Framework\Event\Observer $observer)
 {
     if ($this->_weeeData->isEnabled()) {
         $priceConfigObj = $observer->getData('configObj');
         try {
             $product = $this->_registry->registry('current_product');
             $weeeAttributes = $this->_weeeData->getWeeAttributesForBundle($product);
             $calcPrice = 'finalPrice';
             if ($this->_taxData->priceIncludesTax() && $this->_taxData->displayPriceExcludingTax()) {
                 $calcPrice = 'basePrice';
             }
             $priceConfig = $this->recurConfigAndInsertWeeePrice($priceConfigObj->getConfig(), 'prices', $calcPrice, $weeeAttributes);
             $priceConfigObj->setConfig($priceConfig);
         } catch (\Exception $e) {
             return $this;
         }
     }
     return $this;
 }
开发者ID:Coplex,项目名称:magento2,代码行数:26,代码来源:Observer.php

示例7: displayPriceExcludingTax

 /**
  * Should be displayed price excluding tax
  *
  * @return bool
  */
 public function displayPriceExcludingTax()
 {
     return $this->taxHelper->displayPriceExcludingTax();
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:9,代码来源:Adjustment.php


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