Skip to content Skip to sidebar Skip to footer

Magento Remove Incl Tax From Configurable Dropdown

I am using configurable products and I have set the option in the backend of Magento to show prices Incl TAX and Excl Tax. My problem is that with this inside the dropdown for the

Solution 1:

I've had some external help with this and come up with a solution. This is based on Magento 1.5.1.0.

Locate the file configurable.phtml in app/design/frontend/default/YOURTEMPLATE/template/catalog/product/view/type/options/.

Replace this:

<scripttype="text/javascript">var spConfig = newProduct.Config(<?phpecho$this->getJsonConfig(); ?>);
</script>

With this:

<?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) --><scripttype="text/javascript">var spConfig = newProduct.Config(<?phpecho$newstring?>);
</script>

This will only work for configurable products. If you want to do the same thing for custom options of simple products just change this:

<?phpecho$this->getValuesHtml() ?>

For this:

<?phpecho preg_replace("/\([^)]+\)/","", $this->getValuesHtml()); ?>

In this file: app/design/frontend/default/YOURTEMPLATE/template/catalog/product/view/options/type/select.phtml

Hope this helps

Post a Comment for "Magento Remove Incl Tax From Configurable Dropdown"