Customize a Simple Woocommerce Feature snippet

Job ID: 31443671

Budget: $10 – $30 USD

Hi There, I'm looking for a way to make a variable product sale end after a certain number of units sold.

Woocommerce has a way to schedule sales, but I'm more interested in ending the sale after X units have been sold instead of by date.

The attached file shows a crude mockup of what I'm hoping to get in the form of a snippet I can add with the php snippet plugin.

Would you be able to create such a snippet?

Please Bid on the project with just a simple sentence about how you would solve this issue with PHP in woocommerce/ wordpress.
Related categories: PHP JavaScript WordPress WooCommerce