PONER AGOTADO EN LOS ARTÍCULOS SIN EXISTENCIAS

This topic has 2 replies, 2 voices, and was last updated 1 months, 1 weeks ago ago by Luca Rossi

  • Avatar: elrincondelanena.moda@gmail.com
    elrincondelanena.moda@gmail.com
    Participant
    October 13, 2024 at 10:26

    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 !!!

    Please, contact administrator
    for this information.
    Files is visible for topic creator and
    support staff only.
    1 Answer
    Avatar: Justin
    Luca Rossi
    Support staff
    October 14, 2024 at 12:12

    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

  • Viewing 2 results - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.Log in/Sign up

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.