Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2009
    Posts
    49
    Plugin Contributions
    0

    Default Number Sold Counter

    Anyone ever seen any kind of plugin that shows the quantity sold of an item? My client is confident he's going to sell a ton, and wants people to see how many he has sold. I figure I'll be fudging an odometer style java plugin, but just curious if there's anything else out there... Thanks!

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Number Sold Counter

    You can use the function zen_products_lookup

    Example from the product _info page you can 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 ...

    This function can be adapted to anywhere ...

    If you want to save time, you could put that in the display price function and add it on to the end of the return value and it would be added to anywhere the display price is shown with the function zen_get_products_display_price in the file:
    /includes/functions/functions_prices.php
    Last edited by Ajeh; 20 Aug 2010 at 04:14 PM. Reason: fix typo
    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!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

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

    Default Re: Number Sold Counter (Clarification Requested)

    Newbie here...
    In your reply to the above Thread, you stated
    Example from the product _info page you can 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 ...
    I used the Developer's Toolkit to search for several of the items in your reply to no avail. Would you please clarify which files and their locations need to be edited?

    Thanks.
    Last edited by Ajeh; 20 Aug 2010 at 04:15 PM. Reason: fixed typo

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Number Sold Counter

    If I run the code from the file:
    tpl_product_info_display.php

    Code:
    $chk_products_ordered = zen_products_lookup((int)$_GET['products_id'], 'products_ordered');
    I can add somewhere in that file:
    Code:
    <?php echo 'Number Sold: ' . $chk_products_ordered; ?>

    You can also look in the file:
    /includes/functions/functions_prices.php

    and find where the display price for everywhere is built in the:
    function zen_get_products_display_price

    using the same idea, you can use the code:
    $chk_products_ordered = zen_products_lookup((int)$products_id, 'products_ordered');

    and add on the return values the:
    'Number Sold: ' . $chk_products_ordered

    Example:
    Code:
        return $final_display_price . $free_tag . $call_tag;
    could be:
    Code:
        return $final_display_price . $free_tag . $call_tag . '<br />Number Sold: ' . $chk_products_ordered;
    and now all prices will display with:
    Number Sold: ##
    Last edited by Ajeh; 20 Aug 2010 at 04:16 PM. Reason: fixed typo
    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!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,701
    Plugin Contributions
    11

    Default Re: Number Sold Counter

    There's also a new mod in submission for this. Haven't tried it yet. http://www.zen-cart.com/forum/showthread.php?t=162191
    A little help with colors.
    myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
    Free SSL & Domain with semi-annual and longer hosting. Updating 1.5.2 and Up.

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

    Default Re: Number Sold Counter

    Thanks in large gobs for your help!
    This is an incredible help forum. You inspire others to pay-it-forward.

    Gracias...

  7. #7
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Number Sold Counter

    I fixed a typo in the posts above ...

    The use of:
    (int)$_GET('products_id']

    should of been:
    (int)$_GET['products_id']
    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!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 

Similar Threads

  1. v139h Show number of units sold next to product names in categories
    By Chargin in forum All Other Contributions/Addons
    Replies: 16
    Last Post: 12 May 2015, 02:30 AM
  2. Visible Counter of Product Sold
    By jmp01 in forum General Questions
    Replies: 4
    Last Post: 20 Aug 2010, 04:14 PM
  3. How can I change the "Order Number" counter?
    By mkalavitz in forum General Questions
    Replies: 3
    Last Post: 10 Feb 2010, 06:00 AM
  4. Replies: 0
    Last Post: 22 Jun 2009, 06:06 AM
  5. Finnish referal number counter
    By Paradise in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 23 Jul 2006, 03:24 PM

Posting Permissions

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