Hello I am using magento 1.7. I have configurable product and simple products both have custom options... I want to remove the +$10.00 next to the option Example: custom option: Large +$5.00 I would like it to appear as Large... I still want the price to update on the product's view page. I tried editing the js/varien/product.js commenting out the str+ but didn't work
//str+= ' ' + this.formatPrice(excl, true) + ' (' + this.formatPrice(price, true) + ' ' + this.taxConfig.inclTaxTitle + ')';
} else {
//str+= ' ' + this.formatPrice(price, true);
}
}
return str;
},
formatPrice: function(price, showSign){
var str = '';
price = parseFloat(price);
if(showSign){
if(price<0){
//str+= '-';
price = -price;
}
else{
//str+= '+';
}
You'll want to look into Mage_Catalog_Block_Product_View_Options_Abstract::_formatPrice()
[link].
It's not possible to rewrite this method using the framework. As the display logic which uses this method potentially touches many areas, I would look into a CSS-based solution. While this may appear hackish, it's likely cleaner than trying to extend each subclass to handle your logic. The following would work for the default theme:
#product-options-wrapper span.price-notice,
#product-options-wrapper span.price { display:none }
Using the comment from user "R.S" above I was able to fix this issue for my website. Here is a screenshot from my website showing the fix works http://tinypic.com/r/5pexz4/5
Find the file
/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Select.php
Go to lines 70 - 74
$select->addOption(
$_value->getOptionTypeId(),
$_value->getTitle() . ' ' . $priceStr . '',
array('price' => $this->helper('core')->currencyByStore($_value->getPrice(true), $store, false))
);
Remove this code from line 72
. ' ' . $priceStr . ''
OR comment out the code
$_value->getTitle() /*. ' ' . $priceStr . ''*/,
be sure to leave the "," at the end of the statement. My code now looks like this and works fine.
$select->addOption(
$_value->getOptionTypeId(),
$_value->getTitle() /*. ' ' . $priceStr . ''*/,
array('price' => $this->helper('core')->currencyByStore($_value->getPrice(true), $store, false))
);
I hope this helps you and other who are looking for the same fix!
Add this JavaScript to template/catalog/product/view.phtml
<script>
// Override formatting in "js/varien/configurable.js"
Product.Config.prototype.formatPrice = Product.Config.prototype.formatPrice.wrap(
function(parentMethod, price, showSign){ return ''; }
);
</script>
Or you could create a new JS file with the above code and include it via local.xml in a block for the product detail and product review pages.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With