Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] QTpro - Quantity Tracking Professional


zonetown

Recommended Posts

Hi

 

Has any one used this mod where a product has different barcodes. Using the example often mentioned above, a tshirt comes in different sizes and different colors. Thus has a seperate barcode associated with it.

 

I guess you could add these in as an atribute but I can see this quickly getting out of hand (given the volume and ease of making mistakes). I imagine a better way would be to create the product with size and color, and then where you add the quantity, also add the barcode there.

 

Any thoughts?

 

Wired

 

Ok, been working on this and have got as far as the following:

 

1. Created additional column

 

ALTER TABLE products_stock

ADD products_stock_barcode int(11) default '0' not null ,

AFTER products_options_quantity;

 

2. Edited admin/stock.php code to

 

<?php

/*

QT Pro Version 4.1

 

stock.php

 

Contribution extension to:

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2004, 2005 Ralph Day

Released under the GNU General Public License

 

Based on prior works released under the GNU General Public License:

QT Pro prior versions

Ralph Day, October 2004

Tom Wojcik aka TomThumb 2004/07/03 based on work by Michael Coffman aka coffman

FREEZEHELL - 08/11/2003 [email protected] Copyright © 2003 IBWO

Joseph Shain, January 2003

osCommerce MS2

Copyright © 2003 osCommerce

 

Modifications made:

11/2004 - Add input validation

clean up register globals off problems

use table name constant for products_stock instead of hard coded table name

03/2005 - Change $_SERVER to $HTTP_SERVER_VARS for compatibility with older php versions

 

********************************************************************************

***********

 

QT Pro Stock Add/Update

 

This is a page to that is linked from the osCommerce admin categories page when an

item is selected. It displays a products attributes stock and allows it to be updated.

 

********************************************************************************

***********

 

$Id: stock.php,v 1.00 2003/08/11 14:40:27 IBWO Exp $

 

Enhancement module for osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Credit goes to original QTPRO developer.

Attributes Inventory - FREEZEHELL - 08/11/2003 [email protected]

Copyright © 2003 IBWO

 

Released under the GNU General Public License

*/

require('includes/application_top.php');

 

if ($HTTP_SERVER_VARS['REQUEST_METHOD']=="GET") {

$VARS=$_GET;

} else {

$VARS=$_POST;

}

if ($VARS['action']=="Add") {

$inputok = true;

if (!(is_numeric($VARS['product_id']) and ($VARS['product_id']==(int)$VARS['product_id']))) $inputok = false;

while(list($v1,$v2)=each($VARS)) {

if (preg_match("/^option(\d+)$/",$v1,$m1)) {

if (is_numeric($v2) and ($v2==(int)$v2)) $val_array[]=$m1[1]."-".$v2;

else $inputok = false;

}

}

if (!(is_numeric($VARS['quantity']) and ($VARS['quantity']==(int)$VARS['quantity']))) $inputok = false;

 

if (($inputok)) {

sort($val_array, SORT_NUMERIC);

$val=join(",",$val_array);

$q=tep_db_query("select products_stock_id as stock_id from " . TABLE_PRODUCTS_STOCK . " where products_id=" . (int)$VARS['product_id'] . " and products_stock_attributes='" . $val . "' order by products_stock_attributes");

if (tep_db_num_rows($q)>0) {

$stock_item=tep_db_fetch_array($q);

$stock_id=$stock_item[stock_id];

if ($VARS['quantity']=intval($VARS['quantity'])) {

tep_db_query("update " . TABLE_PRODUCTS_STOCK . " set products_stock_quantity=" . (int)$VARS['quantity'] . " where products_stock_id=$stock_id");

tep_db_query("update " . TABLE_PRODUCTS_STOCK . " set products_stock_barcode=" . (int)$VARS['barcode'] . " where products_stock_id=$stock_id");

} else {

tep_db_query("delete from " . TABLE_PRODUCTS_STOCK . " where products_stock_id=$stock_id");

}

} else {

tep_db_query("insert into " . TABLE_PRODUCTS_STOCK . " values (0," . (int)$VARS['product_id'] . ",'$val'," . (int)$VARS['quantity'] . ")");

}

$q=tep_db_query("select sum(products_stock_quantity) as summa from " . TABLE_PRODUCTS_STOCK . " where products_id=" . (int)$VARS['product_id'] . " and products_stock_quantity>0");

$list=tep_db_fetch_array($q);

$summa= (empty($list[summa])) ? 0 : $list[summa];

tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity=$summa where products_id=" . (int)$VARS['product_id']);

if (($summa<1) && (STOCK_ALLOW_CHECKOUT == 'false')) {

tep_db_query("update " . TABLE_PRODUCTS . " set products_status='0' where products_id=" . (int)$VARS['product_id']);

}

}

}

if ($VARS['action']=="Update") {

tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity=" . (int)$VARS['quantity'] . " where products_id=" . (int)$VARS['product_id']);

if (($VARS['quantity']<1) && (STOCK_ALLOW_CHECKOUT == 'false')) {

tep_db_query("update " . TABLE_PRODUCTS . " set products_status='0' where products_id=" . (int)$VARS['product_id']);

}

}

if ($VARS['action']=="Apply to all") {

 

}

$q=tep_db_query($sql="select products_name,products_options_name as _option,products_attributes.options_id as _option_id,products_options_values_name as _value,products_attributes.options_values_id as _value_id from ".

"products_description, products_attributes,products_options,products_options_values where ".

"products_attributes.products_id=products_description.products_id and ".

"products_attributes.products_id=" . (int)$VARS['product_id'] . " and ".

"products_attributes.options_id=products_options.products_options_id and ".

"products_attributes.options_values_id=products_options_values.products_opti

ons_values_id and ".

"products_description.language_id=" . (int)$languages_id . " and ".

"products_options_values.language_id=" . (int)$languages_id . " and products_options.products_options_track_stock=1 and ".

"products_options.language_id=" . (int)$languages_id . " order by products_attributes.options_id, products_attributes.options_values_id");

//list($product_name,$option_name,$option_id,$value,$value_id)

if (tep_db_num_rows($q)>0) {

$flag=1;

while($list=tep_db_fetch_array($q)) {

$options[$list[_option_id]][]=array($list[_value],$list[_value_id]);

$option_names[$list[_option_id]]=$list[_option];

$product_name=$list[products_name];

}

} else {

$flag=0;

$q=tep_db_query("select products_quantity,products_name from " . TABLE_PRODUCTS . " p,products_description pd where pd.products_id=" . (int)$VARS['product_id'] . " and p.products_id=" . (int)$VARS['product_id']);

$list=tep_db_fetch_array($q);

$db_quantity=$list[products_quantity];

$product_name=stripslashes($list[products_name]);

}

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<title><?php echo TITLE; ?></title>

<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

 

<!-- body //-->

<table border="0" width="100%" cellspacing="2" cellpadding="2">

<tr>

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

</table></td>

<!-- body_text //-->

<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td class="pageHeading"><?php echo PRODUCTS_STOCK.": $product_name"; ?></td>

<td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

</tr>

</table></td>

</tr>

<tr>

<td><form action="<? echo $PHP_SELF;?>" method=get>

<table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">

 

<tr class="dataTableHeadingRow">

<?php

$title_num=1;

if ($flag) {

while(list($k,$v)=each($options)) {

echo "<td class=\"dataTableHeadingContent\">  $option_names[$k]</td>";

$title[$title_num]=$k;

}

echo "<td class=\"dataTableHeadingContent\"><span class=smalltext>Quantity</span></td>";

echo "<td class=\"dataTableHeadingContent\"><span class=smalltext>Barcode</span></td><td width=\"100%\"> </td>";

echo "</tr>";

$q=tep_db_query("select * from " . TABLE_PRODUCTS_STOCK . " where products_id=" . $VARS['product_id'] . " order by products_stock_attributes");

while($rec=tep_db_fetch_array($q)) {

$val_array=explode(",",$rec[products_stock_attributes]);

echo "<tr>";

foreach($val_array as $val) {

if (preg_match("/^(\d+)-(\d+)$/",$val,$m1)) {

echo "<td class=smalltext>   ".tep_values_name($m1[2])."</td>";

} else {

echo "<td> </td>";

}

}

for($i=0;$i<sizeof($options)-sizeof($val_array);$i++) {

echo "<td> </td>";

}

echo "<td class=smalltext>    $rec[products_stock_quantity]</td>";

echo "<td class=smalltext>    $rec[products_stock_barcode]</td><td> </td>";

}

echo "<tr>";

reset($options);

$i=0;

while(list($k,$v)=each($options)) {

echo "<td class=dataTableHeadingRow><select name=option$k>";

foreach($v as $v1) {

echo "<option value=".$v1[1].">".$v1[0];

}

echo "</select></td>";

$i++;

}

} else {

$i=1;

echo "<td class=dataTableHeadingContent>Quantity</td>";

echo "<td class=dataTableHeadingContent>Barcode</td>";

}

echo "<td class=dataTableHeadingRow><input type=text name=quantity size=4 value=\"" . $db_quantity . "\"><input type=hidden name=product_id value=\"" . $VARS['product_id'] . "\"> </td>";

echo "<td class=dataTableHeadingRow><input type=text name=barcode size=4 value=\"" . $db_barcode . "\"><input type=hidden name=product_id value=\"" . $VARS['product_id'] . "\"> </td><td width=\"100%\" class=dataTableHeadingRow> <input type=submit name=action value=" . ($flag?"Add":"Update") . "> </td><td width=\"100%\" class=dataTableHeadingRow> </td>";

?>

 

</tr>

</table></td>

</tr>

</table>

</form></td>

</tr>

<tr><td><br>

<?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, '', 'NONSSL') . '" class="menuBoxContentLink">Back to Products Category</a>    <a href="' . tep_href_link(FILENAME_STATS_LOW_STOCK_ATTRIB, '', 'NONSSL') . '" class="menuBoxContentLink">Back to Low Stock Report for Attributes</a>';?>

</td></tr>

</table></td>

 

<!-- body_text_eof //-->

</tr>

</table>

<!-- body_eof //-->

 

<!-- footer //-->

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

<br>

</body>

</html>

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

I can add both stock and a number in the barcode field and these are saved and displayed.

 

But, if i type a 13 number barcode in, the result always shows as '2147483647'.

 

Also, if I place an order from the store, the order goes through fine but does not decrement the stock.

 

Appreciate any expert eyes!!

 

W

Link to comment
Share on other sites

Ok, think i have an answer on the second part. If I add stock and a barcode (subject to being below 2147483647!!!) and then come out of the stock admin section, then place an order, it decrements the stock. It just does not (always) decrement the stock if you keep the stock admin page open.

 

Not sure I am happy with that as it does not seem very robust, but it does work.

 

Just got to figure out the 2147483647 problem now.

 

W

Link to comment
Share on other sites

Hey guys... I didn't like the way the admin/product_attributes.php page was displaying. So i've done a handful of reformatting, offering "tabs" for - options/values/attributes... however I'm running into some complications with the insert/edit/delete buttons... if anyone is interested in checking out what I've done and assisting in the remaining problems, shoot me a message and I'll send ya what I got. I really think it will make using this contrib a lot easier...

 

-DeathAdder (Steve)

Link to comment
Share on other sites

been struggling to get qtpro to update stock on completed orders, is there a typo where a reference to an update is in capitals? Should it be in lower case?

 

Realised I need to copy the qtpro modifications from checkout_process.php to checkout_nochex.php...

 

