e-Commerce feature

One of the features has to be a cart and a checkout process to support a full e-Commerce implementation.

We want to support a full AJAX based e-Commerce cart. This means we want to be able to quickly browse products (without having to reload an entire page) and add them to our cart right there on the page (a la Order Made).

The browsing will be AJAX accessing the server for the next products. It should include all sorts of information such as stock left and reductions on quantity, bundles, etc.

The cart itself can be saved in a cookie until the user goes to another page (including the checkout page) or pauses for long enough (the pause is only if the user is registered and logged in so we can save his current cart in his account, anonymous users don't get that benefit.)

This means we want to have the capability to use more than one cookie. This may happen in other circumstances and we want to think about a standard way of managing our client variables to make it easy to parse the contents (i.e. JSON is nice but requires a call to eval() which is not generally safe without heavy security checks.)

Another important aspect of purchases online. With Ubercart (and most other cart systems) an order is created as soon as the user goes to the checkout page (at times, it even happens when a cart is created.) Those have to be sales order numbers and not the actual order or invoice number. If the full checkout process goes through and the payment is processed (although some users may get net 30 by check and you still need an invoice in this case,) then you get an invoice number. This is very simple to do as your order system can simply include multiple numbers (i.e. the list of items in your cart or order are exactly the same thing, therefore you can have one row that defines the cart and a set of rows that define the items in that cart, when you go to the checkout process, the cart number represents the sales order number; once the payment went through you create a new number called the invoice number; voilà.)


The e-Commerce system will emit various signals as it works on various parts. For example, it will signal that a new item was added to the client's cart. This can be used by other plugins to generate additional content, or when a product was marked as paid for, to act on the successful purchase.

Useful e-Commerce Features

The following is a list of features we are planning to add over time to our e-Commerce system:

  • e-Commerce
    • Global Store Information (settings)
      • Name
      • Address
      • Sales Certificate when required
      • Secure Certificate (mandatory for online sales unless only 3rd party payments are used)
      • Allow/forbid sales in different areas (i.e. if your country has an embargo against country X, then you probably want to turn off country X in your cart.)
    • Inline Cart using AJAX to quickly save temporary versions
      • Cart shown inline or in a fixed popup window that can be enlarged to fullscreen
      • Add to Cart [Add is done, quantity and categories to be worked on]
        • Quantity
          • Support for various types of units (count, kg, pounds, length, etc.)
          • Support fractions (you can purchase 3.52 of item) and multiple (you can only get 25, 50, 75, etc.); Note: marking an item as having a multiple of 1 prevents fractions
          • Controls over quantity: minimum, maximum, show warning if more than a given number1
        • Various Categories (color, size, power, etc.) implemented with taxonomies
          • Force the user to select certain categories
          • An advanced cart should also be capable of supporting exclusions (if you have category A-1, you cannot also have category B-3; so you have red ones and large ones, but not red and large at the same time...)
      • View Cart [Done]
      • Empty Cart [Done]
      • Remove Item(s) [Done]
      • Change Quantities
      • View, empty, remove, change quantity using the Cart Query String [Done]
      • Move Item to Wish List (Add to Wish List button)
      • Move With List Item to Cart
        • Let another user purchase items on your wish list
      • Allow administrators to create an invoice for a registered or even a new customer
      • Allow for purchases without an account (like Order Made)
      • Search orders (find orders with item X, customer Y, quantity Z, date Q, etc.)
      • Cart, and checkout settings
    • Cart gets saved on a per user basis, for anonymous users, use a cookie with a long lasting session number
    • By default the cart generates what we see as a quote with a quote number
    • Checkout process (except payment itself), ask user to commit to a payment, if that happens, transfer the cart to a sales order and assign it an invoice number
    • Recurring Payments (this is implemented here since we want an invoice created first then a signal to the payment plugin although the payment plugin is responsible for allowing recurring payments, the cart may have to set a flag to signal that recurring payment will occur)
      • Addition recurring fee(s)
        • Recurring Subscriptions (always same fee, repeats until canceled)
        • Recurring Plan (payment plan, may have varying amounts)
    • Products
      • Name (page title)
      • Description (page body)
      • Images
        • One should be a logo (generally smaller)
        • One should be the main display image
        • Offer a way to name each image (front, rear, top, bottom, etc.)
        • One should be the brand (we want a link to a brand page)
      • Sales Price (price user is being charged)
      • Standard Price (price manufacturer says it should sell as)
      • Offer links that can be used to add the product to the cart without having to send the user to the product page
      • Offer a product which is to purchase a page representing whatever content allowed by your website (Ad, Press Release, Classified, etc.)
      • Offer a product which is to purchase a permission; thus allowing the user to do something on the website that he normally cannot do:
        • Download files; also include a counter so a user cannot download the same file more than a very small number of times (i.e. 3 to 5 times); once the counter reaches zero, the download stops working
      • Product Kit; a way to group products together and sell the kit as one bundle
      • List of products (online catalog)
        • Have a "normal" paged list of products in a specific order (name, price, etc.)
        • Offer a display that makes use of a Pinterest like mechanism with all those product images
        • Implement catalogs in PDF, CSV, ...
        • Support an Import feature
        • Perform transactions on many products at once (i.e. generate a list, then apply a function to all the products in that list)
      • Location (in case you have multiple warehouses)
      • Global settings, per type settings
    • Taxes
      • Implementation to support sales taxes and VAT
      • Allow for tests, for example in the US services do not include taxes, software sold over the internet is also tax free, and goods sent to another state do not include taxes; however, goods sent to the same state require you to pay taxes and that depending on the destination county...
    • Coupons
      • On specific products
      • For a given period, one time use, X per customers, active/inactive
        • We could allow for the system to properly remember each coupon and when one is found but it somehow inactive give a good reason for why it is inactive (i.e. coupon is out of date; coupon not valid yet; coupon was deactivated; coupon already used by you...)
      • With a percent off sale
      • With a total amount off sale
      • With free Shipping/Handling
      • With "free taxes" (we may want to word that as "we pay the sales taxes for you")
      • Includes start and end dates of promotion
      • Use of coupons reports
    • Donate Button
      • Allow for cart donation (pay extra which is sent to a place accepting donations
      • Allow for a product page representing a donation (this is actually a requirement, only by default we may want to hide these from end users and only offer the Donate Button)
    • Tracking sales
      • With external systems such as Google Analytics
      • Reports of sales
      • Reports of attracted customers (visitors, what are they doing? -- i.e. track movements in link with products, cart, checkout, etc.)
      • Reports to help with submitting official documents to various governmental entities (i.e. sales taxes, sales this day, week, month, inventory value...)
  • e-Commerce Marketing and Affiliate
    • Popup offer with otherwise darken background
    • Top/Bottom marketing bar ("high" z-index fixed layer with ad)
    • Various Banners
    • Make all of these options exportable
    • All advertising can support an affiliate reference
    • Affiliate supports multi-level marketing with various payment schemes
  • e-Commerce Fulfillment
    • Offer ways to define the dimensions of articles
    • Offer ways to define the weight of arcticles
    • Query various carriers (USPS, FedEx, UPS, DHL, etc.) for shipping prices
    • Offer the capability for a flat rate shipping
    • Offer a rate based on weight
    • Offer a rate based on volume
    • Offer a way to wave shipping fees when cart value is over a certain amount (but not if it includes item X, Y, Z...)
    • Global settings
  • e-Commerce Inventory
    • Maintain an inventory/stock counter for each product
    • Add necessary interface to enter the stock on a per product basis
    • Offer a SKU# for each item
    • Signal administrator when stock gets low
    • Prevent purchase of items that are out of stock
    • Allow for pre-purchase/order of future items
    • Offer to display the number of items in stock to the end user; within limits (i.e. if more than X items, then you may want to limit the count to something like 100+)
    • Report about various parameters, especially counters, sales prices, and taxes; the report with counters can be useful to verify that the stock is up to date
    • Various controls over restocking (impose limits, reports, per location details, etc.)
    • Global settings
  • e-Commerce Serial Number (Inventory Extension)
    • Adds a Serial Number field to the products
    • Show the Serial Number in the cart, invoice, and inventory
    • Verify that two products never get the same serial number
  • e-Commerce Payment
    • Offer various means of payments and corresponding gateway implementations
    • Payment received signal
    • Allow payment using multiple means of payments (i.e. 50% Paypal and 50% credit card...)
    • Refunds
    • Test/Debug Mode
    • Global settings

Available 3rd Party Resources

A website to get the name of a city based on the user IP address is from:


Which offers a free library under Linux named libgeoip, so we can directly use that from our server without having to query another server or compile our own version of the library. (i.e. do apt-get install libgeoip-dev to install the development version.)

A company offering freight using any one shipping company as will best ensure your shipment to reach its destination in a timely manner or inexpensively:



See also: AJAX feature (Inline Editing) [core]

  • 1. Most of our software can be purchased any number of times, however, it is really unlikely that anyone would even need to purchase more than one license. So we want to show a warning if the quantity is more than 1.

Snap! Websites
An Open Source CMS System in C++

Contact Us Directly