Forums / General Questions / Sidebox that shows how many products are in inventory?

Sidebox that shows how many products are in inventory?

Locked

Views: 1,250

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
12 Apr 2009, 3:44 PM
#1
wicks avatar

wicks

New Zenner

Join Date:
Apr 2009
Posts:
13
Plugin Contributions:
0

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!

12 Apr 2009, 5:27 PM
#2
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

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

$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

12 Apr 2009, 6:09 PM
#3
wicks avatar

wicks

New Zenner

Join Date:
Apr 2009
Posts:
13
Plugin Contributions:
0

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
12 Apr 2009, 6:21 PM
#4
wicks avatar

wicks

New Zenner

Join Date:
Apr 2009
Posts:
13
Plugin Contributions:
0

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']; ?>
12 Apr 2009, 7:35 PM
#5
wicks avatar

wicks

New Zenner

Join Date:
Apr 2009
Posts:
13
Plugin Contributions:
0

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?

12 Apr 2009, 8:06 PM
#6
wicks avatar

wicks

New Zenner

Join Date:
Apr 2009
Posts:
13
Plugin Contributions:
0

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

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']; ?>
12 Apr 2009, 8:52 PM
#8
wicks avatar

wicks

New Zenner

Join Date:
Apr 2009
Posts:
13
Plugin Contributions:
0

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

I put this code in:

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

12 Apr 2009, 9:32 PM
#10
wicks avatar

wicks

New Zenner

Join Date:
Apr 2009
Posts:
13
Plugin Contributions:
0

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

Thank you!!