Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/228.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Magento从可配置下拉列表中删除包含税_Php_Html_Magento - Fatal编程技术网

Php Magento从可配置下拉列表中删除包含税

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的后端设置了显示含税和不含税价格的选项

我的问题是,在可配置产品选项的下拉列表中,它还显示了Incl TAX和Excl TAX

我需要它在产品页面的价格区域显示这两个选项,但在下拉列表中仅显示“不含税”,因此它会删除“含税”,我附上了一个屏幕截图,红色区域需要删除


我得到了一些外部帮助,并想出了一个解决方案。这是基于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()); ?>