Sample work · WordPress
WooCommerce Extension: Quantity Discount per Category
A small plugin that applies a discount to a product category starting from a specific quantity. Tested using real shopping carts on a local WooCommerce installation, accurate to the cent, with verification without the plugin.
Sample work (demo), not a client job. Built as a trial task with invented example data; the check figures below come from the automatic test run and are not polished.
What was built
- Tiers and category in a single option, adjustable without code changes
- Discount per cart line item, visible in the cart
- Without WooCommerce the site remains intact: the plugin simply deactivates itself
How it was checked
Automatic test run on 2026-10-31, taken from the log (test data invented, figures measured):
- WooCommerce 11.2.1 local, custom plugin GL Quantity Discount (from 3 items 10 %, from 5 items 15 %, category coffee)
- 13/13 tests passed via the Store API (6 shopping carts accurate to the cent, option works, verification without plugin, no fatal error without WooCommerce)
Limits
What this sample does not cover, so nobody expects more:
- Local copy with SQLite instead of MySQL and php -S; WooCommerce runs there, but is officially built for MySQL/MariaDB - verify on the customer's staging copy
- Taxes off and virtual products: discount before/after tax and shipping rules are not part of the test
- Rule as fee in the cart (classic and block checkout both calculate via the cart); payment providers, real orders and emails not tested - no account, no payment
- Shopify/other shop systems are a different skill (shop)
Something like this for your business?
Describe briefly what you need. You get a fixed price before I start; nothing happens without your yes.