



Web Development
Apply Reseller Coupons via URL

This project involved implementing custom code to improve WooCommerce functionality for resellers. A custom post type named Resellers was created and linked to user accounts via a Reseller ID, allowing a coupon table to appear in the My Account section on the frontend. Each Reseller Post includes custom fields such as image, location, name, and a repeater field for storing assigned coupons. The repeater contains the Coupon ID, now visible when editing coupons, and the Coupon URL parameter used in the shareable link structure. When a Reseller Post is updated, the repeater field updates automatically and builds the full shareable link in the format: [Product URL]/?r={Reseller ID}&c={Coupon Param URL}.
When a product URL includes valid reseller and coupon parameters, a box near the product title displays reseller details, including their image, name, and location, along with the full discount percentage. The discount adjusts dynamically based on the sale price if the product is on sale or as a percentage of the fixed discount amount when applicable.
A PHP REST API retrieves reseller and coupon data, and custom logic applies the coupon when the page loads. Since WooCommerce does not adjust product prices dynamically when a coupon is applied, custom code updates the frontend product price with the correct discounted amount. The side cart also features modifications where the coupon discount appears, and the total cart value updates accordingly using custom
When a product URL includes valid reseller and coupon parameters, a box near the product title displays reseller details, including their image, name, and location, along with the full discount percentage. The discount adjusts dynamically based on the sale price if the product is on sale or as a percentage of the fixed discount amount when applicable.
A PHP REST API retrieves reseller and coupon data, and custom logic applies the coupon when the page loads. Since WooCommerce does not adjust product prices dynamically when a coupon is applied, custom code updates the frontend product price with the correct discounted amount. The side cart also features modifications where the coupon discount appears, and the total cart value updates accordingly using custom