Results 1 to 4 of 4

Thread: coupon generation and redemption

  1. #1
    Join Date
    Jun 2012

    coupon generation and redemption

    Hi everybody,

    I am wondering if I could throw this out there and get a bit of feedback/advice on this project.

    We are trying to provide our users with access to coupons that they can print from their computer. We currently use a learning management system (written in PHP) so our users will be logged in we can easily access their name, user_id, and the like with just a few lines of PHP.

    As the user is going through material, they will see a graphic that says, "click her for a coupon". This graphic can popup a new windows. In the new window, we want to have information about the merchant/discount and a button that says, "print". After the user clicks print, a dynamically generated coupon would be created and print out.

    Features/Restrictions we would like in place:

    - dynamically generated coupons: merchant name, discount, location, logo, unique coupon id number and user's name drawn from a database and contained on the coupon as it is generated "on-the-fly"

    - users can only print the coupon one time

    - If the user tries to print the coupon more than one time, they should see a message that says, "you have already printed this coupon on INSERT PRINTED DATE HERE"

    - We would also like the user to be able to access a sort of coupon dashboard where they would see a list of all the coupons and a column with the "status" of a coupon which would indicate if the coupon is "locked", "unlocked and printed", or "unlocked and not printed". A coupon will be "locked" until the view the graphic for the first time that says, "click here for the coupon"

    Does anybody have any ideas on the logic of this setup? I am thinking of doing the following:

    - When the user clicks the graphic that says, "click here to print", that will be a link that opens a new window like displayOffer.php?id=123

    the id variable will correspond to the coupon_id variable.

    How would you guys go about tracking when the coupon has been displayed, when the user clicks print, and assigning unique coupon id#s to each coupon?

    So far, I am thinking I will need the following DB tables setup:

    - coupon_id (int)
    - merchant_id (int)
    - discount (varchar)
    - expiration (date)

    - merchant_id (int)
    - name (varchar)
    - address (varchar)
    - phone (varchar)
    - city (varchar)
    - email (varchar)
    - website (varchar)

    - user_id (int)
    - coupon_id (int)
    - status (varchar)
    - unlocked_date (date)
    - print_date (date)

  2. #2
    Join Date
    Mar 2012
    The idea of restricting the user to printing the coupon only once will not work:
    a) What if the printout fails (for any of a plethora of reasons)?
    b) If you ask "printout ok?" what's to stop them saying "no" when it has?
    c) What if they "print" to a pdf file? They can then print it as many times as they like!!!

    It just is not reliable, and could cause more bad feeling, and time-wasting, than good. A better solution is to:
    a) Tell the users that the redemption of vouchers will be monitored, so not to abuse the system.
    b) Record the issue of vouchers to individuals (as you had already intended).
    c) Record the redemption of vouchers, allowing for multiple usage, and date-last-used.
    d) Periodically run a simple report to output multiple usage in a date-last-used range.
    e) Take whatever action is appropriate...

  3. #3
    Join Date
    Jun 2012


    thank you for your response - I really appreciate it.

  4. #4
    Join Date
    Sep 2007
    We were looking at the same thing, thanks for the feedback Jed!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.16355 seconds
  • Memory Usage 2,861KB
  • Queries Executed 15 (?)
More Information
Template Usage (32):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (4)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (70):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates