Jump to content

Where to change text for Free Shipping? [PrestaShop 1.7.2.4]


Shipsworld

Recommended Posts

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...)

PrintScreen002.jpg

PrintScreen003.jpg

Link to comment
Share on other sites

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 by Shipsworld (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 2 months later...

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 by AZHosting (see edit history)
Link to comment
Share on other sites

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'),
        );

 

 

  • Like 1
  • Thanks 3
Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...

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.

  • Like 1
Link to comment
Share on other sites

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.

  • Like 2
Link to comment
Share on other sites

  • 3 weeks later...
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

  • 2 months later...
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

  • Like 1
  • Thanks 2
Link to comment
Share on other sites

  • 3 months later...

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>&nbsp;{$cart.subtotals.shipping.value} {hook h='displayCheckoutSubtotalDetails' subtotal=$cart.subtotals.shipping}</p>
 

+ css

div#cart-subtotal-shipping.cart-summary-line {
    display:none;
     }

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...
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

  • Thanks 1
Link to comment
Share on other sites

  • 2 months later...

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.

 

Screenshot 2019-04-02 17.21.04.png

  • Like 1
Link to comment
Share on other sites

  • 11 months later...

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

  • 2 weeks later...

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

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

  • 2 weeks later...

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

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

  • 1 month later...
  • 3 months later...

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 ...

  • Like 2
Link to comment
Share on other sites

  • 3 months later...
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

  • 1 month later...
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

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

  • 3 weeks later...

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.**

 

  • Like 1
Link to comment
Share on other sites

  • 1 year later...
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

  • 2 months later...
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...