Results 1 to 10 of 10
  1. #1
    Join Date
    Apr 2009
    Posts
    18
    Plugin Contributions
    0

    Default Sidebox that shows how many products are in inventory?

    1.3.8 Does anyone know of a sidebox add on that will show the total number of products that are currently in the inventory? (I don't mean the total number of units, but just the total number of products. Thanks!

  2. #2
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Sidebox that shows how many products are in inventory?

    I dont think there is, but it's a simple sql query anyhow. You can use the blank sidebox add on, then use a simple sql query to get total of products

    Something like this

    PHP Code:
    $total $db->Execute("SELECT COUNT(*) as count FROM ".TABLE_PRODUCTS);
    echo 
    $total->fields['count']; 
    Of course you will have to play with the returned data ($total->fields['count']) to have it displayed the way you want.
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  3. #3
    Join Date
    Apr 2009
    Posts
    18
    Plugin Contributions
    0

    Default Re: Sidebox that shows how many products are in inventory?

    Thanks...I am messing around with the coding from the define_editable_sidebox_content.php I am missing something though because the sidebox isn't calling the total number of products (http://whoojaflikit.com on the top right)

    Total Coupons at W.I.C.K.S.:
    <?php
    /**
    * Side Box Template
    *
    * @package templateSystem
    * copyright W.I.C.K.S. W/Zen Help from yellow1912
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version $Id: tpl_banner_box.php 2982 2006-02-07 07:56:41Z birdbrain $
    */
    // if no active banner in the specified banner group then the box will not show
    $total = $db->Execute("SELECT COUNT(*) as count FROM ".TABLE_PRODUCTS);
    echo $total->fields['count']
    }

    ?>

    <?php

  4. #4
    Join Date
    Apr 2009
    Posts
    18
    Plugin Contributions
    0

    Default Re: Sidebox that shows how many products are in inventory?

    Okay.....wrong file. I am changing it in /includes/modules/sideboxes/editable_sidebox.php but it is going in below the box.

    <?php
    /**
    * editable sidebox - allows an admin-editable sidebox to be added to your site
    *
    * @package templateSystem
    * @copyright 2007 Kuroi Web Design
    * @copyright Portions Copyright 2003-2007 Zen Cart Development Team
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version $Id: blank_sidebox.php 2007-08-10 kuroi $
    */

    // test if box should display
    $show_editable_sidebox = true;

    $define_sidebox = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . '/html_includes/', DEFINE_EDITABLE_SIDEBOX_NAME, 'false');

    if ($show_editable_sidebox == true) {
    require($template->get_template_dir('tpl_editable_sidebox.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_editable_sidebox.php');
    $title = BOX_HEADING_EDITABLE_SIDEBOX;
    $title_link = false;
    require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
    }
    $total = $db->Execute("SELECT COUNT(*) as count FROM ".TABLE_PRODUCTS);
    echo $total->fields['count'];
    ?>

  5. #5
    Join Date
    Apr 2009
    Posts
    18
    Plugin Contributions
    0

    Default Re: Sidebox that shows how many products are in inventory?

    Yes, my php is rusty.

    Here is what I have:

    Total Types of coupons at W.I.C.K.S.-
    <?php
    $total = $db->Execute("SELECT COUNT(*) as count FROM ".TABLE_PRODUCTS);
    echo $total->fields['count'];
    ?>
    What am I missing?

  6. #6
    Join Date
    Apr 2009
    Posts
    18
    Plugin Contributions
    0

    Default Developer to Developer Again

    1.3.8a

    The following contributions installed:

    forum (phpbb3)
    crafty_syntax
    extra_sidebox
    easypopulate
    payaplverified
    site trust


    I posted this elsewhere, but I think it would go here better. My php is still rusty and so this code is showing up exactly like it is typed. What am I missing?

    Total Types of coupons at W.I.C.K.S.-
    <?php
    $total = $db->Execute("SELECT COUNT(*) as count FROM ".TABLE_PRODUCTS);
    echo $total->fields['count'];
    ?>

  7. #7
    Join Date
    Jan 2008
    Posts
    1,700
    Plugin Contributions
    6

    Default Re: Developer to Developer Again

    Where have you put this code?

  8. #8
    Join Date
    Apr 2009
    Posts
    18
    Plugin Contributions
    0

    Default Re: Developer to Developer Again

    I put this code in:

    /includes/languages/english/html_includes/define_editable_sidebox_content.php

  9. #9
    Join Date
    Jan 2008
    Posts
    1,700
    Plugin Contributions
    6

  10. #10
    Join Date
    Apr 2009
    Posts
    18
    Plugin Contributions
    0

    Default Re: Developer to Developer Again

    Thank you!!

 

 

Similar Threads

  1. Who's Online shows that my customers are on /images/
    By mugshot in forum General Questions
    Replies: 1
    Last Post: 19 Dec 2009, 01:56 PM
  2. How to delete products that are theme examples?
    By sheila123 in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 4 Mar 2009, 09:03 AM
  3. Hiding number next to Category that shows how many products are there?
    By stlnyc in forum Customization from the Admin
    Replies: 4
    Last Post: 1 Nov 2008, 06:25 PM
  4. Replies: 2
    Last Post: 27 Dec 2007, 05:30 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