This topic has 2 replies, 2 voices, and was last updated 1 months, 1 weeks ago ago by Luca Rossi
Hola! Quiero poner agotado que destaque cuando no tenga existencias del producto.
He puesto el código en funtion.php del tema con el plugins snippets y código css en estilo del tema pero no funciona.
Podéis mirar porque es …? Gracias !!!
Hi @elrincondelanena.moda@gmail.com,
We’ve updated the custom code to this:
add_filter( 'woocommerce_package_rates', 'my_hide_shipping_when_free_is_available', 100 );
add_action( 'after_etheme_product_grid_list_product_element_title', 'dcms_show_out_stock', 10 );
function dcms_show_out_stock() {
global $product;
if ( $product->managing_stock() && ! $product->is_in_stock() ){
echo '<p class="stock out-of-stock">'.__('Out of stock','woocommerce').'</p>';
}
}
And updated the custom CSS codes to this:
.etheme-product-grid-item {
position: relative;
}
.etheme-product-grid-content {
position: static;
}
.etheme-product-grid-content p.stock.out-of-stock {
position: absolute;
background:red;
color:white;
padding:4px 10px;
right: 0;
top:0;
}
The out of stock label is displaying now: https://prnt.sc/v4QZo_9DyYTB.
Can you please check again?
Best regards,
8Theme’s Team
You must be logged in to reply to this topic.Log in/Sign up