This probably isn't a qtpro thing but I have a 'vanilla + qtpro' store with reference to 'orders_status' => $order->info['order_status'], where the same line on the checkout_nochex file is 'orders_status' => 50000, anyone point me in the right direction for why that is and which I should leave??

 

and does anyone know why this:

 

	 if (is_array($products_attributes)) {
	  $stock_query_raw .= " AND pa.options_id = '" . $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[0]['value_id'] . "'";
	}
	$stock_query = tep_db_query($stock_query_raw);
  } else {
	$stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
  }
  if (tep_db_num_rows($stock_query) > 0) {
	$stock_values = tep_db_fetch_array($stock_query);

 

is different to this:

 

	 if (is_array($products_attributes)) {
	$stock_query_raw .= " AND pa.options_id = '" . $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[0]['value_id'] . "'";
  }
  $stock_query = tep_db_query($stock_query_raw);
  if (tep_db_num_rows($stock_query) > 0) {
	$stock_values = tep_db_fetch_array($stock_query);

 

I realise that might be a nochex apn contribution question but it's not marked as a change either with qtpro or nochex, is it a oscommerce version difference? Does it matter for the purposes of qtpro??!!

Link to comment
Share on other sites

The answer to the question about that bit of code was that yes it does matter because it comes up with a parse error unexpected T_ELSE error, lol.

 

Nochex and cheque now working fine, not sure about paypal... sandbox looks like a big fat no... time to re-read the forum I guess...

Link to comment
Share on other sites

Installation of More Pics 6 v1.2 and Product Listing in Columns 2.1

 

Has any one sucessfully added in the above when using QTPro. I have had a few instances where there seems some over lap which I am struggling with. Main problem file is catalog/includes/application_top.

 

Within the More Pics, I find it forces the review and buy now buttons to the bottom left under column_left. With Product Listing in Columns, I find that when I click a prodcut to bring the specifics up, and then buy now, two products go into the cart.

 

I have posted similar queries on the respective contribs so all people are aware of this in case they had not noticed the problems.

 

Thanks for info

 

W

Link to comment
Share on other sites

To answer the part about two products going into the cart when clicking from the product page, I had an additional add to cart:

 

// customer adds a product from the products page

case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {

$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);

 

That was the original code, the $cart->add_cart($... also appeared a few lines down in the new QTPro code.

 

So, just need to resolve the image part but think I can now say it has nothing to do with QTPro. :)

 

W

 

Installation of More Pics 6 v1.2 and Product Listing in Columns 2.1

 

Has any one sucessfully added in the above when using QTPro. I have had a few instances where there seems some over lap which I am struggling with. Main problem file is catalog/includes/application_top.

 

Within the More Pics, I find it forces the review and buy now buttons to the bottom left under column_left. With Product Listing in Columns, I find that when I click a prodcut to bring the specifics up, and then buy now, two products go into the cart.

 

I have posted similar queries on the respective contribs so all people are aware of this in case they had not noticed the problems.

 

Thanks for info

 

W

Edited by Wired PSF
Link to comment
Share on other sites

Can anyone tell me which tables have to be created because it seems that the tables are still missing in my database..

 

for instance i get this error:

 

1054 - Unknown column 'popt.products_options_track_stock' in 'field list'

 

select popt.products_options_name, popt.products_options_track_stock, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from products_options popt, products_options_values poval, products_attributes pa where pa.products_id = '2{3}6{4}3' and pa.options_id = '3' and pa.options_id = popt.products_options_id and pa.options_values_id = '6' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '2' and poval.language_id = '2'

Link to comment
Share on other sites

Hello,

 

I just got done installing this contribution, everything in admin seems to working properly, but as for the catalog side, when you go to the product info page it looks like this....has a big blank area about the product and also removed the buttons below....if anyone could help I would greatly appreciate it..

Untitled-2.jpg

Link to comment
Share on other sites

It also seems that when I add an attribute, it puts double, also pushes the right column down under the left column. It also does not allow me to switch between multiple, single, radio, etc..I do have Attribute copier/sorter installed..here is my code on products info hopefully you all can see something I do not...

<?php
/*
 $Id: product_info.php,v 1.98 2003/09/02 18:52:33 project3000 Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);

 $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
 $product_check = tep_db_fetch_array($product_check_query);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<?php
// BOF: WebMakers.com Changed: Header Tag Controller v2.5.2
// Replaced by header_tags.php
if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
 require(DIR_WS_INCLUDES . 'header_tags.php');
} else {
?> 
 <title><?php echo TITLE; ?></title>
<?php
}
// EOF: WebMakers.com Changed: Header Tag Controller v2.5.2
?>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script language="javascript"><!--
function popupWindow(url) {
 window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res
izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le
ft=150')
}
//--></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
<td width="<?php echo BOX_WIDTH_LEFT_IS; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH_LEFT_IS; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
<?php
 if ($product_check['total'] < 1) {
?>
  <tr>
	<td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
<?php
 } else {
if (!tep_session_is_registered('recently_viewed'))
	{
	tep_session_register('recently_viewed');
	$recently_viewed = $HTTP_GET_VARS['products_id'] . ';';
	//$recently_viewed = "";
	}
$check_not_duplicate = $HTTP_GET_VARS['products_id'];
$temp_recent = $recently_viewed;
if (!ereg($check_not_duplicate, $temp_recent ) )
$recently_viewed = $HTTP_GET_VARS['products_id'] . ';' . $recently_viewed;
// BOF MaxiDVD: Modified For Ultimate Images Pack!
$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_image_med, p.products_image_lrg, p.products_image_sm_1, p.products_image_xl_1, p.products_image_sm_2, p.products_image_xl_2, p.products_image_sm_3, p.products_image_xl_3, p.products_image_sm_4, p.products_image_xl_4, p.products_image_sm_5, p.products_image_xl_5, p.products_image_sm_6, p.products_image_xl_6, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
// EOF MaxiDVD: Modified For Ultimate Images Pack!
$product_info = tep_db_fetch_array($product_info_query);

tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
  $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
} else {
  $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
}

if (tep_not_null($product_info['products_model'])) {
  $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';
} else {
  $products_name = $product_info['products_name'];
}
?>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<?php
// BOF: WebMakers.com Added: Show Category and Image
if (SHOW_CATEGORIES=='1') {
?>
	  <tr><td colspan="2"><table align="right">
		<tr>
		  <td class="main" align="center"><?php echo tep_image(DIR_WS_IMAGES . tep_get_categories_image(tep_get_products_catagory_id($product_info_values['products_id']))); ?></td>
		</tr>
		<tr>
		  <td class="main" align="center"><?php echo tep_get_categories_name(tep_get_products_catagory_id($product_info_values['products_id'])); ?></td>
		</tr>
	  </table></td></tr>
<?php
}
// EOF: WebMakers.com Added: Show Category and Image
?>
	  <tr>
		<td class="pageHeading" valign="top"><?php echo $products_name; ?></td>
		<td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td class="main">


<?php
if (tep_not_null($product_info['products_image'])) {
//++++ QT Pro: Begin Changed code
?>
	  <table border="0" width="100%" cellspacing="0" cellpadding="2">
		<tr>
		  <td class="smallText">
<?php
//++++ QT Pro: End Changed Code
?>
	  <table border="0" cellspacing="0" cellpadding="2" align="right">
		<tr>
		  <td align="center" class="smallText">

<!-- // BOF MaxiDVD: Modified For Ultimate Images Pack! //-->
<?php
if ($product_info['products_image_med']!='') {
	  $new_image = $product_info['products_image_med'];
	  $image_width = MEDIUM_IMAGE_WIDTH;
	  $image_height = MEDIUM_IMAGE_HEIGHT;
	 } else {
	  $new_image = $product_info['products_image'];
	  $image_width = SMALL_IMAGE_WIDTH;
	  $image_height = SMALL_IMAGE_HEIGHT;}?>
<script language="javascript"><!--
  document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . 'ℑ=0') . '\\\')">' . tep_image(DIR_WS_IMAGES . $new_image, addslashes($product_info['products_name']), $image_width, $image_height, 'hspace="5" vspace="5"') . '<br>' . tep_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>');
//--></script>
<noscript>
  <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_med']) . '">' . tep_image(DIR_WS_IMAGES . $new_image . 'ℑ=0', addslashes($product_info['products_name']), $image_width, $image_height, 'hspace="5" vspace="5"') . '<br>' . tep_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>
</noscript>
<!-- // EOF MaxiDVD: Modified For Ultimate Images Pack! //-->

		  </td>
		</tr>
	  </table>
<?php
}
?>


	  <p><?php echo stripslashes($product_info['products_description']); ?></p>
<?php
//++++ QT Pro: Begin Changed code
?>
		  </td>
		</tr>
	  </table>
<?php
//++++ QT Pro: End Changed Code
$products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
$products_attributes = tep_db_fetch_array($products_attributes_query);
if ($products_attributes['total'] > 0) {
//++++ QT Pro: Begin Changed code
  $products_id=(preg_match("/^\d{1,10}(\{\d{1,10}\}\d{1,10})*$/",$HTTP_GET_VARS['products_id']) ? $HTTP_GET_VARS['products_id'] : (int)$HTTP_GET_VARS['products_id']); 
  require(DIR_WS_CLASSES . 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN . '.php');
  $class = 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN;
  $pad = new $class($products_id);
  echo $pad->draw();
//++++ QT Pro: End Changed Code
}
?>
	</td>
  </tr>
		</tr>
<?php
  $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");
  while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
	$products_options_array = array();
// BOF: WebMakers.com Added: Attributes Copy and Sort
 if ( PRODUCTS_OPTIONS_SORT_BY_PRICE !='1' ) {
	$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'" . " order by pa.products_options_sort_order, pov.products_options_values_name");
 } else {
	$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'" . " order by pa.products_options_sort_order, pa.options_values_price");
 }
// EOF: WebMakers.com Added: Attributes Copy and Sort
	while ($products_options = tep_db_fetch_array($products_options_query)) {
	  $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
	  if ($products_options['options_values_price'] != '0') {
		$products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
	  }
	}

	if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {
	  $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
	} else {
	  $selected_attribute = false;
	}
?>
		<tr>
		  <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
		  <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>
		</tr>
<?php
  }
?>
	  </table>

<?php
// BOF MaxiDVD: Modified For Ultimate Images Pack!
if (ULTIMATE_ADDITIONAL_IMAGES == 'enable') { include(DIR_WS_MODULES . 'additional_images.php'); }
// BOF MaxiDVD: Modified For Ultimate Images Pack!
; ?>

  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
$reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_id . "'");
$reviews = tep_db_fetch_array($reviews_query);
if ($reviews['count'] > 0) {
?>
  <tr>
	<td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
}

if (tep_not_null($product_info['products_url'])) {
?>
  <tr>
	<td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
<?php
}

if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
?>
  <tr>
	<td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td>
  </tr>
<?php
} else {
?>
  <tr>
	<td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td>
  </tr>
<?php
}
?>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td>
			<td class="main" align="right"><?php echo '<b>Quantity:</b> <input type="text" name="quantity" value="1" maxlength="5" size="5">' . tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td>
<?php
//added for cross -sell
  if ( (USE_CACHE == 'true') && !SID) {
echo tep_cache_also_purchased(3600);
 include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS);
  } else {
 include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS);
  include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
}
 }
?>
	</td>
  </tr>
</table></form></td>
<!-- body_text_eof //-->
<td width="<?php echo BOX_WIDTH_RIGHT_IS; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH_RIGHT_IS; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
</table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Link to comment
Share on other sites

I have been playing with this contrib too and tried to find a res on the Order Editor Contrib. Bit of a cross post but hopefully it will be useful for QTPro folks too.

 

As per below, I too cannot resolve this. Basically, if you edit a product that has attribtes in Order Editor, it updates the combined stock figures but not the QTPro figures.

 

djmonkey suggested adding a new query similar to

 

tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = products_quantity - " . $_POST['add_product_quantity'] . ", products_ordered = products_ordered + " . $_POST['add_product_quantity'] . " where products_id = '" . $_POST['add_product_products_id'] . "'");

 

but despite playing with this (ie using products_stock_quantity) I cannot get it to work.

 

Appreciate any expert QTPro eyes on this matter :D. I can PM any Order Editor files as necessary if that helps.

 

Many thanks

 

W

 

I got qtpro working great now, thanks to Ralph :)

 

As I moved on with my project now I am facing some problem with "Edit orders thing"

 

I have downloaded the contribution below. it is order editor.

1) http://www.oscommerce.com/community/contributions,1435

 

This tool works nicely but does not update stock when an item is removed from an order. If this Order Editor works with Qtpro life will be lot easier, does anyone of you using Qtpro got this contribution to work with QTpro, if so please enlighten me in what direction I should go to achieve the same.

 

For your information there is a contribution which puts the order back to customers shopping cart and this can be done via admin, then customer adds/removes items from his cart and resubmit the order and order gets updated in admin. It's real cool but I couldn't get this to work too. Link to the the contribution below, Contributions name is Restore Order For Customer Change V1.

 

http://www.oscommerce.com/community/contributions,1161

 

If Ralph gets this order edit thing going with Qtpro it would be nice. I am aware he is busy but still my request.

Link to comment
Share on other sites

Within the More Pics, I find it forces the review and buy now buttons to the bottom left under column_left. With Product Listing in Columns, I find that when I click a prodcut to bring the specifics up, and then buy now, two products go into the cart.

 

you need to go through the table/tr/td tags with a fine toothed comb to sort out the button problem. Painstaking but there it is. worth looking at the output source code from the page.

Link to comment
Share on other sites

hi, maybe anyone can help me to bring quantity tracking professional together with this contribution: http://www.oscommerce.com/community/contri...arch,attributes.

 

Attribute Qty Product Info is still working on my site at www.himalaya-online.net, a testproduct: http://www.himalaya-online.net/product_inf...roducts_id=2999

 

quantity tracking pro is also installed except the file product_info.php. here is my product_info.php code:

 

<?php
$products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
$products_attributes = tep_db_fetch_array($products_attributes_query);
if ($products_attributes['total'] > 0) {
?>

<?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_mult')); ?>

<div id="pinfobuybox">
<table border="0" cellspacing="1" cellpadding="1" width="100%" bgcolor="#F2F0E9">

<!------------ Wenn Preis ist gr?sser 0 ------------>

<?php if($pf->thePrice > 0) { ?>
<tr>
	<td bgcolor="#F2F0E9" align="center"><b><?php echo TEXT_PRODUCT_OPTION; ?></b></td>
	<td bgcolor="#F2F0E9" align="center"><b><?php echo TEXT_PRODUCT_QUANTITY; ?></b></td>
</tr>

<?php
$X=0;
  $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");
  while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
	$products_options_array = array();
	$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' order by pa.sort_order");
	while ($products_options = tep_db_fetch_array($products_options_query)) {
	  $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
	  if ($products_options['options_values_price'] != '0') {
		$products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
	 if ($products_options['price_prefix'] == '+') {
	   $price_with_attribute = ($product_info['products_price'] + $products_options['options_values_price']);
} else {
   $price_with_attribute = ($product_info['products_price'] - $products_options['options_values_price']);
   }
}

  ?>


<tr>
	<td bgcolor="#ffffff" align="center">
	<b><?php echo $products_options['products_options_values_name']; ?> </b>
	<?php echo tep_draw_hidden_field('a[]', $products_options['products_options_values_id']);
	echo tep_draw_hidden_field('b',$products_options_name['products_options_id']); ?>
	</td>
	<td bgcolor="#ffffff" align="center"><?php echo tep_draw_input_field('quantity[]',$value = '0','size=2');?></td>
</tr>

 <?php	
  $x++;

  }
	if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {
	  $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
	} else {
	  $selected_attribute = false;
	}
?>

<?php } ?>

 

 

i think i have to change some code in pad_single_dropdown.php (single ist ok, i dont need the other).

 

oh, and i have sppc and some other contribs installed...

tim

Link to comment
Share on other sites

hi, maybe anyone can help me to bring quantity tracking professional together with this contribution:

i think i have to change some code in pad_single_dropdown.php (single ist ok, i dont need the other).

 

oh, and i have sppc and some other contribs installed...

tim

 

if you have any luck keeps us updated please

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Link to comment
Share on other sites

Hi All

 

QT sounds great but I would like to hear how difficult it is to implement when having other contributions installed. At the moment I have installed the following contributions:

 

STS PLUS v4.0.7 - http://www.oscommerce.com/community/contri...ons,3893/page,3

Easy Populate v2.76b - http://www.oscommerce.com/community/contributions,500

Autologon v. 1.08 - http://www.oscommerce.com/community/contributions,338/page,2

Infobox Skin Manager - http://www.oscommerce.com/community/contributions,1680

 

First of all wich SQL files should I run on my database - config.sql (upgrade.sql or new_install.sql)

 

Will i work if I find all the corresponding files and merge them with the ones supplied in QTPro v.4.25 Full.

 

Thanks in advance

 

I hope I can pull if off, because the contrib looks very nice...

 

 

best regards, D

Link to comment
Share on other sites

I installed this contribution with the manual included, i copied the archives in the correct directories and i made the changes in the BD. After that, i can?t see the Product Information link in the Configuration box to configure the plugin and i get this error in the product listing (only in the products with atributes associed):

Warning: main(includes/classes/pad_PRODINFO_ATTRIBUTE_PLUGIN.php): failed to open stream: No such file or directory in d:\cosas\commerce\catalog\product_info.php on line 165

Fatal error: main(): Failed opening required 'includes/classes/pad_PRODINFO_ATTRIBUTE_PLUGIN.php' (include_path='.;C:\ARCHIV~1\EASYPH~1\\php\pear\') in d:\cosas\commerce\catalog\product_info.php on line 165

Link to comment
Share on other sites

I've searched and searched for an answer to using QTPro with Easy Populate and am hoping someone can give a definitive answer/solution to the oft asked question:

 

Can Easy Populate be used with QTPro?

 

Currently, when I use EP to import products, the 'track stock' option of QTPro is turned off -- presumably because there is no way to input separate stock levels for each attribute of a product. Therefore, EP effectively disables QTPro.

 

Is there another contribution to pull these two great contribs together? (EasyPopulate and QT Pro)

 

I found a response that says there's a way to use them together but there are no details:

http://www.oscommerce.com/forums/index.php?sho...41entry606341

 

Many thanks in advance; I'm stuck at a critical point in developing a shopping site.

Link to comment
Share on other sites

I've actually found out that QTPro works with later versions of Easy Populate, but apparently only with products that have single attributes.

 

How may QTPro be used with EP if a store catalog contains products with multiple attributes?

Link to comment
Share on other sites

But, if i type a 13 number barcode in, the result always shows as '2147483647'.

 

Hi

 

I've have tried to set the barcode Type in phpmyadmin to Char but it keeps chaging it to Varchar. I also have a barcode mod installed and this does display Char correctly.

 

Any ideas?

 

W

Link to comment
Share on other sites

I currently have the problem that stock attributes are not decremented when someone buys an item, but the overall product quantity is decremented.

For example, in

Categories->attributes->product quantity , the number displayed is decremented when someone buys an item. However, the same item that was bought with attribute "red" is not decremented at all, when it should be.

 

Does anyone have this same problem?

 

Thanks!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...