Php Magento从可配置下拉列表中删除包含税
我使用的是可配置产品,我在Magento的后端设置了显示含税和不含税价格的选项 我的问题是,在可配置产品选项的下拉列表中,它还显示了Incl TAX和Excl TAX 我需要它在产品页面的价格区域显示这两个选项,但在下拉列表中仅显示“不含税”,因此它会删除“含税”,我附上了一个屏幕截图,红色区域需要删除Php Magento从可配置下拉列表中删除包含税,php,html,magento,Php,Html,Magento,我使用的是可配置产品,我在Magento的后端设置了显示含税和不含税价格的选项 我的问题是,在可配置产品选项的下拉列表中,它还显示了Incl TAX和Excl TAX 我需要它在产品页面的价格区域显示这两个选项,但在下拉列表中仅显示“不含税”,因此它会删除“含税”,我附上了一个屏幕截图,红色区域需要删除 我得到了一些外部帮助,并想出了一个解决方案。这是基于Magento 1.5.1.0的 在app/design/frontend/default/YOURTEMPLATE/template/cat
我得到了一些外部帮助,并想出了一个解决方案。这是基于Magento 1.5.1.0的 在app/design/frontend/default/YOURTEMPLATE/template/catalog/product/view/type/options/中找到configurable.phtml文件 替换此项:
<script type="text/javascript">
var spConfig = new Product.Config(<?php echo $this->getJsonConfig(); ?>);
</script>
var spConfig=new Product.Config();
为此:
<?php
// get current drop down string
$currentstring = $this->getJsonConfig();
// create new string with true set to false using str_replace function (string replace)
$newstring = str_replace( '"showBothPrices":true,"', '"showBothPrices":false,"', $currentstring );
?>
<!-- render dropdown but with new var ($newstring) -->
<script type="text/javascript">
var spConfig = new Product.Config(<?php echo $newstring ?>);
</script>
<?php echo $this->getValuesHtml() ?>
<?php echo preg_replace("/\([^)]+\)/","", $this->getValuesHtml()); ?>