This topic has 5 replies, 2 voices, and was last updated 7 years by Laura.

  • Author
  • #157384
     commonplaces
    Participant

    Hello,

    I try to change the name on the badge “out of stock” by sold

    for that i copy the file config.php, change the word and then i added with the same folder structure in the child them

    kleo-child/lib/plugin-woocommerce/config.php

    But i can’t see the modification on the website;

     

    the badge are still displaying “out of stock”

    could you help me to solve this

     

     

     

     

    #157418
     Laura
    Moderator

    Hello have you tried using Loco Translate?

    Theme strings and plugins strings can easily be changed by using Loco Translate plugin https://wordpress.org/plugins/loco-translate/
    <h3>A small introduction on how translations work</h3>
    Translatable strings can come from the theme or from the installed plugins. You need to translate the theme or the plugin depending on what section of the site your string is found.

    For example if your string is on your BuddyPress profile then most probably you will need to translate BuddyPress plugin. If you are on the Forums section of your site then bbPress plugin should be the one that needs to be translated. Another example is the rtMedia plugin that adds the Media links to BuddyPress and if you want to translate it then this plugin will contain the string.
    <h3>Follow these steps to get you started:</h3>

    • Install Loco Translate plugin
    • Go to the plugin dashboard: WP Admin – Tools – Manage translations
    • Find the theme or plugin in the list.
    • If the language isn’t already in the list then click Add new language, choose your language and if you are asked where you want to save the language files choose global language directory ( wp-content/languages/ ).
    • Press SYNC button to synchronise your translation with the provided .pot file
    • Search for the string you want to translate and add your translated string.
    • Press Save when you finished your translation.

    Note: You will have to set the language for your blog from WP-admin – Settings – General – Site Language – Choose your language

    Cheers

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #157435
     commonplaces
    Participant

    Hi,
    i have already a lot of plugin, and i use WPML for my translations.
    I would like to avoid to install another plugin just for a small string i want to change in the original theme.
    Is there another way to do that?
    Is the child theme isn’t made for that.?

    #157738
     Laura
    Moderator

    Hello, please try https://www.templatemonster.com/help/woocommerce-how-to-change-in-stock-out-of-stock-text-displayed-on-a-product-page.html#gref Let me know if it works

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #157746
     commonplaces
    Participant

    I put the code in the function.php of the child theme, but it doesn’t change wording on the banner on the products 🙁


    add_filter( 'woocommerce_get_availability', 'wcs_custom_get_availability', 1, 2);
    function wcs_custom_get_availability( $availability, $_product ) {

    // Change In Stock Text
    if ( $_product->is_in_stock() ) {
    $availability['availability'] = __('Available!', 'woocommerce');
    }
    // Change Out of Stock Text
    if ( ! $_product->is_in_stock() ) {
    $availability['availability'] = __('SOLD', 'woocommerce');
    }
    return $availability;
    }

    #157879
     Laura
    Moderator

    Hello, i see, as this is more woocommerce related i would suggest to contact woocommerce support forum as they would know better than me 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

Viewing 6 posts - 1 through 6 (of 6 total)

The forum ‘Bugs & Issues’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?