本文整理汇总了PHP中Magento\Tax\Model\Config::displayCartTaxWithGrandTotal方法的典型用法代码示例。如果您正苦于以下问题:PHP Config::displayCartTaxWithGrandTotal方法的具体用法?PHP Config::displayCartTaxWithGrandTotal怎么用?PHP Config::displayCartTaxWithGrandTotal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Tax\Model\Config
的用法示例。
在下文中一共展示了Config::displayCartTaxWithGrandTotal方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: includeTax
/**
* Check if we have include tax amount between grandtotal incl/excl tax
*
* @return bool
*/
public function includeTax()
{
if ($this->getTotal()->getValue()) {
return $this->_taxConfig->displayCartTaxWithGrandTotal($this->getStore());
}
return false;
}
示例2: 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;
}
示例3: 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;
}
示例4: isTaxDisplayedInGrandTotal
/**
* Display tax in grand total section or not
*
* @return bool
*/
public function isTaxDisplayedInGrandTotal()
{
return $this->taxConfig->displayCartTaxWithGrandTotal();
}
示例5: includeTax
/**
* Include tax
*
* @return bool
*/
public function includeTax()
{
return $this->_taxConfig->displayCartTaxWithGrandTotal();
}