• Resolved emanuelaibisco

    (@emanuelaibisco)


    hi, I would like to change the text of the “leggi tutto” label for out of stock products on the products page, I would like to put “esaurito” as in the single product page. How to do this? Thank you!
    Emanuela

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Francesco Grasso

    (@francgrasso)

    YITH Support Representative

    Salve, scusa per il ritardo.
    Ecco a te un codice che puoi aggiungere al functions.php del tuo child theme:

    add_filter( 'woocommerce_product_add_to_cart_text', 'customize_out_of_stock_text', 10, 2 );
    
    /**
     * Change Soud Out label in loops.
     *
     * @param string $text Original text.
     * @param object $product Product.
     * @return mixed|void $text The new label.
     */
    function customize_out_of_stock_text( $text, $product ) {
    	if ( ! $product->is_in_stock() ) {
    		$text = 'Esaurito';
    	}
    	return $text;
    }

    Fammi sapere se hai bisogno di ulteriore aiuto ??

    Thread Starter emanuelaibisco

    (@emanuelaibisco)

    Grazie mille, funziona perfettamente! ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘how to change label for out of stock product’ is closed to new replies.