New Landing How can we help? Themeforest Theme Support Neighborhood Out of stock badge color/text

Viewing 15 posts - 1 through 15 (of 24 total)
  • #80849
    Ayzoo
    Member
    Post count: 2

    Hey there,

    I would like to change the Out of Stock badge on on sold out products. The badge should appear red with white font and the text “SOLD OUT” instead of “out of stock”.

    I’ve found several similar requests here in the forum and I have tried changing various custom css codes found, however none of them seem to work.

    Color itself for example:

    .woocommerce .wc-out-of-stock-badge {
    background: #FF0000!important;
    }

    Thanks for the support
    Dario

    #80924
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    you need to edit the functions.php file in your theme at /wp-content/themes/dante/). Just go in there and add the following line anywhere after the <?php line:

    add_filter('woocommerce_get_availability', 'availability_filter_func'); 
    function availability_filter_func($availability) { 
    $availability['availability'] = str_ireplace('Out of stock', 'Sold Out', $availability['availability']); 
    return $availability; 
    }

    Please provide specific page url with out of stock so i can give exact solution.
    Thanks ๐Ÿ™‚
    With Best Regards
    Swift Ideas

    #125912
    illustrate74
    Member
    Post count: 63

    hi, im needing to do the same with the cardinal theme…i tryed the above method but no joy?
    http://rmer1.com/shop just need to replace “out of stock” with “sold”

    many thanks
    Bradley

    #125984
    laranz – SUPPORT
    Member
    Post count: 3186

    Hi @illustrate74,

    “Out of stock” can be found in the .po file, you can change that in the .po file while translating the theme.. Use some plugin like this https://wordpress.org/plugins/codestyling-localization/ to translate the words in the .po file.

    Let us know,

    Thanks,
    laranz.

    #125994
    illustrate74
    Member
    Post count: 63

    Hi Laranz…i think we have our wires crossed? i dont need to translate anything?

    i need to change the english banner text from ” out of stock” to “sold out”

    Thanks
    Bradley

    #125998
    laranz – SUPPORT
    Member
    Post count: 3186

    Hi,

    Just translate the word “Out of stock” to “Sold out”, it will do the trick, no need to translate the whole theme for this.

    Hope this helps,

    Let us know,

    Thanks,
    laranz.

    #126000
    illustrate74
    Member
    Post count: 63

    Hi Laranz, please can you point me in the right direction where to make this change? in which file?

    thanks
    Bradley

    #126007
    laranz – SUPPORT
    Member
    Post count: 3186

    Hi,

    Pass me the WP Login details in a private reply, I will do that for you. Also install this plugin for me https://wordpress.org/plugins/codestyling-localization/

    Thanks,
    laranz.

    #126015
    illustrate74
    Member
    Post count: 63
    This reply has been marked as private.
    #126017
    illustrate74
    Member
    Post count: 63

    pluging now installed

    thanks
    Bradley

    #126155
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    No problem. Thanks Laranz
    -Rui

    #126288
    illustrate74
    Member
    Post count: 63

    Hi laranz..was there a problem making the changes? http://rmer1.com/shop

    thanks
    Bradley

    #126469
    Rui Guerreiro – SUPPORT
    Keymaster
    Post count: 25779

    Hi,

    Was checking this topic but it seems the word is already changed to “Sold”
    Can you confirm?

    -Rui

    #229144
    stoukan
    Member
    Post count: 75

    Hello,

    I’d like to change the color of “Out of stock” on the product page. Is there a way to do this?

    The above code worked for me to change the text ๐Ÿ™‚

    Best,
    Sarah

    #229146
    David Martin – Support
    Moderator
    Post count: 20834

    The below should provide you with both the background color and text color:

    .woocommerce .wc-out-of-stock-badge {
    background: #FF0000!important;
    }
    
    .woocommerce .wc-out-of-stock-badge {
    color: #000000!important;
    }

    Thanks,
    David.

Viewing 15 posts - 1 through 15 (of 24 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register