Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Quickly Update Product Stock


homewetbar

Recommended Posts

You need to change your code to show

 

								   '<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a><br>' .
? ? ? ? ? 						   '<a href="' . tep_href_link(FILENAME_QUICK_STOCKUPDATE, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_QUICK_STOCKUPDATE . '</a>' );
?}

 

that should fix it!

 

Installed V2.5 Quick Stock Update then attempted to run. At admin screen I see this code with is followed by 'Configuration' menu only / nothing else below or beside:

 

In the catalog.php file I have:

 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? '<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a>');
? ? ? ? ? '<a href="' . tep_href_link(FILENAME_QUICK_STOCKUPDATE, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_QUICK_STOCKUPDATE . '</a><br>' .
?}

the last "}" is line 31

I have tried changing the last

'</a><br>'.

to look like this instead:

'</a>'

with no change in result.

This must be something so simple I'm going to smack myself but I can't seem to grasp it. Any help appreciated. This Contribution will be handy for me if I can get it running.

 

Thanks!

Edited by jacklawry
Link to comment
Share on other sites

  • 4 months later...
  • Replies 185
  • Created
  • Last Reply

Top Posters In This Topic

Getting an error when i hit Update

 

Warning: Variable passed to each() is not an array or object in /~path~/quick_stockupdate.php on line 90

 

I've installed Version 2.5. and I'm getting this problem as well, does anyone have a solution for it?

Link to comment
Share on other sites

  • 2 weeks later...
If you want to sort it differently than it is now, do the following:

 

/admin/quick_stockupdate.php

Find:

	  
$sql2 = tep_db_query("SELECT p.products_model, p.products_id, p. products_quantity, p.products_status, p.products_weight, p.products_price, pd.products_name from products p, products_to_categories ptc, products_description pd where p.products_id = ptc.products_id and p.products_id = pd.products_id and language_id = $languages_id and ptc.categories_id = '" . $HTTP_POST_VARS['cat_id'] . "' order by pd.products_name");

 

And change the end (ie. change order by pd.products_name) to order by any value that you wish, for example if you wish to make it sort my product's id, then change it to look like this:

$sql2 = tep_db_query("SELECT p.products_model, p.products_id, p. products_quantity, p.products_status, p.products_weight, p.products_price, pd.products_name from products p, products_to_categories ptc, products_description pd where p.products_id = ptc.products_id and p.products_id = pd.products_id and language_id = $languages_id and ptc.categories_id = '" . $HTTP_POST_VARS['cat_id'] . "' order by p.products_id");

 

I think this guy ment adding the sort order added by the product sort order contrib? If so I have done this but I am no programmer and im having trouble getting the coloum to display the sort order? can anybody help? this is what i have so far

<?php
/*
 $Id: product_updates.php,v 1.1 2005/02/12 Exp $

 osCommerce
 http://www.oscommerce.com

 Copyright (c) 2005

 Released under the GNU General Public License\
*/

 require('includes/application_top.php');
 require(DIR_WS_CLASSES . 'currencies.php');

 define('FIELD_SIZE', 6);  
 define('FIELD_SIZE_MODEL', 12);

 $currencies = new currencies();

 $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

 if ($HTTP_GET_VARS['action'] == 'update') {

  // Get all productions first to make sure we are not updating products that did not change
foreach ($_POST['event_record'] as $id => $row) {
$products_query = tep_db_query("SELECT * from " . TABLE_PRODUCTS);
$products = array();
while($product = tep_db_fetch_array($products_query))
{
	$products[$product['products_id']] = array(
											'products_id' => $product['products_id'],
											'products_price' => number_format($product['products_price'], 2),
											'products_model' => $product['products_model'],
											'products_weight' => number_format($product['products_weight'], 1),
											'products_sort_order' => number_format($product['products_sort_order'], 0),
											'products_quantity' => number_format($product['products_quantity'], 0)
										);
}

if( strcasecmp($products[$row['products_id']]['products_price'], $row['products_price']) != 0 || 
	strcasecmp($products[$row['products_id']]['products_model'], $row['products_model']) != 0 || 
	strcasecmp($products[$row['products_id']]['products_weight'], $row['products_weight']) != 0 || 
	strcasecmp($products[$row['products_id']]['products_sort_order'], $row['products_sort_order']) != 0 || 
	strcasecmp($products[$row['products_id']]['products_quantity'], $row['products_quantity']) != 0
) {

	/*	
	echo "product " . $row['products_id'] . " will be updated<br/>";
	print_r($products[$row['products_id']]);
	echo "<br/>";
	print_r($row);
	echo "<br/>";
	continue;
	*/

	tep_db_query("UPDATE " . TABLE_PRODUCTS . " SET products_price = '" . $row['products_price'] . "', products_model = '" . $row['products_model'] . "', products_weight = '" . $row['products_weight'] . "', products_sort_order = '" . $row['products_sort_order'] . "', products_quantity = '" . $row['products_quantity'] . "' where products_id = '" . $row['products_id'] . "'");
	$products_updated = true;
  }
}
  if ($products_updated == true) {
	$messageStack->add_session(SUCCESS_PRODUCTS_UPDATED, 'success');
  } else {
	$messageStack->add_session(WARNING_PRODUCTS_NOT_UPDATED, 'warning');
  }
tep_redirect(tep_href_link(FILENAME_PRODUCT_UPDATES));
 }

 if ($HTTP_GET_VARS['action'] == 'export') {
  $csv_output = TABLE_HEADING_PRODUCT_ID . "," . TABLE_HEADING_PMAN . "," . TABLE_HEADING_PNAME . "," . TABLE_HEADING_PMODEL . "," . TABLE_HEADING_PPRICE . "," . TABLE_HEADING_PWEIGHT . "," . TEXT_PRODUCTS_SORT_ORDER . "," . TABLE_HEADING_PQTY;
  $csv_output .= "\n";
  $csv_query = tep_db_query("select p.products_id, p.manufacturers_id, p.products_quantity, p.products_price, p.products_weight, products_sort_order, p.products_model, pd.products_name, m.manufacturers_id, m.manufacturers_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_id = pd.products_id and p.manufacturers_id = m.manufacturers_id group by pd.products_name order by pd.products_name ASC");
  while ($csv = tep_db_fetch_array($csv_query)) {
   $csv_output .= $csv['products_id'] . "," . $csv['manufacturers_name'] . "," . $csv['products_name'] . "," . $csv['products_model'] . "," . $currencies->format($csv['products_price']) . "," . $csv['products_weight'] . "," . $csv['products_sort_order'] . "," . $csv['products_quantity'] . "\n";
  }
  $saveas = 'product_stock-price_report_' . strftime("%m-%d-%Y");
  header("Content-Disposition: attachment; filename=$saveas.csv");
  print $csv_output;
  exit;
 }
?>
<!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">
<script type="text/javascript" language="javascript" src="includes/general.js"></script>
</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"><?php echo tep_draw_form('stockprice', FILENAME_PRODUCT_UPDATES, 'action=update', 'post'); ?>
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="pageHeading"><?php echo HEADING_TITLE; ?></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>

		   <?php
	  switch ($listing) {
	  case "prod":
		  $order = "p.products_id";
		  break;
	  case "prod-desc":
		  $order = "p.products_id DESC";
		  break;
	  case "manu":
		  $order = "m.manufacturers_name";
		  break;
	  case "manu-desc":
		  $order = "m.manufacturers_name DESC";
		  break;
	  case "name":
		  $order = "pd.products_name";
		  break;
	  case "name-desc":
		  $order = "pd.products_name DESC";
		  break;
	  case "model":
		  $order = "p.products_model";
		  break;
	  case "model-desc":
		  $order = "p.products_model DESC";
		  break;
	  case "quantity":
		  $order = "p.products_quantity";
		  break;
	  case "quantity-desc":
		  $order = "p.products_quantity DESC";
		  break;
	  case "weight":
		  $order = "p.products_weight";
		  break;
	  case "weight-desc":
		  $order = "p.products_weight DESC";
		  break;
	  case "sort":
		  $order = "products_sort_order";
		  break;
	  case "sort-desc":
		  $order = "products_sort_order DESC";
		  break;
	  case "price":
		  $order = "p.products_price";
		  break;
	  case "price-desc":
		  $order = "p.products_price DESC";
		  break;
	  default:
		  //$order = "p.products_model ASC";
		  $order = "p.products_quantity";
	  }
	  ?>
  <tr>
	<td><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">
			<td class="dataTableHeadingContent"><a href="<?php echo "$PHP_SELF?listing=prod"; ?>"><?php echo tep_image_button('ic_up.gif', ' Sort ' . TABLE_HEADING_PRODUCT_ID . ' --> A-B-C From Top '); ?></a> <a href="<?php echo "$PHP_SELF?listing=prod-desc"; ?>"><?php echo tep_image_button('ic_down.gif', ' Sort ' . TABLE_HEADING_PRODUCT_ID . ' --> Z-X-Y From Top '); ?></a><br><?php echo TABLE_HEADING_PRODUCT_ID; ?></td>
			<td class="dataTableHeadingContent"><a href="<?php echo "$PHP_SELF?listing=manu"; ?>"><?php echo tep_image_button('ic_up.gif', ' Sort ' . TABLE_HEADING_PMAN . ' --> A-B-C From Top '); ?></a> <a href="<?php echo "$PHP_SELF?listing=manu-desc"; ?>"><?php echo tep_image_button('ic_down.gif', ' Sort ' . TABLE_HEADING_PMAN . ' --> Z-X-Y From Top '); ?></a><br><?php echo TABLE_HEADING_PMAN; ?></td>
			<td class="dataTableHeadingContent"><a href="<?php echo "$PHP_SELF?listing=name"; ?>"><?php echo tep_image_button('ic_up.gif', ' Sort ' . TABLE_HEADING_PNAME . ' --> A-B-C From Top '); ?></a> <a href="<?php echo "$PHP_SELF?listing=name-desc"; ?>"><?php echo tep_image_button('ic_down.gif', ' Sort ' . TABLE_HEADING_PNAME. ' --> Z-X-Y From Top '); ?></a><br><?php echo TABLE_HEADING_PNAME; ?></td>
			<td class="dataTableHeadingContent"><a href="<?php echo "$PHP_SELF?listing=model"; ?>"><?php echo tep_image_button('ic_up.gif', ' Sort ' . TABLE_HEADING_PMODEL . ' --> A-B-C From Top '); ?></a> <a href="<?php echo "$PHP_SELF?listing=model-desc"; ?>"><?php echo tep_image_button('ic_down.gif', ' Sort ' . TABLE_HEADING_PMODEL . ' --> Z-X-Y From Top '); ?></a><br><?php echo TABLE_HEADING_PMODEL; ?></td>
			<td class="dataTableHeadingContent"><a href="<?php echo "$PHP_SELF?listing=weight"; ?>"><?php echo tep_image_button('ic_up.gif', ' Sort ' . TABLE_HEADING_PWEIGHT . ' --> A-B-C From Top '); ?></a> <a href="<?php echo "$PHP_SELF?listing=weight-desc"; ?>"><?php echo tep_image_button('ic_down.gif', ' Sort ' . TABLE_HEADING_PWEIGHT . ' --> Z-X-Y From Top '); ?></a><br><?php echo TABLE_HEADING_PWEIGHT; ?></td>
	<td class="dataTableHeadingContent"><a href="<?php echo "$PHP_SELF?listing=sort"; ?>"><?php echo tep_image_button('ic_up.gif', ' Sort ' . TABLE_HEADING_PSORT_ORDER . ' --> A-B-C From Top '); ?></a> <a href="<?php echo "$PHP_SELF?listing=sort-desc"; ?>"><?php echo tep_image_button('ic_down.gif', ' Sort ' . TABLE_HEADING_PSORT_ORDER . ' --> Z-X-Y From Top '); ?></a><br><?php echo TABLE_HEADING_PSORT_ORDER; ?></td>
	<td class="dataTableHeadingContent"><a href="<?php echo "$PHP_SELF?listing=price"; ?>"><?php echo tep_image_button('ic_up.gif', ' Sort ' . TABLE_HEADING_PPRICE . ' --> A-B-C From Top '); ?></a> <a href="<?php echo "$PHP_SELF?listing=price-desc"; ?>"><?php echo tep_image_button('ic_down.gif', ' Sort ' . TABLE_HEADING_PPRICE . ' --> Z-X-Y From Top '); ?></a><br><?php echo TABLE_HEADING_PPRICE; ?></td>
			<td class="dataTableHeadingContent"><a href="<?php echo "$PHP_SELF?listing=quantity"; ?>"><?php echo tep_image_button('ic_up.gif', ' Sort ' . TABLE_HEADING_PQTY . ' --> A-B-C From Top '); ?></a> <a href="<?php echo "$PHP_SELF?listing=quantity-desc"; ?>"><?php echo tep_image_button('ic_down.gif', ' Sort ' . TABLE_HEADING_PQTY . ' --> Z-X-Y From Top '); ?></a><br><?php echo TABLE_HEADING_PQTY; ?></td>
		  </tr>

