Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CheapLocalDeals.com

A legacy PHP e-commerce platform for selling and redeeming local gift certificates. Developed circa 2008–2010, retired in 2012.

What It Does

CheapLocalDeals.com connects local businesses (advertisers) with customers looking for discounted gift certificates. Customers browse geo-targeted deals, purchase certificates online, and print or download them. Advertisers manage listings, certificate amounts, and redemptions through a merchant portal. The site also includes affiliate tracking, a white-label XML/KML API, and a separate mobile site.

Tech Stack

Layer Technology
Language PHP 5.x (legacy patterns)
Web server Apache + mod_rewrite
Database MySQL via PEAR MDB2
Cache Memcached (required)
Sessions PHP sessions + DB sessions table
PDF FPDF 1.6
Geolocation MaxMind GeoLite City (GeoLiteCity.dat)
Payments Authorize.net / LinkPoint, PayPal Express Checkout
Frontend jQuery 1.4.2, jQuery UI, FCKEditor

Project Layout

├── admin/                  Site administrator panel
├── advertiser_admin/       Merchant portal
├── advertiser-signup/      Multi-step advertiser registration
├── affTrack/               Affiliate self-service dashboard
├── affiliates/             Affiliate management (admin-gated)
├── checkout/               Shopping cart and payment processing
├── customer_admin/         Customer account portal
├── includes/               Core framework (config, classes, templates, libs)
├── mobile/                 Separate mobile site
├── sections/               Public page scripts (search results, location info)
├── tools/                  Maintenance utilities (sitemaps, cache admin)
├── index.php               Fixed-route entry point
├── redirect.php            SEO-friendly URL resolver
└── .htaccess               URL rewriting and caching rules

Documentation

Document Description
Architecture Request flow, portals, routing, and core classes
Setup Guide Server requirements and local development
Database Reference Table inventory and data model
Business Workflows Customer checkout, advertiser onboarding, affiliates
Configuration Config files, settings constants, and secrets
Known Issues Missing files, legacy debt, and security notes

Quick Start

This application has no build step. Deploy the PHP tree to an Apache document root. See docs/SETUP.md for full requirements.

Critical dependencies:

  1. Apache with mod_rewrite and AllowOverride All
  2. PHP with memcache extension
  3. MySQL database — import sql/schema.sql (see docs/DATABASE.md)
  4. Memcached running on localhost:11211
  5. Writable directories at /var/www/temp/cache/ and /var/www/temp/sessions/

Note: Memcached is a hard dependency. The site will not load without it.

History

Developed in 2008 when mobile access was just emerging; a separate mobile site exists but was never fully polished. PEAR libraries handle most system functions. FPDF generates gift certificate PDFs. Payment integrations include Authorize.net and PayPal.

The site was retired in 2012, two years after the original employer stopped commissioning updates (last code changes ~June 2010). The client returned the source rather than continue paying ~$200/month hosting for the large geo-targeted site.

Geolocation used a flat-file MaxMind database updated via cron; the update script is not in this repository, but includes/libs/GeoLiteCity.dat is included.

License

MIT License — Copyright (c) 2015 Robert McDowell. See License.

Security Warning

This repository contains hardcoded production credentials (database passwords, payment gateway keys, API tokens) in includes/config.php and includes/settings.php. Rotate all secrets before any redeployment. See docs/KNOWN_ISSUES.md for details.

About

e-commerce gift certificate system using PHP PEAR, geo-location, memcached, and other various libraries

Resources

Stars

2 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages