I am trying to use the code in this old thread. Filter to check quantity at checkout But i get an error with the woocommerce->add_error() part.
There seem to be some deprecated code in this, can someone help me spot those for a new code working for newest version of wordpress/woocomerce?
I think add_error()
is no longer in woocommerce
you should use wc_add_notice
.visit this may help you.