<?php
 //$countrows_query = tep_db_query("select * from " . TABLE_PRODUCTS . " where products_status=1");
 //$countrows = tep_db_num_rows($countrows_query);
 $updates_raw = "select p.products_id, p.manufacturers_id, p.products_quantity, p.products_weight, products_sort_order, p.products_price, p.products_model, pd.products_name, m.manufacturers_id, m.manufacturers_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = 1 and p.products_id = pd.products_id and p.manufacturers_id = m.manufacturers_id and  pd.language_id = $languages_id group by pd.products_name order by $order";

 $updates = tep_db_query($updates_raw);

 $countrows = tep_db_num_rows($updates);
 $updates_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $updates_raw, $countrows);

  while ($row = tep_db_fetch_array($updates)) {
	$id = $row['products_id'];
	$updates_man = $row['manufacturers_name'];
	$updates_name = $row['products_name'];
	$updates_model = $row['products_model'];
	$updates_weight = number_format($row['products_weight'], 1);
	$updates_height = number_format($row['products_sort_order'], 0);
	$updates_price = number_format($row['products_price'], 2);
	$updates_pqty = number_format($row['products_quantity'], 0);
?>
		  <tr class="dataTableRow">
			<td class="dataTableContent"><?php echo $id . "<input type='hidden' name='event_record[" . $id . "][products_id]' value='".$id."'>"; ?></td>
			<td class="dataTableContent"><?php echo $updates_man; ?></td>
			<td class="dataTableContent"><?php echo '<a href="' . tep_catalog_href_link('product_info.php', 'products_id=' . $id) . '">' . $updates_name . '</a>'; ?></td>
			<td class="dataTableContent"><?php echo tep_draw_input_field('event_record[' . $id . '][products_model]', $updates_model, 'size="' . FIELD_SIZE_MODEL . '" readonly'); ?></td>
			<td class="dataTableContent"><?php echo tep_draw_input_field('event_record[' . $id . '][products_weight]', $updates_weight, 'size="' . FIELD_SIZE . '"'); ?></td>
			<td class="dataTableContent"><?php echo tep_draw_input_field('event_record[' . $id . '][products_sort_order]', $updates_sort_order, 'size="' . FIELD_SIZE . '"'); ?></td>
			<td class="dataTableContent"><?php echo tep_draw_input_field('event_record[' . $id . '][products_price]', $updates_price, 'size="' . FIELD_SIZE . '"'); ?></td>
			<td class="dataTableContent"><?php echo tep_draw_input_field('event_record[' . $id . '][products_quantity]', $updates_pqty, 'size="' . FIELD_SIZE . '"'); ?></td>
		  </tr>
<?php
 }
?>
		  <tr>
			<td colspan="6"><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td>
		  </tr>
		  <tr>
			<td colspan="3" align="left"><?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?></form></td>
			<td colspan="3" align="right"><?php echo tep_draw_form('stockprice_report', FILENAME_PRODUCT_UPDATES, 'action=export', 'post'); ?><?php echo tep_image_submit('button_save.gif', IMAGE_SAVECSV); ?></form></td>
		  </tr>
		  <tr>
			<td colspan="6"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
		  </tr>
		  <tr>
			<td class="smallText" align="left" colspan="3"><?php echo $updates_split->display_count($countrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
			<td class="smallText" align="right" colspan="3"><?php echo $updates_split->display_links($countrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'x', 'y', 'products_id'))); ?> </td>
		  </tr>
		</table></td>
	  </tr>
	</table></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'); ?>

Link to comment
Share on other sites

Hey I've added sort order colum, heres how:

 

1: add to product_update.php in admin/includes/languages/english/

 

define('TABLE_HEADING_PSORT_ORDER', 'Sort Order');

 

2: Open Product Updates and add lthe following:

 

FIND:

												'products_weight' => number_format($product['products_weight'], 1),

 

