Shipsworld Posted December 8, 2017 Share Posted December 8, 2017 Where are the translations located for the word "Free" in the Ajax Cart and on the Checkout pages. Looked everywhere, but I could not find it. How to change "Free" to something else, and keep this when upgrading? Thanks for the help. Version used of PS: Prestashop 1.7.2.4 (stable branche, or so they say...) Link to comment Share on other sites More sharing options...
Shipsworld Posted December 11, 2017 Author Share Posted December 11, 2017 Lol, is there not a single person out here to help a guy in need? Link to comment Share on other sites More sharing options...
Shipsworld Posted December 11, 2017 Author Share Posted December 11, 2017 (edited) Anyways, I've looked myself for all the files that had the text (including single quotes) 'Free' in it.My tool (Turbo Searcher, old tool) finds the following files as a result: \classes\checkout\DeliveryOptionsFinder.php \controllers\admin\AdminPatternsController.php \controllers\admin\AdminReturnController.php \src\Adapter\Cart\CartPresenter.php \src\Adapter\Order\OrderPresenter.php \app\cache\prod\translations\catalogue.en-US.3fea97234267aa02290eee8ee5357fb280cfa275.php \app\cache\prod\translations\catalogue.en-US.8739602554c7f3241958e3cc9b57fdecb474d508.php \modules\gwadvancedinvoice\controllers\admin\AdminGwadvancedinvoiceconfigController.php \adminxx\autoupgrade\latest\classes\checkout\DeliveryOptionsFinder.php \adminxx\autoupgrade\latest\controllers\admin\AdminPatternsController.php \adminxx\autoupgrade\latest\controllers\admin\AdminReturnController.php \adminxx\autoupgrade\latest\src\Adapter\Cart\CartPresenter.php \adminxx\autoupgrade\latest\src\Adapter\Order\OrderPresenter.php \adminxx\themes\default\template\controllers\carrier_wizard\summary.tpl \adminxx\themes\default\template\controllers\modules\list.tpl \adminxx\themes\default\template\controllers\modules\tab_module_line.tpl \adminxx\themes\default\template\helpers\form\form.tpl \src\PrestaShopBundle\Resources\views\Admin\Module\Includes\card_grid.html.twig \src\PrestaShopBundle\Resources\views\Admin\Module\Includes\modal_read_more_content.html.twig \vendor\doctrine\dbal\lib\Doctrine\DBAL\Platforms\Keywords\DB2Keywords.php \vendor\doctrine\dbal\lib\Doctrine\DBAL\Platforms\Keywords\DrizzleKeywords.php \adminxx\autoupgrade\latest\adminxx\themes\default\template\controllers\carrier_wizard\summary.tpl \adminxx\autoupgrade\latest\adminxx\themes\default\template\controllers\modules\list.tpl \adminxx\autoupgrade\latest\adminxx\themes\default\template\controllers\modules\tab_module_line.tpl \adminxx\autoupgrade\latest\adminxx\themes\default\template\helpers\form\form.tpl \adminxx\autoupgrade\latest\src\PrestaShopBundle\Resources\views\Admin\Module\Includes\card_grid.html.twig \adminxx\autoupgrade\latest\src\PrestaShopBundle\Resources\views\Admin\Module\Includes\modal_read_more_content.html.twig \adminxx\autoupgrade\latest\vendor\doctrine\dbal\lib\Doctrine\DBAL\Platforms\Keywords\DB2Keywords.php \adminxx\autoupgrade\latest\vendor\doctrine\dbal\lib\Doctrine\DBAL\Platforms\Keywords\DrizzleKeywords.php Now, can somebody please tell me -->Which of the above files need to be modified for this textual change on the whole website (from 'Free' to: 'On Invoice')? (see screenshots from earlier on!!) Edited December 11, 2017 by Shipsworld (see edit history) 1 Link to comment Share on other sites More sharing options...
AZHosting Posted March 9, 2018 Share Posted March 9, 2018 (edited) Hey Shipsworld! Did you ever find an answer for this question? This used to be easy on 1.6 but now with all the partials I can hardly find anything. Add to that the loss of the Front Office Translation section and I dislike 1.7 more each time I work with it. Edited March 9, 2018 by AZHosting (see edit history) Link to comment Share on other sites More sharing options...
AZHosting Posted March 9, 2018 Share Posted March 9, 2018 I found it. It's in src/Adapter/Cart/CartPresenter.php and makes reference to the translator for Shop>Theme>Checkout>Free but there isn't one. So this is a bug with may be fixed in some upcoming version. Just change 'Free' to something like 'Not Calculated' and you should be good to go until there is an upgrade path for 1.7. Probably see it being upgradable around 1.7.49 or so. No worries for the time being. src/Adapter/Cart/CartPresenter.php $subtotals['shipping'] = array( 'type' => 'shipping', 'label' => $this->translator->trans('Shipping', array(), 'Shop.Theme.Checkout'), 'amount' => $shippingCost, 'value' => $shippingCost != 0 ? $this->priceFormatter->format($shippingCost) : $this->translator->trans('Free', array(), 'Shop.Theme.Checkout'), ); 1 3 Link to comment Share on other sites More sharing options...
libreriasemola Posted May 3, 2018 Share Posted May 3, 2018 Thank you AZHosting. This has always been a pain for me, even on previous releases. Your solution does not fix the issue, but sure helps to prevent misunderstandings. Link to comment Share on other sites More sharing options...
Donna Russell Posted May 8, 2018 Share Posted May 8, 2018 That solution didn't work for me, so I have just hidden it using css div#cart-subtotal-shipping.cart-summary-line { display:none; } Link to comment Share on other sites More sharing options...
stellina58 Posted May 24, 2018 Share Posted May 24, 2018 This is a question from year 2012 until 2018, no one can solve it. I think Prestashop does this on purpose so we have to buy a module to fix this problem. This is a very serious issue yet no one can fix it and Prestashop doesn't bother too. Imagine people buying your products, it always says free shipping then when they want to check out, the shipping cost appears. The clients feel defeated and never comes back to our shop. 1 Link to comment Share on other sites More sharing options...
Frevab Posted May 24, 2018 Share Posted May 24, 2018 I had the same problem but found out that it is a result of the carrier setting and the way the carrier options are set. I have set them as follows: default carrier: best quality, sort: on price, sorting: ascending. Best way to test is to use 2 tabs in your browser: one showing the cart with a product added and one with the bakc office settings and just play around with the settings. SAve the setting and update the screen with the cart to see the change (switch of the cache and empty cache and force compilation to see the actual new data). Before I found this out I also looked for removing or changing the wording on "Free" in the Cart. I good way to find out is to store a back up of the shop on your own harddisk and use Notepad++ to search through all the files for the word "Free". This will produce a lost of the files and you van proceed from there. I use notepad++ a lot to find translations as the new PS version does not make it easy to found out where the field us you want to change. I just the similar way to remove the line from the pop-up screen after you add a product to the cart. 2 Link to comment Share on other sites More sharing options...
hexstudios1214 Posted June 14, 2018 Share Posted June 14, 2018 On 9/3/2018 at 10:10 AM, AZHosting said: I found it. It's in src/Adapter/Cart/CartPresenter.php and makes reference to the translator for Shop>Theme>Checkout>Free but there isn't one. So this is a bug with may be fixed in some upcoming version. Just change 'Free' to something like 'Not Calculated' and you should be good to go until there is an upgrade path for 1.7. Probably see it being upgradable around 1.7.49 or so. No worries for the time being. src/Adapter/Cart/CartPresenter.php $subtotals['shipping'] = array( 'type' => 'shipping', 'label' => $this->translator->trans('Shipping', array(), 'Shop.Theme.Checkout'), 'amount' => $shippingCost, 'value' => $shippingCost != 0 ? $this->priceFormatter->format($shippingCost) : $this->translator->trans('Free', array(), 'Shop.Theme.Checkout'), ); THANKSSSSSS!!!!!!!!!!!!! I LOVE YOU Link to comment Share on other sites More sharing options...
Whytecloud Posted September 1, 2018 Share Posted September 1, 2018 On 5/25/2018 at 7:16 AM, Frevab said: I had the same problem but found out that it is a result of the carrier setting and the way the carrier options are set. I have set them as follows: default carrier: best quality, sort: on price, sorting: ascending. Best way to test is to use 2 tabs in your browser: one showing the cart with a product added and one with the bakc office settings and just play around with the settings. SAve the setting and update the screen with the cart to see the change (switch of the cache and empty cache and force compilation to see the actual new data). Before I found this out I also looked for removing or changing the wording on "Free" in the Cart. I good way to find out is to store a back up of the shop on your own harddisk and use Notepad++ to search through all the files for the word "Free". This will produce a lost of the files and you van proceed from there. I use notepad++ a lot to find translations as the new PS version does not make it easy to found out where the field us you want to change. I just the similar way to remove the line from the pop-up screen after you add a product to the cart. OMG thank you. I found it under translations>theme>checkout 1 2 Link to comment Share on other sites More sharing options...
xwvth Posted December 27, 2018 Share Posted December 27, 2018 total remove the shipping from cart: themes\classic\modules\ps_shoppingcart\modal.tpl remove : <p><strong>{l s='Total shipping:' d='Shop.Theme.Checkout'}</strong> {$cart.subtotals.shipping.value} {hook h='displayCheckoutSubtotalDetails' subtotal=$cart.subtotals.shipping}</p> + css div#cart-subtotal-shipping.cart-summary-line { display:none; } 1 Link to comment Share on other sites More sharing options...
__fito__ Posted January 23, 2019 Share Posted January 23, 2019 On 3/9/2018 at 5:10 PM, AZHosting said: I found it. It's in src/Adapter/Cart/CartPresenter.php and makes reference to the translator for Shop>Theme>Checkout>Free but there isn't one. So this is a bug with may be fixed in some upcoming version. Just change 'Free' to something like 'Not Calculated' and you should be good to go until there is an upgrade path for 1.7. Probably see it being upgradable around 1.7.49 or so. No worries for the time being. src/Adapter/Cart/CartPresenter.php $subtotals['shipping'] = array( 'type' => 'shipping', 'label' => $this->translator->trans('Shipping', array(), 'Shop.Theme.Checkout'), 'amount' => $shippingCost, 'value' => $shippingCost != 0 ? $this->priceFormatter->format($shippingCost) : $this->translator->trans('Free', array(), 'Shop.Theme.Checkout'), ); This file is deprecated in 1.7.4 and up. The new file to modify is: src/Adapter/Presenter/Cart/CartPresenter.php Delete code AZHosting wrote above and get rid of this "free" shipping costs 1 Link to comment Share on other sites More sharing options...
josh barak Posted April 2, 2019 Share Posted April 2, 2019 Hi everyone! After about 3 hours of playing around, found a solution!! In the database there is a table called "translation" I added there a row with my translation, please see screenshot attached. clear cache (Advanced Parameters -> Performance -> clear cache) In my case I wanted to translate "Free" to Hebrew, and I think the reason it wasn't showing in the BO translation system (in Shop->theme->checkout) is because the translation for that word is coming from the language package of Hebrew. So I guess adding the row in the database overrides the file of the translation package. If this is true, it's bad on PS side for not giving an option to easily change package translation. 1 Link to comment Share on other sites More sharing options...
Bob van der Valk Posted March 26, 2020 Share Posted March 26, 2020 This was driving me nuts in PS 1.7.6.4 too !!! Absolutely nowhere you can change it in the code like I managed in 1.7.6.0 I used te solution of Josh Barak but I had to add "classic" in the template field ! I use the classic template. In 1.7.6.0 I could manage the change it but in 1.7.6.4 I turned in circles for 2 hours. "Standard shipping costs" was turned into "Free". It's fixed now, till the next upgrade probably :-) This is a big thing. Our shipping costs are not calculated in the cart but they are known to our B2B customers. If Prestashop puts "Free" there ("Za Darmo!" in Polish) can bring us into big problems. Crazy! Link to comment Share on other sites More sharing options...
POOLEworks Posted April 8, 2020 Share Posted April 8, 2020 My issue is one where if the product is over 150lbs it needs to go via private shipper. Creating a shipper for just over that weight I could put "Other Shipping Method: We will contact you with available options." It is followed with a Free in a span of "carrier-price" I cannot get that to disappear via css. I found that editing this file I was able to change Free to TBD successfully in the cart preview before any shipping is selected. httpdocs/src/Adapter/Presenter/Cart/CartPresenter.php I have not been able to edit the final sales page to change that Free to "We will call you" Link to comment Share on other sites More sharing options...
Bob van der Valk Posted April 9, 2020 Share Posted April 9, 2020 POOLEworks, I don't know if it will be your solution but can you check this file. I changed it for Polish language: /app/recources/translations/pl-PL(the language you use)/ShopThemeCheckout.pl-PL.xlf I replaced 'Free' into 'Standard'. Maybe this solves your problem too. Prestashop moves in mysterious ways. Link to comment Share on other sites More sharing options...
Courage2000 Posted April 9, 2020 Share Posted April 9, 2020 (edited) For 1.7.6.4 EDIT file src/Adapter/Presenter/Cart/CartPresenter.php Find // : $this->translator->trans('Free', array(), 'Shop.Theme.Checkout'), replace with // : $this->translator->trans('-', array(), 'Shop.Theme.Checkout'), Edited April 9, 2020 by Courage2000 (see edit history) Link to comment Share on other sites More sharing options...
POOLEworks Posted April 10, 2020 Share Posted April 10, 2020 Thanks all. I did edit a bunch of template files through the site and got 90% of them. The rest I killed off by doing a jQuery script that would replace the span segment on page load. Link to comment Share on other sites More sharing options...
Orbitaga Posted April 20, 2020 Share Posted April 20, 2020 I have the same problem with POOLEworks I have some cases where i can't calculate shiping costs (e.g when weight goes above 100Kg ) so i want the description instead of "free" to say "we will call you" Where do i do that in 1.6.1.15 ? Thanks in advance !! Link to comment Share on other sites More sharing options...
POOLEworks Posted April 20, 2020 Share Posted April 20, 2020 I created this little jQuery script to grab any FREE in a span with the class of small in a <td> and replace it $('td:contains("Free")').each(function(){ $(this).html($(this).html().split("Free").join("<span class='small'>We will call you with a shipping quote</span>")); }); It's a hack but it works on my final purchase confirmation. There might be other places that this works. The other option, as people have suggested is to edit templates. Link to comment Share on other sites More sharing options...
JBW Posted April 20, 2020 Share Posted April 20, 2020 It works in normal translation system (at least in 1.7.6.4) - no need to manipulate core or translation files 2 Link to comment Share on other sites More sharing options...
Orbitaga Posted April 20, 2020 Share Posted April 20, 2020 @JBW This will not work for me, i want to keep "free" but i want a different text "we will call you" when weight exceeds 100KG Link to comment Share on other sites More sharing options...
ingsk Posted June 11, 2020 Share Posted June 11, 2020 Josh Baraks solution did the trick! I'm in 1.7.3.4, looks like this string is just missing from that table, adding it seems to resolve this translation eveywhere, good solution. Link to comment Share on other sites More sharing options...
libreriasemola Posted June 13, 2020 Share Posted June 13, 2020 JBW thank you, your screenshot helped me. it does not solve tje issue, but is much better now. Link to comment Share on other sites More sharing options...
CJH Posted October 6, 2020 Share Posted October 6, 2020 It worked for me ... finally, an answer! Thanks. The part that had fooled me was that this is a translation in the Classic theme, which I was not using and never have since the installation. I wanted to translate text in the theme I am using, so it was not intuitive to change the text in the Classic theme to update a different theme. But that is how it worked ... 2 Link to comment Share on other sites More sharing options...
gtul Posted January 31, 2021 Share Posted January 31, 2021 On 10/6/2020 at 2:55 PM, CJH said: It worked for me ... finally, an answer! Thanks. The part that had fooled me was that this is a translation in the Classic theme, which I was not using and never have since the installation. I wanted to translate text in the theme I am using, so it was not intuitive to change the text in the Classic theme to update a different theme. But that is how it worked ... thank you so much! 4h searching Link to comment Share on other sites More sharing options...
CJH Posted January 31, 2021 Share Posted January 31, 2021 24 minutes ago, gtul said: thank you so much! 4h searching It took me days in a prior version, so well done on only spending 4h 🙂 Link to comment Share on other sites More sharing options...
Yuelang Zhou Posted March 29, 2021 Share Posted March 29, 2021 On 4/20/2020 at 2:21 PM, POOLEworks said: I created this little jQuery script to grab any FREE in a span with the class of small in a <td> and replace it $('td:contains("Free")').each(function(){ $(this).html($(this).html().split("Free").join("<span class='small'>We will call you with a shipping quote</span>")); }); It's a hack but it works on my final purchase confirmation. There might be other places that this works. The other option, as people have suggested is to edit templates. can I ask you where should I put the code exactly, thanks Link to comment Share on other sites More sharing options...
Yuelang Zhou Posted March 29, 2021 Share Posted March 29, 2021 On 6/14/2018 at 2:53 PM, hexstudios1214 said: THANKSSSSSS!!!!!!!!!!!!! I LOVE YOU This method works for me, but then I can't translate it into other languages and it always remains for example "to be defined" on all languages and it's not exactly the best, am I wrong? Thanks. Link to comment Share on other sites More sharing options...
Rod Graham Posted April 14, 2021 Share Posted April 14, 2021 It's still not fixed in 1.7.7.3. This problem has persisted for (AFAIK) three versions of Presta over many years. Here's my version of the workaround described above. It's not entirely satisfactory, but at least we don't have customers mistakenly thinking they are getting free shipping. Instead, they might think they can only Click & Collect, but IMO that's a lesser evil. International > Translations Then choose “Modify Translations” > “Themes Translations/classic/English”, then click “Modify” Then in the left hand column you’re looking for Shop > Theme > Checkout Then scroll down to find Entry Captioned “Free” and edit it to "Click & Collect" **But really, this is something for the core developers to fix.** 1 Link to comment Share on other sites More sharing options...
salouso Posted February 7, 2023 Share Posted February 7, 2023 On 4/20/2020 at 2:21 PM, POOLEworks said: I created this little jQuery script to grab any FREE in a span with the class of small in a <td> and replace it $('td:contains("Free")').each(function(){ $(this).html($(this).html().split("Free").join("<span class='small'>We will call you with a shipping quote</span>")); }); It's a hack but it works on my final purchase confirmation. There might be other places that this works. The other option, as people have suggested is to edit templates. I just came across this thread and I am having the same problem. I have 4 out of 7 carriers, that show as "free" although one of them is actually just to get a quote for shipping first. Where does your jquery script go? Kind Regards Sarah Link to comment Share on other sites More sharing options...
dehache Posted April 16, 2023 Share Posted April 16, 2023 On 3/9/2018 at 10:10 AM, AZHosting said: I found it. It's in src/Adapter/Cart/CartPresenter.php and makes reference to the translator for Shop>Theme>Checkout>Free but there isn't one. So this is a bug with may be fixed in some upcoming version. Just change 'Free' to something like 'Not Calculated' and you should be good to go until there is an upgrade path for 1.7. Probably see it being upgradable around 1.7.49 or so. No worries for the time being. src/Adapter/Cart/CartPresenter.php $subtotals['shipping'] = array( 'type' => 'shipping', 'label' => $this->translator->trans('Shipping', array(), 'Shop.Theme.Checkout'), 'amount' => $shippingCost, 'value' => $shippingCost != 0 ? $this->priceFormatter->format($shippingCost) : $this->translator->trans('Free', array(), 'Shop.Theme.Checkout'), ); Wuauuuuu thanks man!!! I guess this is the solution a lot of people is looking for... at least it works for me in PS1.7.4.4... after a lot of research... you did it for all of us! 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