product bought

Product Bought Within and Product Bought

A Zen Cart™ module to permit you to determine if a logged in customer has purchased a product before (ever or within a specific date range).

Relevance: Zen Cart™ 1.3.9, 1.5.x

Current Version: 1.0

Support Thread: My commercial software is not supported on the Zen Cart forum. Please email me questions instead.

Cost: $15.00 Buy Now! (Note: this low price covers software only for self-installation.)

Would you like to ask me questions before buying? No problem! Just email your inquiry to . Please be sure to include your cart type and version (e.g. Zen Cart 1.5.1) and the mod you want to buy.

Installed Cost: $75.00 (Professional installation by That Software Guy)

Installation Difficulty: Moderate - requires template changes

Installation Instructions: click here

Buy: Buy Product Bought Within! Or email your pre-purchase question to .

Video: You may watch Product Bought Before in action in this video:




Overview:

Product Bought is a function you can call to determine if the currently logged in customer has ever purchased a particular item. Product Bought Within offers the same functionality, but with the additional check that the purchase have been made within a particular number of days, weeks or months. Customers must be logged in for these functions to work.

Both functions are included in the download.

These functions may be used on any page in Zen Cart. Common uses would be checking for a past product purchase on the product info page or shopping cart page, and doing cross-selling there.

Installation Instructions:

  1. Back up everything! Try this in a test environment prior to installing it on a live shop.
  2. Unzip the file you have received.
  3. 2. Copy the files below to your cart's root directory.
  4. 3. Run the script
    pb.sql
    
    against your database using PHPMyAdmin. If your database tables have a prefix, update this script accordingly. For example, if the value DB_PREFIX from includes/configure.php is 'zen_', change "orders" to "zen_orders" in pb.sql (Note: You cannot use Admin->Tools->Install SQL patches to run this; you must use PHPMyAdmin.)
  5. For product bought : Modify your cart template files to use product_bought. For example, to display a message if product 13 has been purchased before, use
    <?php 
    if (product_bought(13)) { 
       echo "some message"; 
    }
    ?>
    
  6. For product bought within: Modify your cart template files to use product_bought_within. This function takes the following parameters:
         product id - integer 
         lookback units - string ('D' - Days, 'W' - weeks, 'M' - months)
         lookback quantity - integer 
    
    For example, to display a message if product 13 has been purchased in the last 10 days, use
    <?php 
    if (product_bought_within(13, 'D', 10)) { 
       echo "some message"; 
    }
    ?>
    
    Checking for the last 5 weeks would be
    <?php 
    if (product_bought_within(13, 'W', 5)) { 
    ...
    
    Checking for the last 12 months would be
    <?php 
    if (product_bought_within(13, 'M', 12)) { 
    

    Major Versions

    • 1.0 03/05/2016 - First Release

    I charge a fee of $15 for Product Bought Within and Product Bought. Buy Now!.
    The fee covers software only; installation is extra if you require help.