• Greetings…

    For security purposes I do not want to show full stock amounts.

    So we have a product that has a 1000 units, on the front end of the site I only want to show that we have 50 units, once there are actually less than 50 units we can show less until we are sold out.

    But we never want to show a full 1000 units because we don’t want to give the impression that we have a full warehouse because of robbers.

    Is there a way to do this?

    Thanks

    Rob

Viewing 1 replies (of 1 total)
  • Try this in your child theme’s functions.php:

    
    add_filter( 'woocommerce_get_stock_quantity', 'my_stock');
    function my_stock( $count) {
      if ( !is_admin() ) {
       $count = min( $count, 50 );
      }
      return $count;
    }
    
Viewing 1 replies (of 1 total)
  • The topic ‘Showing Product Stock Quantities’ is closed to new replies.