New Landing How can we help? Atelier stock display

Viewing 13 posts - 1 through 13 (of 13 total)
  • Posted in: Atelier
  • #257848
    NikkiSt
    Member
    Post count: 240

    Hi

    Is it possible to hide the “in stock” display on product pages but still to show when stock is low? i.e. only 2 left in stock?

    Thanks

    #257862
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please use this custom css code:-
    .stock { display:none !important; }
    Thanks
    Mohammad

    #257879
    NikkiSt
    Member
    Post count: 240

    Thanks Mohammad , but if I use that code then it also takes away the low stock notification? I want to be able to not show if it’s in stock (if there is a high stock count) but still to show if stock is low?

    Is this possible?

    Thanks

    #257881
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please provide me specific page url with issue to check and resolve the issue.
    Thanks
    Mohammad

    #257899
    NikkiSt
    Member
    Post count: 240
    This reply has been marked as private.
    #258003
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please use this custom css code:-

    .in-stock{
    display:none !important;
    }

    Thanks
    Mohammad

    #258098
    NikkiSt
    Member
    Post count: 240

    Hi Mohammad

    With that custom code, it still removes the low-stock notification as well? Is it possible to still have the low stock notification visible but the in stock, above the low stock threshold , not visible?

    #258099
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please remove css code and use this php code at functions.php of child theme.

    add_filter( 'woocommerce_get_availability', 'wcs_custom_get_availability', 1, 2);
    function wcs_custom_get_availability( $availability, $_product ) {
       
       	// Change In Stock Text
        if ( $_product->is_in_stock() ) {
            $availability['availability'] = __(' ', 'woocommerce');
        }
    
        return $availability;
    }
    #258103
    NikkiSt
    Member
    Post count: 240

    I’ve added this but still not showing if there is low stock…? ๐Ÿ™

    #258124
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please paste this code at functions.php of child theme.

    function sf_text_strings( $translated_text, $text, $domain ) {
    	switch ( $translated_text ) {
    		case 'In stock' :
    			$translated_text = __( ' ', $domain );
    			break;
    	}
    	return $translated_text;
    }
    add_filter( 'gettext', 'sf_text_strings', 20, 3 );
    

    Thanks
    Mohammad

    #258173
    NikkiSt
    Member
    Post count: 240

    Thanks, should I delete the previous one in functions folder?

    #258174
    NikkiSt
    Member
    Post count: 240

    Thanks so much – works perfectly ๐Ÿ™‚

    #258177
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    You most welcome and glad to help you.
    Thanks
    Mohammad

Viewing 13 posts - 1 through 13 (of 13 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register