Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How do I get a list of my products on paper?


wolvrinez

Recommended Posts

You can try this script I call "inventory.php":

 

<head>
<script Language="Javascript">
function printit(){  
if (window.print) {
   window.print();  
} else {
   var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
   WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = "";  
}
}
</script>

<script Language="Javascript">  
var NS = (navigator.appName == "Netscape");
var VERSION = parseInt(navigator.appVersion);
if (VERSION > 3) {
   document.write('<form><input type=button value="Print this Page" name="Print" onClick="printit()"></form>');        
}
</script>
</head>
<B>INVENTORY<br><br></b>
<?php
require('includes/application_top.php');
//$product_query = tep_db_query("select pd.products_name, pd.products_id, p.products_id, p.products_model, p.products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
$product_query = tep_db_query("select pd.products_name, pd.products_id, p.products_id, p.products_model, p.products_price, p.products_quantity from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
while ($product = tep_db_fetch_array($product_query)) {
echo 'Model: ' . $product['products_model'] . '<br>' .
     'Name: ' . $product['products_name'] . '<br>' .
     'Quantity: ' . $product['products_quantity'] . '<br>' . 
     'Price:<b> $' . $product['products_price'] . '</b><br><br>';
     }
?>

 

It will give you:

Model: (Item Number)

Name: (Product Name)

Quantity: (In Stock)

Price: ($nnn.nn)

 

With a [PRINT] Button at the top.

 

I didn't write the script, I had a lot of help from Jack_mcs, all I did was add the Print button.

 

Bob G.

Installed Contributions: CCGV, Close Popup, Dynamic Meta Tags, Easy Populate, Froogle Data Feeder, Google Position, Infobox Header Entire Row, Live Support for OSC, PayPal Seal with CC images, Report_m Sales, Shop by Price Revised, SQL Updater, Who's Online Enhancement, Footer, GNA EP Assistant and still going.

Link to comment
Share on other sites

Kool, glad it worked for you. Something I forgot to add in the comments before. If you want to create a list to print lables, change this:

 

$product_query = tep_db_query("select pd.products_name, pd.products_id, p.products_id, p.products_model, p.products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
//$product_query = tep_db_query("select pd.products_name, pd.products_id, p.products_id, p.products_model, p.products_price, p.products_quantity from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");

 

And it will drop the Quantity field, just copy/paste to your label maker program and get to printing.

Installed Contributions: CCGV, Close Popup, Dynamic Meta Tags, Easy Populate, Froogle Data Feeder, Google Position, Infobox Header Entire Row, Live Support for OSC, PayPal Seal with CC images, Report_m Sales, Shop by Price Revised, SQL Updater, Who's Online Enhancement, Footer, GNA EP Assistant and still going.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...