0

We would like to remove the currency symbol for products with custom options.

Our current code, displayed below, works perfect for normal products. But when a product got custom options it first show the price without the symbol and after 0.5-1.0 seconds the currency symbol is displayed.

Seems that somewhere the code for custom options activate this.

Where can we remove this?

Current price code:

            <span class="label"><?php echo $this->helper('tax')->__('Excl. Tax:') ?></span>
                <span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
                    <?php if ($_finalPrice == $_price): ?>
                        <?php $myPrice = $_coreHelper->formatPrice($_price + $_weeeTaxAmount, false);
                        $zeros = substr($myPrice, -2);
                        if(strval($zeros) == "00") { $myPrice = substr($myPrice, 0, -2);
                        $myPrice = $myPrice . '-'; }
                        $myPrice = str_replace("€","",$myPrice);
                            //or if the € is htmlencoded
                        $myPrice = str_replace("&euro;","",$myPrice);
                        echo '<span class="price">'.$myPrice.'</span>'; ?>  
                    <?php else: ?>
                        <?php $myPrice = $_coreHelper->formatPrice($_price + $_weeeTaxAmount, false);
                        $zeros = substr($myPrice, -2);
                        if(strval($zeros) == "00") { $myPrice = substr($myPrice, 0, -2);
                        $myPrice = $myPrice . '-'; }
                        $myPrice = str_replace("€","",$myPrice);
                            //or if the € is htmlencoded
                        $myPrice = str_replace("&euro;","",$myPrice);
                        echo '<span class="price">'.$myPrice.'</span>'; ?>  
                    <?php endif; ?>
                </span>
            </span>
            <span class="price-including-tax">
                <span class="label"><?php echo $this->helper('tax')->__('Incl. Tax:') ?></span>
                <span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
                        <?php $myPrice = $_coreHelper->formatPrice($_finalPriceInclTax + $_weeeTaxAmount, false);
                        $zeros = substr($myPrice, -2);
                        if(strval($zeros) == "00") { $myPrice = substr($myPrice, 0, -2);
                        $myPrice = $myPrice . '-'; }
                        $myPrice = str_replace("€","",$myPrice);
                            //or if the € is htmlencoded
                        $myPrice = str_replace("&euro;","",$myPrice);
                        echo '<span class="price">'.$myPrice.'</span>'; ?>  
                </span>
            </span>

1 Answer 1

1

For product with some price options (like configurable product for example), there is a js script that modify the display: js/varien/product_options.js.

You should override this class or just some of these methods (I guess the formatPrice one).

4
  • Thanks! But any idea how to change the product_options.js file to only remove the currency symbol?
    – JGeer
    Jan 18, 2019 at 14:04
  • No idea. But looking at the formatPrice method, maybe you should try to return price instead of formatCurrency(price, this.priceFormat). Jan 18, 2019 at 17:09
  • Thanks, but in that case it does also remove the max 2 decimals. So a price excl vat will be: 858.6776859504132. How can fix that?
    – JGeer
    Jan 23, 2019 at 18:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.