• Resolved micacc

    (@micacc)


    Hello! I would like to change the text of the Product Stock Widget. It appears on the product page as “In stock” and I would like to change it to “Available”. In the elementor page I can only see the option to change text color and font, how should I go about changing the text?

    Image: https://ibb.co/ScMyPBg

Viewing 1 replies (of 1 total)
  • Plugin Support Md Abdullah Al Arif

    (@faithcoder)

    Hi @micacc,

    Hope you’re doing great. The “In Stock” string comes from WooCommerce not in ShopEngine (screenshot). To change the text, insert a custom code snippet into your theme’s functions.php file:

    function custom_woocommerce_get_availability_text( $text, $product ) {
    if (!$product->is_in_stock()) {
    $text = 'Not Available';
    } else{
    $text = 'Available';
    }
    return $text;
    }
    
    add_filter( 'woocommerce_get_availability_text', 'custom_woocommerce_get_availability_text', 999, 2);

    Hope it will fulfill your needs.

    Best Regards

    Arif

Viewing 1 replies (of 1 total)
  • The topic ‘How to change the ‘Product Stock’ widget text?’ is closed to new replies.