Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2009
    Location
    Citrus Heights CA
    Posts
    12
    Plugin Contributions
    0

    Default Visible Counter of Product Sold

    Newbie...
    I'd like to set up a counter for each item sold, so that I can display it anywhere on the site. I have tried:

    <?php
    $products = $db->Execute("select count(*) as count from " . TABLE_PRODUCTS . " where products_ordered > '0'");
    define('PRODUCTS','The total number sold so far is ');

    echo '<div class="row"><span class="left">' . PRODUCTS . ' </span><span class="right">' . $products->fields['count'] . '</span></div>';
    ?>

    But this counter gets stuck at "1"

    Any ideas?

  2. #2

    Default Re: Visible Counter of Product Sold

    you could use

    $chk_products_ordered = zen_products_lookup((int)$_GET('products_id'], 'products_ordered');

    Then echo the $chk_products_ordered where you want to display it ...

  3. #3
    Join Date
    Feb 2009
    Location
    Citrus Heights CA
    Posts
    12
    Plugin Contributions
    0

    Default Re: Visible Counter of Product Sold

    OK... so here is the script that I inserted into my main page:

    <?php
    $chk_products_ordered =zen_products_lookup((int)$_GET('products_id'], 'products_ordered');
    echo '<div class="row"><span class="left">' . $chk_products_ordered . ' </span><span class="right">' . $products->fields['count'] . '</span></div>';
    ?>

    The Page is coming up blank...
    Que` Pasa?

  4. #4

    Default Re: Visible Counter of Product Sold

    i just added a new contribution, try this:


    http://www.zen-cart.com/forum/showthread.php?t=162191

  5. #5
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,886
    Plugin Contributions
    6

    Default Re: Visible Counter of Product Sold

    Try this instead:
    <?php
    define('TEXT_QTY_SOLD', 'Number Sold: ');
    $chk_products_ordered = zen_products_lookup((int)$_GET['products_id'], 'products_ordered');
    echo '<div class="row"><span class="left">' . TEXT_QTY_SOLD . $chk_products_ordered . '</span></div>';
    ?>
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

 

 

Similar Threads

  1. Number Sold Counter
    By igendreau in forum All Other Contributions/Addons
    Replies: 6
    Last Post: 20 Aug 2010, 04:17 PM
  2. Replies: 1
    Last Post: 22 Aug 2006, 05:06 PM

Bookmarks

Posting Permissions

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