Jump to content

Changing Keyword 'Free' in Carrier Section for Checkout Summary Page


Nathan_Pereira

Recommended Posts

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,

  • Like 1
Link to comment
Share on other sites

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

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

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

image.png.7820f89c6a197e85eb16dadef05651f7.png

2. replace to

image.thumb.png.f35d0309c3af6521ad253b5faf317d25.png

<span class="carrier-price">{if $carrier.is_free == '0'}{$carrier.price}{/if}</span>

 

Link to comment
Share on other sites

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

image.png.7820f89c6a197e85eb16dadef05651f7.png

2. replace to

image.thumb.png.f35d0309c3af6521ad253b5faf317d25.png

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

 

  • Like 1
Link to comment
Share on other sites

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 !

image.png.5899ad2cc0db4d0373de2f6d0b48b181.png

  • Like 1
Link to comment
Share on other sites

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 by ps8modules.com (see edit history)
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...