CORE POS - IS4C
The CORE POS front end
Public Member Functions | List of all members
HouseCoupon Class Reference
Inheritance diagram for HouseCoupon:
SpecialUPC

Public Member Functions

 isSpecial ($upc)
 
 handle ($upc, $json)
 
 checkQualifications ($id, $quiet=false)
 
 checkLimits ($id)
 
 getValue ($id)
 
- Public Member Functions inherited from SpecialUPC
 isSpecial ($upc)
 
 is_special ($upc)
 
 handle ($upc, $json)
 

Detailed Description

WFC style custom store coupons

This class looks for UPC prefix 00499999

The remainder of the UPC is an ID value to look up requirement(s) and discount via the houseCoupons and houseCouponItems tables

Member Function Documentation

HouseCoupon::checkLimits (   $id)

Check how many times the coupon has been used and compare against usage limits - e.g., one per transaction, one per member, etc. This is a separate method from checkQualifications() so that calling code has the option of working around limits via voids or amount adjustments

Parameters
$id[int] coupon ID
Returns
[boolean] true or [string] error message

For members, enforce limits against longer transaction history

HouseCoupon::checkQualifications (   $id,
  $quiet = false 
)

Validate coupon exists, is not expired, and transaction meets required qualifications

Parameters
$id[int] coupon ID
$quiet[boolean] just return false rather than an error message on failure
Returns
[boolean] true or [string] error message
HouseCoupon::getValue (   $id)

Get information about how much the coupon is worth

Parameters
$id[int] coupon ID
Returns
array with keys: value => [float] coupon value department => [int] department number for the coupon description => [string] description for coupon

This is a little messy to cram two different values into one number. The decimal portion is the discount percentage; the integer portion is the maximum discountable total. The latter is the discount cap expressed in a way that will be an integer more often.

Example: A 5 percent discount capped at $2.50 => 50.05


The documentation for this class was generated from the following file: