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!
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!
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
Of course you will have to play with the returned data ($total->fields['count']) to have it displayed the way you want.PHP Code:$total = $db->Execute("SELECT COUNT(*) as count FROM ".TABLE_PRODUCTS);
echo $total->fields['count'];
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
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
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'];
?>
Yes, my php is rusty.
Here is what I have:
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'];
?>
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'];
?>
Where have you put this code?
Mods: Admin Activity Report || PO Box Ban || Empty Cart Manager || Autoresponder+ || Zip Validator || Desktop Data || SRiC
I put this code in:
/includes/languages/english/html_includes/define_editable_sidebox_content.php
Mods: Admin Activity Report || PO Box Ban || Empty Cart Manager || Autoresponder+ || Zip Validator || Desktop Data || SRiC
Thank you!!