本文整理汇总了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;
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例7: displayPriceExcludingTax
/**
* Should be displayed price excluding tax
*
* @return bool
*/
public function displayPriceExcludingTax()
{
return $this->taxHelper->displayPriceExcludingTax();
}