You are on page 1of 13

DISCOUNTS,

VOUCHERS, AND
REFERRALS
DISCOUNT CODES
• Discount codes are a great way to both invite new customers into a store, and
also to help retain customers with special discounts.
• The discount code should work by allowing the customer to enter a code,
which will then be verified by the store, and then a discount will be applied to
the order.
• Discount options:
– A fixed amount deducted from the cost of the order
– A fixed percentage deducted from the cost of the order
– The shipping cost altered, either to free or to a lower amount
– Product-based discounts
DISCOUNT CODES DATA
• It may also be useful to take into account the cost of the customer's basket;
after all if we have a $5 discount code, we probably wouldn't want that to
apply for orders of $5 or lower, and may wish to apply a minimum order
amount.
• The voucher code itself, so that we can check that the customer is entering a
valid code
• Whether the voucher code is active, as we may wish to prepare some voucher
codes, but not have them usable until a certain time, or we may wish to
discontinue a code
• The number of vouchers issued, if we wish to limit the number of uses of a
particular voucher code
• An expiry date, so that if we wish to have the voucher code expire, codes
with a date after the stored expiry date would no longer work.
DISCOUNT CODES DATABASE
DISCOUNT CODES FUNCTIONALITY
The function needs to:
1. Check to see if the customer has entered a voucher code with their order.
2. If they have, it must look up the voucher code to see if it exists, or doesn't exist.
3. If the voucher code exists, it must check to see if the code has expired and is still able to
be used (that is, that num vouchers is greater than 0 or equal to -1).
4. Assuming this is the case, it must then check to see that the customer's basket cost is at
least that of the minimum order amount in the discount codes record in the database.
5. If the voucher is able to be used, it must then determine the type of voucher, and make the
relevant discount to either the basket cost, or the shipping costs.
REDUCING THE NUMBER OF CODES AVAILABLE
• One feature we added to the database structure for our discount codes was the
ability to limit the number of times a voucher could be used, effectively
allowing a code to be "issued" a set number of times. We need to take this into
account, and reduce the number of vouchers in circulation, once one has been
used.
PURCHASABLE VOUCHER CODES
• Voucher codes work in the same way as discount codes, except that they are
purchased for use by a customer, as opposed to given away for promotional
reasons.
VOUCHER CODES
• vouchercode: A randomly generated string
• active: 1
• min_basket_cost: The amount of the voucher purchased
• discount_operation: (because we are subtracting an amount from the cost)
• discount_amount: The amount of the voucher purchased
• num_vouchers: 1
• expiry: A year in the future would be a suitable validity period
REFERRALS
• To reward loyal customers, we may wish to offer referral discounts to them.
• This would work by encouraging our customers to introduce new customers,
and giving them a credit based off a percentage of orders placed by customers
they refer to our store.
• Customers referring other customers would be given a referral code, which
could either be part of a link used to promote the site, or given to customers to
enter somewhere on the order process.
REFERRAL PROCESS
1. Check for a referral code in the URL.
2. If a code is found in the URL, it should be stored in a cookie.
3. At the checkout stage, this code should be looked up, to check if it is valid and to see
the commission to be applied to the customer who passed the referral. The order
number, commission value, and referring customer should be stored in a database
table.
4. When the order is updated to "paid" or "paid online", the commission should be
applied to the relevant customer's account.
REFERRERS TABLE STRUCTURE
ORDER PROCESS REVIEW
1. View the basket
– Enter voucher code
– Select shipping method
– Review cost based on shipping and voucher code
2. Authentication
– Log in
– Register
– Do nothing (if already logged in)
3. Confirm delivery address
4. Select payment method
5. Order confirmation
6. Display payment details
7. Payment made
8. Order processed

You might also like