Home Forums Basel support forum Change Label Sold Out to Out Of Stock

Change Label Sold Out to Out Of Stock

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #274345

    Usman Ali
    Participant

    Hi,
    I want to change “Sold Out” label to “Out Of Stock”.
    How can we do that?
    Screenshot attached.
    Thanks

    Attachments:
    You must be logged in to view attached files.
    #274414

    Hello,

    You can translate/rewrite all theme and plugin texts via PO file in WordPress. Here is a video tutorial that should help you translate your website texts with a Loco Translate plugin https://www.youtube.com/watch?v=D3NsDdMzsls&list=PLMw6W4rAaOgKKv0oexGHzpWBg1imvrval&index=3

    Please check the video tutorial to see how to save the translation file correctly. You can remove the plugin and translations would remain. Also, translations would remain after each theme update.

    Best Regards

    #274925

    Usman Ali
    Participant

    Hi,
    It’s not about the translation. I need to change the out of stock label.
    When the product is out of stock label comes on product SOLD OUT.
    I want it to be OUT OF STOCK.

    Check attached screen shot.
    Thanks

    Attachments:
    You must be logged in to view attached files.
    #274952

    Hello,

    You need to create the same translation as your site language is. Then change the string as per your needs. Loco is the only way to change the wording.

    Best Regards

    #275099

    Usman Ali
    Participant

    Hi,
    Can we change this in codding? Like can we add this code.
    Can you tell me where I can find code ‘woocommerce_get_availability’?

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

    // Change Out of Stock Text
    if ( ! $_product->is_in_stock() ) {
    $availability[‘availability’] = __(‘Sold Out’, ‘woocommerce’);
    }
    return $availability;
    }

    Thanks

    #275147

    Hello,

    Sold out label is the Woocommerce functionality, our support does not cover customization of the plugins, our support relates to these issues only.

    Even though you customize the code it would be lost during the plugin update. The only safe way requiring one-time plugin using is translating by means of Loco plugin, you can install, rewrite as per your needs and then delete the plugin the change would remain forever.

    Best Regards

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