Question

We have downloadable products without price (0.00€) and added the mysterious price.phtml. Everything works fine, except that the price isn't showed.

I checked with xdebug and the price is printed, but removed through JavaScript. So I dug deeper and found this:

//varien/product.js:728
if (price > 0 || this.displayZeroPrice) {
    formattedPrice = this.formatPrice(price);
} else {
    formattedPrice = '';
}

displayZeroPrice is set to false and I didn't know why, because it is set to true in the beginning of the file.

dig... dig...

/app/design/frontend/base/default/template/downloadable/catalog/product/links.phtml:89
 optionsPrice.displayZeroPrice = false; 

Ok problem found, template copied and problem solved, BUT...

Is this intended? Is there maybe a configuration setting I didn't found and don't understand who it is injected into the JS configuration?

Was it helpful?

Solution

I believe this is intended functionality and not a bug. Magento has very deliberately made the decision to not show the price if $0 for downloadable products in the base theme. However,they have given you an easy way to override this in your own theme.

They may have done this so shop owners can add links to free downloads without them looking like products. Your guess is as good as mine!

There is currently no configuration setting in the backend for displayZeroPrice but the way they've written it allows for such an addition to be added easily in the future. You are correct in overriding the template, after all it comes down to personal preference of how you want to display downloadable products which is what theming is all about.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top