rsilvapt Posted March 12, 2015 Share Posted March 12, 2015 (edited) Hi, I offer free e-books in my website. Instead of €0.00, I'd like the word "FREE" to appear. A banner (saying "FREE") over the image or something like that would be nice too. Thank you! Rui Edited March 12, 2015 by rsilvapt (see edit history) Link to comment Share on other sites More sharing options...
unlimitedgrain Posted March 13, 2015 Share Posted March 13, 2015 search "banner", I ones saw a post about creating another banner and there is a solution with all source code you need to change. I think changing 0.00 to FREE can also be done in source code, sorry can't help you with that. Link to comment Share on other sites More sharing options...
rocky Posted March 14, 2015 Share Posted March 14, 2015 I think the easiest way to change the price from 0.00 to "Free" is to create override/classes/Tools.php and enter the following code: <?php class Tools extends ToolsCore { public static function displayPrice($price, $currency = null, $no_utf8 = false, Context $context = null) { if ($price == 0) { if (!$context) $context = Context::getContext(); if ($context->language->id == 1) return 'Free'; elseif ($context->language->id == 2) return 'Gratuite'; } else return parent::displayPrice($price, $currency, $no_utf8, $context); } } Add another elseif statement for each of your languages. This will replace all 0.00 throughout the website with "Free". Remember to delete cache/class_index.php after creating the override. Link to comment Share on other sites More sharing options...
rsilvapt Posted March 16, 2015 Author Share Posted March 16, 2015 I think the easiest way to change the price from 0.00 to "Free" is to create override/classes/Tools.php and enter the following code: <?php class Tools extends ToolsCore { public static function displayPrice($price, $currency = null, $no_utf8 = false, Context $context = null) { if ($price == 0) { if (!$context) $context = Context::getContext(); if ($context->language->id == 1) return 'Free'; elseif ($context->language->id == 2) return 'Gratuite'; } else return parent::displayPrice($price, $currency, $no_utf8, $context); } } Add another elseif statement for each of your languages. This will replace all 0.00 throughout the website with "Free". Remember to delete cache/class_index.php after creating the override. Hello! Thank you again! It's working great Rui Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now