Nathan_Pereira Posted February 22 Share Posted February 22 Want to remove the word Free in this section. Im using prestashop version 8.1.0. Any help would be kindly appreciated. Thanks Link to comment Share on other sites More sharing options...
baba code Posted February 28 Share Posted February 28 Hello Nathan_Pereira, Consider placing this code in the "custom.js" file of your installed theme for it to take effect. $(document).ready(function() { $('.carrier-price').each(function() { var currentElement = $(this); if (currentElement.text().trim().toLowerCase() === 'free') { currentElement.css('display', 'none'); } }); }); best regards, 1 Link to comment Share on other sites More sharing options...
Nathan_Pereira Posted February 29 Author Share Posted February 29 7 hours ago, baba code said: Hello Nathan_Pereira, Consider placing this code in the "custom.js" file of your installed theme for it to take effect. $(document).ready(function() { $('.carrier-price').each(function() { var currentElement = $(this); if (currentElement.text().trim().toLowerCase() === 'free') { currentElement.css('display', 'none'); } }); }); best regards, Will definitely try this out. Thanks a ton Link to comment Share on other sites More sharing options...
Nathan_Pereira Posted February 29 Author Share Posted February 29 8 hours ago, baba code said: Hello Nathan_Pereira, Consider placing this code in the "custom.js" file of your installed theme for it to take effect. $(document).ready(function() { $('.carrier-price').each(function() { var currentElement = $(this); if (currentElement.text().trim().toLowerCase() === 'free') { currentElement.css('display', 'none'); } }); }); best regards, Hi i Tried looking for custom.js file but cant seem to find it. Any help on the location of this file or could you provide me with the steps to create it. Any help would be kindly appreciated. Link to comment Share on other sites More sharing options...
baba code Posted February 29 Share Posted February 29 Hi Nathan_Pereira, if not exist create it, best regards, Link to comment Share on other sites More sharing options...
ps8modules Posted March 1 Share Posted March 1 Hi. Javascript and inserting 'Free' text will not work in the multilingual eshop. The TPL modification is definitely a better solution. ./themes/your_theme/templates/checkout/_partials/steps/shipping.tpl 1. find 2. replace to <span class="carrier-price">{if $carrier.is_free == '0'}{$carrier.price}{/if}</span> Link to comment Share on other sites More sharing options...
Nathan_Pereira Posted March 1 Author Share Posted March 1 4 minutes ago, ps8modules.com said: Hi. Javascript and inserting 'Free' text will not work in the multilingual eshop. The TPL modification is definitely a better solution. ./themes/your_theme/templates/checkout/_partials/steps/shipping.tpl 1. find 2. replace to <span class="carrier-price">{if $carrier.is_free == '0'}{$carrier.price}{/if}</span> Hi, The earlier option which baba code provided works well using javascript. 1 Link to comment Share on other sites More sharing options...
ps8modules Posted March 1 Share Posted March 1 I only pointed out that if you have multiple languages in the e-shop, not every language will use the text Free and thus the deletion would not work. This is information for everyone. 1 Link to comment Share on other sites More sharing options...
ps8modules Posted March 1 Share Posted March 1 I only pointed out that if you have multiple languages in the e-shop, not every language will use the text Free and thus the deletion would not work. Whereas the modification in TPL will be valid for all languages ! 1 Link to comment Share on other sites More sharing options...
ps8modules Posted March 1 Share Posted March 1 (edited) 44 minutes ago, Nathan_Pereira said: Hi, The earlier option which baba code provided works well using javascript. The multilingual javascript would have to be: const array = ['free', 'kostenlos']; $('.carrier-price').filter(function() { return $.inArray($(this).text().trim().toLowerCase(), array) !== -1; }).css('display', 'none'); Edited March 1 by ps8modules.com (see edit history) 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