Jump to content
Larry Ullman's Book Forums

Implementing Coupon System in the Second Site


Recommended Posts

Hey Vikky! To implement a coupon system, you'd want to start by creating a coupon table. A coupon would have a code, probably an expiration date, and then either be a percent off or a fixed-amount off. In more sophisticated systems, coupons may only apply to certain items or total order amount, etc. You may also want to track coupon usage. 

Then, as part of the checkout process, you'd need to add a field to accept a coupon. Your programming logic would need to verify that the coupon is valid, and adjust the order total accordingly. You'd want to update your orders table in the database to reflect use of a coupon. 

That's the basic framework for it; there are myriads permutations on how coupons could specifically be implemented. 

Link to comment
Share on other sites

 Share

×
×
  • Create New...