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

  On 2/28/2024 at 11:33 PM, 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,

Expand  

Will definitely try this out.

Thanks a ton

Link to comment
Share on other sites

  On 2/28/2024 at 11:33 PM, 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,

Expand  

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

  On 3/1/2024 at 5:16 AM, 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>

 

Expand  

Hi,

 

The earlier option which baba code provided works well using javascript.

 

  • Like 1
Link to comment
Share on other sites

  On 3/1/2024 at 5:21 AM, Nathan_Pereira said:

Hi,

 

The earlier option which baba code provided works well using javascript.

 

Expand  

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