2016-08-22 88 views
0

我试图显示包括和不含税的产品价格。 我已经添加的代码下面片断在/Magento_Catalog/templates/product/price/final_price.phtml:Magento 2显示价格无税

<?php /* @escapeNotVerified */ echo $block->renderAmount($finalPriceModel->getBaseAmount(), [ 
    'price_id'   => $block->getPriceId('price-excluding-tax-' . $idSuffix), 
    'price_type'  => 'basePrice', 
    'include_container' => true, 
    'schema' => $schema 
]); ?> 

时(例如)被选择的尺寸这增加了被排除的价格到可配置产物。在此之前,当没有选择任何东西时,显示不含税的价格,包括税。对于简单的产品也是同样的问题,它们都以包括税款在内的两种价格显示。我想要的是不含税的价格总是在不含税的情况下显示。

任何与此有关的帮助将非常感谢!

回答

0

我以前在价格上的模板代码(在我的情况final_price.phtml):

<div class="price-exc"> 
<?php 
echo $priceHelper->currency($finalPriceModel->getAmount()->getValue(\Magento\Tax\Pricing\Adjustment::ADJUSTMENT_CODE), true, false); 
?> 
<?php /* @escapeNotVerified */ echo __('exc. VAT') ?> 

相关问题