How to remove a word created by a plugin from the site

Asked

Viewed 281 times

1

We use Wordpress and Woocommerce on our site and to calculate shipping we use the plugin Postcode Shipping. Our freight has 3 values (large São Paulo, interior of SP and neighboring cities) and is fixed charged only by order and not by product.

The question of being able to have 3 fixed values for freight is partly already solved. But when a customer informs a zip code that there is no freight available, it appears Free, how do I remove the word "Free"? I already searched the plugin file but could not.

snapshot do total no carrinho

  • Hello, Cortez, I edited your question to greatly reduce your freight description since the problem you ask is not that, it’s like removing a word. I changed the title also to make it more generic and useful for anyone who has a similar problem.

3 answers

1

Yeah, the plugin has not translation files (nome-pt_BR.po or .mo). I also searched inside Woocommerce and is not. It means that probably is in your theme (or another plugin).

The most direct way is to edit the language files. To edit files .po use the Poedit (and upload the file .mo created) or the Codestyling Localization (and edit directly on the site).

Another possibility is to use jQuery:

add_filter( 'wp_head', function()
{
    if( !is_page( 'PÁGINA-DO-CARRINHO' ) ) // http://codex.wordpress.org/Conditional_Tags
        return;
    ?>
    <script type="text/javascript">
    jQuery(document).ready( function($) 
    { 
        $('#BOX-CORRESPONDENTE').text( 'Seu texto sem grátis' );
    });
    </script>
    <?php
});

Or else, if none of this works, there is the heavy bar option that is to search inside all the translations to modify the string. For this, use the plugin Retranslate modifying the context for frontend.

1

Original content:

My content. (Free)

Original HTML code:

<div>Meu conteúdo. (Grátis)</div>

Javascript to insert:

<body onload="document.body.innerHTML = document.body.innerHTML.replace('(Grátis)', '');">

Final result:

My content.

Brutal, but depending on your effective case.

Example in Jsfiddle.

0

Have you taken a good look at the configuration of the plugin? It is a very silly mistake to happen, try to see direct with plugin support

Browser other questions tagged

You are not signed in. Login or sign up in order to post.