• For some reason, customers who had filled their carts with products could purchase “Out of stock” products if they returned to their carts after a while and in the meantime other customers purchased the last remaining items. When these customers returned to their carts, they could just go to the checkout or cart, without any error message saying that one of the products in their cart was out of stock.

    It took me quite a while to figure out that this plugin was causing this problem.

    The wc_clear_notices() in wcpgsk-af.php makes sure that the error handler never receives the error message and lets the customer purchase a product without giving an error message.

    I don’t know what the use is of calling this function here, but I commented it out and now my checkout and cart pages give proper error messages when a product from the cart is out of stock.

    function wcpgsk_clear_messages() {
    	if ( function_exists('WC') && function_exists('wc_clear_notices') ) :
    		//wc_clear_notices();
    	else :
    		global $woocommerce;
    		$woocommerce->clear_messages();
    	endif;
    }

    https://www.ads-software.com/plugins/woocommerce-poor-guys-swiss-knife/

  • The topic ‘[Bug] No "Out of Stock" error message’ is closed to new replies.