Archived topic
How to Remove / Hide OUT OF STOCK label or translate it
1 reply · Started by Robert on February 18, 2023
Hi
I try to Remove / Hide OUT OF STOCK label or translate it
https://snipboard.io/AuPw7E.jpg
I installed LOCO TRANSLATE and there, for the woocommerce plugin, is a translation
but on mu page it's still in english "OUT OF STOCK"
Then I tryed do add this code in CSS but nothing happened:
.woocommerce div.product .out-of-stock {
visibility: hidden;
}
and then I addes tgis PHP code:
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 );
add_action( 'woocommerce_after_single_product_summary', 'replace_tabs_with_long_description', 10 );
function replace_tabs_with_long_description() {
?>
<?php
}
add_action('woocommerce_after_single_product', 'move_stuff_to_first_full_width_section', );
function move_stuff_to_first_full_width_section() {
echo 'TEST';
}
and there isn't still ant result
I spoke allready with Elementor team - they said:
I understand your concern. However, as much as I would love to help you, for the moment, this is not possible with Elementor as it is based on your theme.
Thx
Rob.
Thx
Robert
Hi there,
GP doesn't interfere with that, we leave that all to Woocommerce.
But Woo does have the woocommerce_get_availability_text filter hook.
If the plugins you're using use the core Woo functions for showing that message then you should be able to use it like so in a PHP Snippet:
add_filter( 'woocommerce_get_availability_text', 'db_change_out_of_stock', 10, 2 );
function db_change_out_of_stock( $availability, $product ) {
if ( ! $product->is_in_stock() ) {
$availability = __( 'Your out of stock message here', 'woocommerce' );
}
return $availability;
}
If not , then you can use some CSS to hide that notice:
.uael-out-of-stock {
display: none !important;
}