Wednesday 19 October 2011

Remove “+$” or “-$” price value in the drop down in configurable product

If you want to remove "+$" or "-$" price value in the drop down in configurable product.

STEP 1
app/code/core/Mage/Catalog/Block/Product/View/Type/ Configurable.php

change this line
'template'  => str_replace('%s', '#{price}', $store->getCurrentCurrency()->getOutputFormat()),
TO
'template'          => Mage::helper('catalog')->__(''),

STEP 2
js/varien/product.js
change this function
formatPrice: function(price, showSign){ 
    var str = ''; 
    price = parseFloat(price); 
    if(showSign){ 
    if(price<0){ 
    str+= '-'; 
    price = -price; 
    } 
    else{ 
    str+= '+'; 
    } 
} 
TO
formatPrice: function(price, showSign){ 
var str = ''; 
price = parseFloat(price); 
if(showSign){ 
if(price < 0){ 
str+= ''; 
price = -price; 
} 
else{ 
str+= ''; 
} 
}

3 comments:

  1. Dear Ram,

    I am using magento 1.7.0.2 version. I need to change ‘Add’ instead of ‘+’ and ‘Less’ instead of ‘-’ in Configurable product drop down on front end. Please advice me.

    Kind Regards
    Dhayalan

    ReplyDelete
  2. Follow steps which I given and just change + to Add and - to Less. currently I have make empty because I dont want it. May be this helpfull.

    ReplyDelete
  3. Hi Ram,

    Thank you so much.

    Please check this link - http://localhost/rv_new/indexrajavivaha.php/dhoties/wedding-silk-dhoties/silk-white-dhoti-with-gold-zari-border.html

    In the attributes dropdown, there is a Rs. symbol i want to display rupee symbol instead of Rs. Where i need to change to fix this. Please guide me..

    ReplyDelete