WooCommerce Partner Discount Automation

Замовник: AI | Опубліковано: 19.03.2026

My WooCommerce store already handles user registration and logs an invitation code for every new customer, but the final piece is missing: the code must trigger an automatic 5 % discount on all products (shipping excluded) every time that customer checks out, without asking them to apply a coupon manually. Here is how it should behave: • When a shopper creates an account and supplies an invitation code—example: “LIMEXUN”—that code is stored in their user meta exactly as we are doing now. • From that moment on, whenever that user adds items to the cart and reaches checkout, WooCommerce should detect the stored code and permanently apply a 5 % reduction to product subtotals only. Shipping fees, taxes and everything else stay untouched. • The discount must be visible in the order review and the final order summary, so the customer clearly sees the savings. • Because our registration flow and tracking table are already live, your work will focus on the hook/logic that ties the saved code to the cart calculations, plus a clean way to edit or revoke a code from the back-end if we ever need to. I’m running the latest stable WordPress + WooCommerce stack on a standard LAMP server. Please build this as a lightweight plugin or a child-theme snippet—whichever is cleanest—making sure it stays intact through future core updates. Documentation and a brief note on which actions/filters you touched will be the hand-over deliverable.