What were the client’s requirements?
The requirement was to provide a functionality which offered visitors discount coupons or deals like RetailMeNot or Groupon. The coupons or deals are available for product purchases on e-Commerce websites. The visitor could then use the coupons or deal links to avail special offers.
How did we provide a solution?
To make and save coupons, we had to create a custom post type coupon. Additionally we had to create a custom template for each coupon, which basically structures how each coupons is displayed and what information will be provided.
The feature was implemented as follows:
- A form was provided in the front end, using which coupons could be added.
- There are two types of coupons, a coupon which has a discount code, and a deal coupon.
- The coupon with the discount code could be used in the product website, while making the purchase, whereas the deals coupon redirects you to the product website page which features deals and sales.
- A coupon when added had to be approved by the site admin before it could be presented to a site visitor.
- Every coupon has an expiry date and no two coupons with the same offer could be featured on the site at the same time, even if the date of expiration was different.
The project involved providing the coupon functionality as a plugin which could be integrated into any WordPress site. The coupons had to have a title, description, a featured image, the discount code or deal link and expiry details.
Each created coupon had an associated shortcode which could be used to show the coupon to the user. Also, a shortcode was provided to list all the coupons in a post or page. An important feature was a page which allowed the addition of coupons from the front end. The user needed to enter coupon details, select if the coupon was a deal or a code, and submit a new coupon. But the coupon submitted would be shown to a visitor only if it was approved by the site administrator. Thus notifications of newly added coupons also had to be sent.
Additionally there was an option to hide the display of expired coupons, or change the coupon status message to ‘expired’ and continue to display it, even upon expiry. Another important feature was to avoid the display of coupons which held the same offer. A check was added to hide a duplicate coupon. The conditions which qualified the coupon as duplicate were as required by the client.