And add after:

 

												'products_sort_order' => number_format($product['products_sort_order'], 0),

 

FIND:

		strcasecmp($products[$row['products_id']]['products_weight'], $row['products_weight']) != 0 ||

 

And add after:

 

													strcasecmp($products[$row['products_id']]['products_sort_order'], $row['products_sort_order']) != 0 ||

 

FIND:

tep_db_query("UPDATE " . TABLE_PRODUCTS . " SET products_price = '" . $row['products_price'] . "', products_model = '" . $row['products_model'] . "', products_weight = '" . $row['products_weight'] . "'

 

And add after: (, products_weight = '" . $row['products_weight'] . "')

 

											, products_sort_order = '" . $row['products_sort_order'] . "'

 

FIND:

   $csv_output = TABLE_HEADING_PRODUCT_ID . "," . TABLE_HEADING_PMAN . "," . TABLE_HEADING_PNAME . "," . TABLE_HEADING_PMODEL . "," . TABLE_HEADING_PPRICE . "," . TABLE_HEADING_PWEIGHT . "

 

And add after: ("," . TABLE_HEADING_PWEIGHT . ")

 

										
," . TABLE_HEADING_PSORT_ORDER . "

 

FIND:

   $csv_query = tep_db_query("select p.products_id, p.manufacturers_id, p.products_quantity, p.products_price, p.products_weight,

 

And add after: (, p.products_weight)

 

										
p.products_sort_order,

 

FIND:

   $currencies->format($csv['products_price']) . "," . $csv['products_weight'] . "

 

And add after: (," . $csv['products_weight'] . ")

 

										
," . $csv['products_sort_order'] . "

 

FIND:

		  case "weight-desc":
		  $order = "p.products_weight DESC";
		  break;

 

And add after:

 

										
	  case "sort":
		  $order = "p.products_sort_order";
		  break;
	  case "sort-desc":
		  $order = "p.products_sort_order DESC";
		  break;

 

 

FIND:

				<td class="dataTableHeadingContent"><a href="<?php echo "$PHP_SELF?listing=weight"; ?>"><?php echo tep_image_button('ic_up.gif', ' Sort ' . TABLE_HEADING_PWEIGHT . ' --> A-B-C From Top '); ?></a> <a href="<?php echo "$PHP_SELF?listing=weight-desc"; ?>"><?php echo tep_image_button('ic_down.gif', ' Sort ' . TABLE_HEADING_PWEIGHT . ' --> Z-X-Y From Top '); ?></a><br><?php echo TABLE_HEADING_PWEIGHT; ?></td>

 

And add after:

 

		<td class="dataTableHeadingContent"><a href="<?php echo "$PHP_SELF?listing=sort"; ?>"><?php echo tep_image_button('ic_up.gif', ' Sort ' . TABLE_HEADING_PSORT_ORDER . ' --> A-B-C From Top '); ?></a> <a href="<?php echo "$PHP_SELF?listing=sort-desc"; ?>"><?php echo tep_image_button('ic_down.gif', ' Sort ' . TABLE_HEADING_PSORT_ORDER . ' --> Z-X-Y From Top '); ?></a><br><?php echo TABLE_HEADING_PSORT_ORDER; ?></td>

 

FIND:

  $updates_raw = "select p.products_id, p.manufacturers_id, p.products_quantity, p.products_weight,

 

And add after: (p.products_weight,)

 

p.products_sort_order,

 

 

FIND:

		$updates_weight = number_format($row['products_weight'], 1);

 

And add after:

 

	   $updates_sort_order = number_format($row['products_sort_order'], 0);

 

FIND:

				<td class="dataTableContent"><?php echo tep_draw_input_field('event_record[' . $id . '][products_weight]', $updates_weight, 'size="' . FIELD_SIZE . '"'); ?></td>

 

And add after:

 

				<td class="dataTableContent"><?php echo tep_draw_input_field('event_record[' . $id . '][products_sort_order]', $updates_sort_order, 'size="' . FIELD_SIZE . '"'); ?></td>

 

Upload your modded file and you are done. just to clarify this will add the option to edit the sort order of products if you have the Product Sort v1.6 contrib installed.

 

hope this has helped

Link to comment
Share on other sites

  • 2 months later...
  • 3 months later...

I have installed this contribution and even been able to modify it to allow me to update an additional field, but I would like to be able to also edit the product name ... what changes do I need to make to be able to do this? I think because the product name comes from another table I am not having success, but I cannot figure out the correct syntax... can anyone help?

 

<?php

/*

quick_stockupdate.php v1.1 by Tomorn Kaewtong / http://www.phpthailand.com

MODIFIED quick_stockupdate.php v2.1 by Dominic Stein

 

Stand-alone Admin tool for osCommerce v2.2-CVS

 

A spin-off of my Quick DeActivate script so you can set a lot of quantities

in a single process. Also allows you to change the STATUS of the products

based upon quantities provided.

 

Released under the GPL licence.

*/

 

include('includes/application_top.php');

 

 

/// optional parameter to set max products per row:

$max_cols = 6;

 

?>

<!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">

<script LANGUAGE="JavaScript1.2" SRC="jsgraph/graph.js"></SCRIPT>

<!-- 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 style="border:none" border="0" width="90%" align="center" class="none"><tr><td>

<?php

// we've done nothing cool yet...

 

if ($HTTP_POST_VARS['stock_update']) {

 

//set counter

$stock = 0;

$status_a = 0;

$status_d = 0;

 

 

while (list($key, $items) = each($stock_update)) {

// update the quantity in stock and image

$sql = "UPDATE products SET products_quantity = '".$items['stock']."', products_model = '".$items['model']."', products_price = '".$items['price']."', products_weight = '".$items['weight']."' WHERE products_id = $key";

$update = tep_db_query($sql);

$stock_i++;

 

// we're de-re-activating the selected products

if ($HTTP_POST_VARS['update_status']) {

if ($items['stock'] >= 1 ) {

$dereac = tep_db_query("UPDATE products SET products_status = 1 WHERE products_id = $key");

$status_a++;

}else{

$dereac = tep_db_query("UPDATE products SET products_status = 0 WHERE products_id = $key");

$status_d++;

}

}

}

}

?>

<br><form method="post" action="quick_stockupdate.php">

<?php

 

// first select all categories that have 0 as parent:

$sql = tep_db_query("SELECT c.categories_id, cd.categories_name from categories c, categories_description cd WHERE c.parent_id = 0 AND c.categories_id = cd.categories_id AND cd.language_id = 1");

echo '<center><font face="Genvea,Arial"><b>Quick Stock Update</b></font>'. tep_draw_separator('pixel_trans.gif', '100%', '3') . '</center><table border="0" align="center"><tr>';

while ($parents = tep_db_fetch_array($sql)) {

// check if the parent has products

$check = tep_db_query("SELECT products_id FROM products_to_categories WHERE categories_id = '" . $parents['categories_id'] . "'");

if (tep_db_num_rows($check) > 0) {

 

$tree = tep_get_category_tree();

$dropdown= tep_draw_pull_down_menu('cat_id', $tree, '', 'onChange="this.form.submit();"'); //single

$all_list = '<form method="post" action="quick_stockupdate.php"><th class="smallText" align="left" valign="top">All categories:<br>' . $dropdown . '</form></th>';

 

} else {

 

// get the tree for that parent

$tree = tep_get_category_tree($parents['categories_id']);

// draw a dropdown with it:

$dropdown = tep_draw_pull_down_menu('cat_id', $tree, '', 'onChange="this.form.submit();"');

$list .= '<form method="post" action="quick_stockupdate.php"><th class="smallText" align="left" valign="top">' . $parents['categories_name'] . '<br>' . $dropdown . '</form></th>';

}

}

echo $list . $all_list . '</form></tr></table><p>';

 

 

 

// see if there is a category ID:

 

if ($HTTP_POST_VARS['cat_id']) {

 

// start the table

echo '<form method="post" action="quick_stockupdate.php"><table border="0" width="100%" cellspacing=2 cellpadding=2>';

$i = 0;

 

// get all active prods in that specific category

 

$sql2 = tep_db_query("SELECT p.products_model, p.products_id, p. products_quantity, p.products_status, p.products_weight, p.products_price, pd.products_name from products p, products_to_categories ptc, products_description pd where p.products_id = ptc.products_id and p.products_id = pd.products_id and language_id = $languages_id and ptc.categories_id = '" . $HTTP_POST_VARS['cat_id'] . "' order by pd.products_name");

echo '<tr class="dataTableHeadingRow"><td class="dataTableContent" align="left"><b>Model</b></td><td class="dataTableContent" align="left"><b>ID#</b></td><td class="dataTableContent" align="left"><b>Name</b></td><td class="dataTableContent" align="left"><b>Weight</b></td><td class="dataTableContent" align="left"><b>Price</b></td><td class="dataTableContent" align="left"><b>Stock</b></td></tr>';

// added changes thowden 10/2004 stock_update becomes a multi-dim array

while ($results = tep_db_fetch_array($sql2)) {

$i++;

echo '<tr class="dataTableRow"><td class="dataTableContent" align="left"><input type="text" size="16" name="stock_update[' . $results['products_id'] . '][model]" value="' . $results['products_model'] . '"><i>';

echo '</td><td class="dataTableContent" align="left">' . $results['products_id'] . '</td><td class="dataTableContent" align="left">' . $results['products_name'];

echo '</td><td class="dataTableContent" align="left"><input type="text" size="3" name="stock_update[' . $results['products_id'] . '][weight]" value="' . $results['products_weight'] . '"><i>';

echo '</td><td class="dataTableContent" align="left"><input type="text" size="5" name="stock_update[' . $results['products_id'] . '][price]" value="' . $results['products_price'] . '"><i>';

echo '</td><td class="dataTableContent" align="left"><input type="text" size="4" name="stock_update[' . $results['products_id'] . '][stock]" value="' . $results['products_quantity'] . '"><i>';

echo (($results['products_status'] == 0) ? '<font color="ff0000"><b>not active</b></font>' : '<font color="009933"><b>active</b></font>');

echo '</i></td></tr>';

if ($i == $max_cols) {

$i =0;

}

}

echo '</table><table border="0" width="100%" cellspacing=2 cellpadding=2><tr>';

echo '<input type="hidden" name="cat_id" value="' . $HTTP_POST_VARS['cat_id'] . '">';

echo '</tr><br><td align="center" colspan="10" class="smallText">';

echo '<input type="checkbox" name="update_status">Check to set status on each individual product based on items in stock<br><i>( one or more in stock will become <font color="009933"><b>active</b></font> / zero in stock will become <font color="ff0000"><b>not active</b></font> )</i><p>';

echo '<input type="submit" value="Update"></td></tr></form>';

} //if

?>

</tr></table>

</td>

</tr></table><center>

<a style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:xx-small;text-decoration:none;text-decoration:none;color=ccbbcc;" href="mailto:[email protected]?subject=QuickStockUpdate"><b>© 2002 Tomorn K. -</b></a>

<a style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:xx-small;text-decoration:none;color=#ccbbcc;" href="http://www.phpthailand.com"><b>http://www.phpthailand.com</b></a></center>

</td>

<!-- body_text_eof //-->

</tr>

</table>

<!-- body_eof //-->

 

<!-- footer //-->

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

<!-- footer_eof //-->

</body>

</html>

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

Link to comment
Share on other sites

Please, can anyone help? I would really like to be able to edit the product name but I have only been able to add additional fields ...help!

 

Thanks

 

I have installed this contribution and even been able to modify it to allow me to update an additional field, but I would like to be able to also edit the product name ... what changes do I need to make to be able to do this? I think because the product name comes from another table I am not having success, but I cannot figure out the correct syntax... can anyone help?

 

<?php

/*

quick_stockupdate.php v1.1 by Tomorn Kaewtong / http://www.phpthailand.com

MODIFIED quick_stockupdate.php v2.1 by Dominic Stein

 

Stand-alone Admin tool for osCommerce v2.2-CVS

 

A spin-off of my Quick DeActivate script so you can set a lot of quantities

in a single process. Also allows you to change the STATUS of the products

based upon quantities provided.

 

Released under the GPL licence.

*/

 

include('includes/application_top.php');

/// optional parameter to set max products per row:

$max_cols = 6;

 

?>

<!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">

<script LANGUAGE="JavaScript1.2" SRC="jsgraph/graph.js"></SCRIPT>

<!-- 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 style="border:none" border="0" width="90%" align="center" class="none"><tr><td>

<?php

// we've done nothing cool yet...

 

if ($HTTP_POST_VARS['stock_update']) {

 

//set counter

$stock = 0;

$status_a = 0;

$status_d = 0;

while (list($key, $items) = each($stock_update)) {

// update the quantity in stock and image

$sql = "UPDATE products SET products_quantity = '".$items['stock']."', products_model = '".$items['model']."', products_price = '".$items['price']."', products_weight = '".$items['weight']."' WHERE products_id = $key";

$update = tep_db_query($sql);

$stock_i++;

 

// we're de-re-activating the selected products

if ($HTTP_POST_VARS['update_status']) {

if ($items['stock'] >= 1 ) {

$dereac = tep_db_query("UPDATE products SET products_status = 1 WHERE products_id = $key");

$status_a++;

}else{

$dereac = tep_db_query("UPDATE products SET products_status = 0 WHERE products_id = $key");

$status_d++;

}

}

}

}

?>

<br><form method="post" action="quick_stockupdate.php">

<?php

 

// first select all categories that have 0 as parent:

$sql = tep_db_query("SELECT c.categories_id, cd.categories_name from categories c, categories_description cd WHERE c.parent_id = 0 AND c.categories_id = cd.categories_id AND cd.language_id = 1");

echo '<center><font face="Genvea,Arial"><b>Quick Stock Update</b></font>'. tep_draw_separator('pixel_trans.gif', '100%', '3') . '</center><table border="0" align="center"><tr>';

while ($parents = tep_db_fetch_array($sql)) {

// check if the parent has products

$check = tep_db_query("SELECT products_id FROM products_to_categories WHERE categories_id = '" . $parents['categories_id'] . "'");

if (tep_db_num_rows($check) > 0) {

 

$tree = tep_get_category_tree();

$dropdown= tep_draw_pull_down_menu('cat_id', $tree, '', 'onChange="this.form.submit();"'); //single

$all_list = '<form method="post" action="quick_stockupdate.php"><th class="smallText" align="left" valign="top">All categories:<br>' . $dropdown . '</form></th>';

 

} else {

 

// get the tree for that parent

$tree = tep_get_category_tree($parents['categories_id']);

// draw a dropdown with it:

$dropdown = tep_draw_pull_down_menu('cat_id', $tree, '', 'onChange="this.form.submit();"');

$list .= '<form method="post" action="quick_stockupdate.php"><th class="smallText" align="left" valign="top">' . $parents['categories_name'] . '<br>' . $dropdown . '</form></th>';

}

}

echo $list . $all_list . '</form></tr></table><p>';

// see if there is a category ID:

 

if ($HTTP_POST_VARS['cat_id']) {

 

// start the table

echo '<form method="post" action="quick_stockupdate.php"><table border="0" width="100%" cellspacing=2 cellpadding=2>';

$i = 0;

 

// get all active prods in that specific category

 

$sql2 = tep_db_query("SELECT p.products_model, p.products_id, p. products_quantity, p.products_status, p.products_weight, p.products_price, pd.products_name from products p, products_to_categories ptc, products_description pd where p.products_id = ptc.products_id and p.products_id = pd.products_id and language_id = $languages_id and ptc.categories_id = '" . $HTTP_POST_VARS['cat_id'] . "' order by pd.products_name");

echo '<tr class="dataTableHeadingRow"><td class="dataTableContent" align="left"><b>Model</b></td><td class="dataTableContent" align="left"><b>ID#</b></td><td class="dataTableContent" align="left"><b>Name</b></td><td class="dataTableContent" align="left"><b>Weight</b></td><td class="dataTableContent" align="left"><b>Price</b></td><td class="dataTableContent" align="left"><b>Stock</b></td></tr>';

// added changes thowden 10/2004 stock_update becomes a multi-dim array

while ($results = tep_db_fetch_array($sql2)) {

$i++;

echo '<tr class="dataTableRow"><td class="dataTableContent" align="left"><input type="text" size="16" name="stock_update[' . $results['products_id'] . '][model]" value="' . $results['products_model'] . '"><i>';

echo '</td><td class="dataTableContent" align="left">' . $results['products_id'] . '</td><td class="dataTableContent" align="left">' . $results['products_name'];

echo '</td><td class="dataTableContent" align="left"><input type="text" size="3" name="stock_update[' . $results['products_id'] . '][weight]" value="' . $results['products_weight'] . '"><i>';

echo '</td><td class="dataTableContent" align="left"><input type="text" size="5" name="stock_update[' . $results['products_id'] . '][price]" value="' . $results['products_price'] . '"><i>';

echo '</td><td class="dataTableContent" align="left"><input type="text" size="4" name="stock_update[' . $results['products_id'] . '][stock]" value="' . $results['products_quantity'] . '"><i>';

echo (($results['products_status'] == 0) ? '<font color="ff0000"><b>not active</b></font>' : '<font color="009933"><b>active</b></font>');

echo '</i></td></tr>';

if ($i == $max_cols) {

$i =0;

}

}

echo '</table><table border="0" width="100%" cellspacing=2 cellpadding=2><tr>';

echo '<input type="hidden" name="cat_id" value="' . $HTTP_POST_VARS['cat_id'] . '">';

echo '</tr><br><td align="center" colspan="10" class="smallText">';

echo '<input type="checkbox" name="update_status">Check to set status on each individual product based on items in stock<br><i>( one or more in stock will become <font color="009933"><b>active</b></font> / zero in stock will become <font color="ff0000"><b>not active</b></font> )</i><p>';

echo '<input type="submit" value="Update"></td></tr></form>';

} //if

?>

</tr></table>

</td>

</tr></table><center>

<a style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:xx-small;text-decoration:none;text-decoration:none;color=ccbbcc;" href="mailto:[email protected]?subject=QuickStockUpdate"><b>© 2002 Tomorn K. -</b></a>

<a style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:xx-small;text-decoration:none;color=#ccbbcc;" href="http://www.phpthailand.com"><b>http://www.phpthailand.com</b></a></center>

</td>

<!-- body_text_eof //-->

</tr>

</table>

<!-- body_eof //-->

 

<!-- footer //-->

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

<!-- footer_eof //-->

</body>

</html>

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

Link to comment
Share on other sites

  • 1 month later...
  • 4 weeks later...
Getting an error when i hit Update

 

Warning: Variable passed to each() is not an array or object in /~path~/quick_stockupdate.php on line 90

 

Lines 90 Through 94

  while (list($key, $items) = each($stock_update)) {
  // update the quantity in stock
  $sql = "UPDATE products SET products_quantity = '".$items['stock']."', products_model = '".$items['model']."', products_price = '".$items['price']."', products_weight = '".$items['weight']."' WHERE products_id = $key";
  $update = tep_db_query($sql);
  $stock_i++;

 

Help ^.^;;

 

I'm having the same problem here, does anybody know how to fix this?

Thanks

Link to comment
Share on other sites

  • 2 months later...
I'm having the same problem here, does anybody know how to fix this?

Thanks

 

First, sorry for my english, now go to the solution:

I had the same problem, but I have the solution. The problem is when the servers run MySql 5, on MySql 4.xx works perfect.

 

Well, you must add this code at line 87 in the quick_stockupdate.php file:

$stock_update=$_POST['stock_update'];

 

The result must be something like this:

<?php                                                                     //Line 86
$stock_update=$_POST['stock_update'];                  //Line 87
if ($HTTP_POST_VARS['stock_update']) {                  // Line 88
                                                                            // Line 89
while (list($key, $items) = each($stock_update)) {       //Line 90 -- stupid line>:(  ouch!!.
// update the quantity in stock                                   // Line 91

etc...

 

If you want download the contribution fixed I upload an update here: http://addons.oscommerce.com/info/3542

 

Bye

Edited by buckman
Link to comment
Share on other sites

  • 4 months later...

Using the fix above we've managed to get rid of the error messages generated after changing to php5 and mysql5. The problem now is that the actual database update will only work on categories with only a small number of products. On categories with over about 40 products it doesn't update and just goes back the the top start page where you select your category.

Really strange problem, and I've no idea how to solve it, any help appreciated.

 

Nigel

Link to comment
Share on other sites

  • 4 months later...

I downloaded the last file from

 

http://addons.oscommerce.com/info/558

 

which does not include the fix above which is included (?) here http://addons.oscommerce.com/info/3542

Besides the instructions language an the fix are the the contributions different??

 

The fix above solves the line 90 problem and I dont see the problem that go2pub refers to (ok I have a lot of prods but less than 40 )

Link to comment
Share on other sites

I tried these updates and im still recieving the Line 90 error. I then downloaded the latest file which supposedly fixed the line 90 error, and when I go to load the quick stock updater it wont even let me and gives me a Parse error, unexpexted ';' on line 166

 

Any help would be much appreciated! Thanks!

Link to comment
Share on other sites

  • 3 weeks later...

hello

 

Would it be possible to list all the products from a manufacturer to implement the price increase for all its products, or you can only go category by category?

 

Thank you

 

I feel sorry for my bad English, I used the translator of google:)

Link to comment
Share on other sites

Hello,

 

I using the Quick-Stock-Updater V3.0. The problem I had is when I want to update the price (I have about 200+ products), it seems reject after i update. Anybody know what happen?

 

Thank you

Edited by Ariffshah
Link to comment
Share on other sites

Hi,

 

I setup the version 3.1 and everything looks OK until I press "Quick-Stock-Updater" in the Admin Catalog menu, then I get this error. I'm using OSC 2.2MS i danish. I added information in the danish laungege file - but I try to change to english, but I get the same failure

 

 

" Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /var/www/www.dinmc.dk/www/catalog/admin/quick_stockupdate.php:13) in /var/www/www.dinmc.dk/www/catalog/admin/includes/functions/sessions.php on line 67

 

Any good hints how to solve this. By the way - I have more than 1300 partnumbers in the shop - will this be a problem??

 

Regards

Lars

Link to comment
Share on other sites

Hi,

 

I setup the version 3.1 and everything looks OK until I press "Quick-Stock-Updater" in the Admin Catalog menu, then I get this error. I'm using OSC 2.2MS i danish. I added information in the danish laungege file - but I try to change to english, but I get the same failure

 

 

" Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /var/www/www.dinmc.dk/www/catalog/admin/quick_stockupdate.php:13) in /var/www/www.dinmc.dk/www/catalog/admin/includes/functions/sessions.php on line 67

 

Any good hints how to solve this. By the way - I have more than 1300 partnumbers in the shop - will this be a problem??

 

Regards

Lars

 

Hi Lars,

 

For the language, what you have to do is just create a language directory under includes/languages/ - e.g 'include/languages/danish', than copy include/languages/english/quick_stockupdate.php to that new direactory and edit the new copied file according to your language.

 

For 1300 part numbers, i think it really depends on the server itself. I added the server load checking because I had a web server that is very busy (slow :huh: ) I also added a small variable to each item if they are edit - so only items that are edited will be updated instead of all items like in the previous version. I'm still thinking of how to update the data in one single call rather than looping through the items. Any ideas anyone?

 

As for you problem, I have no clue at this moment - sorry.

 

Good luck

 

Azrin

Link to comment
Share on other sites

Hello,

 

I using the Quick-Stock-Updater V3.0. The problem I had is when I want to update the price (I have about 200+ products), it seems reject after i update. Anybody know what happen?

 

Thank you

 

Hi Ariffshah,

 

Try the V3.1. I have added quite a bit of new codes in it.

Link to comment
Share on other sites

Hi Lars,

 

For the language, what you have to do is just create a language directory under includes/languages/ - e.g 'include/languages/danish', than copy include/languages/english/quick_stockupdate.php to that new direactory and edit the new copied file according to your language.

 

For 1300 part numbers, i think it really depends on the server itself. I added the server load checking because I had a web server that is very busy (slow :huh: ) I also added a small variable to each item if they are edit - so only items that are edited will be updated instead of all items like in the previous version. I'm still thinking of how to update the data in one single call rather than looping through the items. Any ideas anyone?

 

As for you problem, I have no clue at this moment - sorry.

 

Good luck

 

Azrin

 

Hi Lars,

 

Try to move these code starting from line 13:

 

<script TYPE="text/javascript">

<!--

function changed(a){

var allElements = document.getElementsByName(a);

 

for (var i=0; i < allElements.length; i++) {

allElements.value = 1;

}

 

}

//-->

</SCRIPT>

 

and find

 

<script language="javascript" src="includes/general.js"></script>

 

move it just below this code.

 

 

HTH

 

Azrin

Link to comment
Share on other sites

Hi Guys,

 

 

Just uploaded a new version V3.2. Some changes in updating method. I create a tmp SQL file and use another script to import the sql text file. It seems to be much faster (observed from my server). I updated 157 items in just 0.0013 secs. :)

 

Please create a tmp directory under your catalog directory - e.g /catalog/tmp and set permission to 777

 

But if you cannot create the directory, you can change the directory defination (QUICK_DIR_TEMP) in /admin/include/languages/english/quick_stockupdate.php

 

Please let me know how it works for your site

 

Cheers,

 

Azrin

Edited by azrin_aris
Link to comment
Share on other sites

Hi Guys,

 

New Version V3.5

 

Add Quick Stock Updater Configuration page (Configuration->Quick Stock Updater)

- Enable/Disable Add to stock option (value entered in 'New Stock' will be added to existing stock - Default = Enable)

- Enable/Disable Update Process time (Default = Enable)

- Set Max input character for 'Model' field (Default = 8)

- Set Max input character for 'Weight' field (Default = 4)

- Set Max input character for 'New Stock' field (Default = 4)

- Set Max input character for 'Proce' field (Default = 6)

- Set decimal point for 'Price' field (Default = 2)

 

Import QuickStock_sql_install.sql using phpMyAdmin or use Run SQL From Admin add-on (http://www.oscommerce.com/community/contributions,4567) for configuration page.

 

Configuration page can be access via "Configuration->Quick Stock Updater"

 

p/s Lars, now the input max size is changeable and you can change the behavior of New stock input :)

 

HTH

Link to comment
Share on other sites

Hey Azrin,

 

Looks like a fantastic contrib and im trying to install it now (v3.5) and i get a long string of repeating errors when i got to config; quick-stock-updater -

 

 

Warning: reset() [function.reset]: Passed variable is not an array or object in /home/ryanscom/public_html/catalog/adminl/quick_stockupdate.php on line 106

 

Warning: Variable passed to each() is not an array or object in /home/ryanscom/public_html/catalog/admin/quick_stockupdate.php on line 107

 

 

Any solution? I'm pretty sure everything has been set-up properly.

 

Thanks,

Ryan

Link to comment
Share on other sites

Hey Azrin,

 

Looks like a fantastic contrib and im trying to install it now (v3.5) and i get a long string of repeating errors when i got to config; quick-stock-updater -

 

 

Warning: reset() [function.reset]: Passed variable is not an array or object in /home/ryanscom/public_html/catalog/adminl/quick_stockupdate.php on line 106

 

Warning: Variable passed to each() is not an array or object in /home/ryanscom/public_html/catalog/admin/quick_stockupdate.php on line 107

 

 

Any solution? I'm pretty sure everything has been set-up properly.

 

Thanks,

Ryan

 

Hmm that's strange.... what version of php are you using?

 

BTW please try this

 

find: (line 138)

 

	   	while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
	  $manufacturers_array[$manufacturers['manufacturers_id']] = $manufacturers['manufacturers_name'];
  }

 

add above it

 

	   	$manufacturers_array[] = array();

 

Please let me know of its outcome. If it is ok I will update the code.

Edited by azrin_aris
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...