Jump to content
Mestopholis

Quick price updates working with SPPC

Recommended Posts

I'm running OSC 2.3.1 and php 5.2

 

The Quick Price Updates for SPPC (http://addons.oscommerce.com/info/3798) doesn't seem to work with 2.3.1

All the click events redirect you to the admin homepage.

 

Quick Updates 2.9 (http://addons.oscommerce.com/info/8059/v,23) does work with 2.3.1 but doesn't hasn't been updated to work with SPPC.

 

Has anyone modified either of these 2 addons to work with 2.3.1 and SPPC 4.2

Share this post


Link to post
Share on other sites

Try replacing the code below in your admin/quick_update.php file

 

<?php
/*
 $Id: quick_updates.php for SPPC, v 1.4 2007/04/13 $
 based on version 2.6 of quick_updates.php/Quick Update Prices with Gross Price Beta 1 of April 30, 2007
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 Based on the original script contributed by Burt (burt@xwww.co.uk)
    and by Henri Bredehoeft (hrb@[member='nermica'].net)
 This version was contributed by Mathieu (contact@mathieueylert.com)
 (http://www.oscommerce-fr.info/forums)
 Copyright (c) 2005 osCommerce
 Released under the GNU General Public License
*/
 require('includes/application_top.php');

if (isset($_GET['row_by_page'])) {
  $row_by_page = (int)$_GET['row_by_page'];
}
 if (isset($_GET['manufacturer'])) {
  $manufacturer = (int)$_GET['manufacturer'];
}
 if (isset($_GET['sort_by'])) {
  $sort_by = $_GET['sort_by'];
}
 if (isset($_GET['page'])) {
  $page = $_GET['page'];
}
 if (isset($_GET['customers_group_id'])) {
  $customers_group_id = (int)$_GET['customers_group_id'];
}

($row_by_page) ? define('MAX_DISPLAY_ROW_BY_PAGE' , $row_by_page ) : $row_by_page = MAX_DISPLAY_SEARCH_RESULTS; define('MAX_DISPLAY_ROW_BY_PAGE' , MAX_DISPLAY_SEARCH_RESULTS );
//// Tax Row
   $tax_class_array = array(array('id' => '0', 'text' => NO_TAX_TEXT));
   $tax_class_query = tep_db_query("select tax_class_id, tax_class_title from " . TABLE_TAX_CLASS . " order by tax_class_title");
   while ($tax_class = tep_db_fetch_array($tax_class_query)) {
  $tax_class_array[] = array('id' => $tax_class['tax_class_id'],
							 'text' => $tax_class['tax_class_title']);
   }
////Info Row pour le champ fabriquant
    $manufacturers_array = array(array('id' => '0', 'text' => NO_MANUFACTURER));
    $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");
    while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
		    $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],
		    'text' => $manufacturers['manufacturers_name']);
    }
// Display the list of the manufacturers
function manufacturers_list(){
    global $manufacturer;
    $manufacturers_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name from " . TABLE_MANUFACTURERS . " m order by m.manufacturers_name ASC");
    $return_string = '<select name="manufacturer" onChange="this.form.submit();">';
    $return_string .= '<option value="' . 0 . '">' . TEXT_ALL_MANUFACTURERS . '</option>';
    while($manufacturers = tep_db_fetch_array($manufacturers_query)){
		    $return_string .= '<option value="' . $manufacturers['manufacturers_id'] . '"';
		    if($manufacturer && $manufacturers['manufacturers_id'] == $manufacturer) $return_string .= ' SELECTED';
		    $return_string .= '>' . $manufacturers['manufacturers_name'] . '</option>';
    }
    $return_string .= '</select>';
    return $return_string;
}
// display the customer groups
function customers_groups_list(){
    global $customers_group_id;
    $customers_group_query = tep_db_query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " order by customers_group_id");
    $return_string = '<select name="customers_group_id" onChange="this.form.submit();">';
    while($customers_groups = tep_db_fetch_array($customers_group_query)){
		    $return_string .= '<option value="' . $customers_groups['customers_group_id'] . '"';
		    if($customers_group_id && $customers_groups['customers_group_id'] == $customers_group_id) $return_string .= ' SELECTED';
		    $return_string .= '>' . $customers_groups['customers_group_name'] . '</option>';
    }
    $return_string .= '</select>';
    return $return_string;
}
##// Update database
 switch ($HTTP_GET_VARS['action']) {
   case 'update' :
  $count_update=0;
  $item_updated = array();
			  if($HTTP_POST_VARS['product_new_model']){
			   foreach($HTTP_POST_VARS['product_new_model'] as $id => $new_model) {
					 if (trim($HTTP_POST_VARS['product_new_model'][$id]) != trim($HTTP_POST_VARS['product_old_model'][$id])) {
					   $count_update++;
					   $item_updated[$id] = 'updated';
					   mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_model='" . $new_model . "', products_last_modified=now() WHERE products_id='" . $id . "'");
					 }
			   }
		    }
			  if($HTTP_POST_VARS['product_new_name']){
			   foreach($HTTP_POST_VARS['product_new_name'] as $id => $new_name) {
					 if (trim($HTTP_POST_VARS['product_new_name'][$id]) != trim($HTTP_POST_VARS['product_old_name'][$id])) {
					   $count_update++;
					   $item_updated[$id] = 'updated';
					   mysql_query("UPDATE " . TABLE_PRODUCTS_DESCRIPTION . " SET products_name='" . $new_name . "' WHERE products_id=$id and language_id=" . $languages_id);
					   mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_last_modified=now() WHERE products_id='" . $id . "'");
					 }
			   }
		    }
			  if($HTTP_POST_VARS['product_new_price']){
			   foreach($HTTP_POST_VARS['product_new_price'] as $id => $new_price) {
					 if ($HTTP_POST_VARS['product_new_price'][$id] != $HTTP_POST_VARS['product_old_price'][$id] && $HTTP_POST_VARS['update_price'][$id] == 'yes') {
					   $count_update++;
					   $item_updated[$id] = 'updated';
  if ($_POST['customers_group_id'] == '0') {
					   mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_price='" . $new_price . "', products_last_modified=now() WHERE products_id='" . $id . "'");
  } else {
   if ($_POST['cg_price_in_db'][$id] == 'yes') {
 if (trim($_POST['product_new_price'][$id]) == '') {
 mysql_query("DELETE FROM " . TABLE_PRODUCTS_GROUPS . " WHERE products_id='" . $id . "' AND customers_group_id = '" . $_POST['customers_group_id'] ."'");   
    } else {
   mysql_query("UPDATE " . TABLE_PRODUCTS_GROUPS . " SET customers_group_price='" . $new_price . "' WHERE products_id='" . $id . "' AND customers_group_id = '" . $_POST['customers_group_id'] ."'");
    }
   } elseif ($_POST['cg_price_in_db'][$id] == 'no') {
 mysql_query("INSERT INTO " . TABLE_PRODUCTS_GROUPS . " SET products_id='" . $id . "', customers_group_price='" . $new_price . "', customers_group_id = '" . $_POST['customers_group_id'] ."'");
   }
  } // end if-else ($_POST['customers_group_id'] == '0')
					 }
			   }
		    }
		    if($HTTP_POST_VARS['product_new_weight']){
			   foreach($HTTP_POST_VARS['product_new_weight'] as $id => $new_weight) {
					 if ($HTTP_POST_VARS['product_new_weight'][$id] != $HTTP_POST_VARS['product_old_weight'][$id]) {
					   $count_update++;
					   $item_updated[$id] = 'updated';
					   mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_weight='" . $new_weight . "', products_last_modified=now() WHERE products_id='" . $id . "'");
					 }
			   }
		    }
		    if($HTTP_POST_VARS['product_new_quantity']){
			   foreach($HTTP_POST_VARS['product_new_quantity'] as $id => $new_quantity) {
					 if ($HTTP_POST_VARS['product_new_quantity'][$id] != $HTTP_POST_VARS['product_old_quantity'][$id]) {
					   $count_update++;
					   $item_updated[$id] = 'updated';
					   mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_quantity='". $new_quantity . "', products_last_modified=now() WHERE products_id='" . $id . "'");
					 }
			   }
		    }
		    if($HTTP_POST_VARS['product_new_manufacturer']){
			   foreach($HTTP_POST_VARS['product_new_manufacturer'] as $id => $new_manufacturer) {
					 if ($HTTP_POST_VARS['product_new_manufacturer'][$id] != $HTTP_POST_VARS['product_old_manufacturer'][$id]) {
					   $count_update++;
					   $item_updated[$id] = 'updated';
					   mysql_query("UPDATE " . TABLE_PRODUCTS . " SET manufacturers_id='" . $new_manufacturer . "', products_last_modified=now() WHERE products_id='" . $id . "'");
					 }
			   }
		    }
		    if($HTTP_POST_VARS['product_new_image']){
			   foreach($HTTP_POST_VARS['product_new_image'] as $id => $new_image) {
					 if (trim($HTTP_POST_VARS['product_new_image'][$id]) != trim($HTTP_POST_VARS['product_old_image'][$id])) {
					   $count_update++;
					   $item_updated[$id] = 'updated';
					   mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_image='" . $new_image . "', products_last_modified=now() WHERE products_id='" . $id . "'");
					 }
			   }
		    }
			   if($HTTP_POST_VARS['product_new_status']){
					   foreach($HTTP_POST_VARS['product_new_status'] as $id => $new_status) {
							 if ($HTTP_POST_VARS['product_new_status'][$id] != $HTTP_POST_VARS['product_old_status'][$id]) {
							   $count_update++;
							   $item_updated[$id] = 'updated';
							   tep_set_product_status($id, $new_status);
							   mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_last_modified=now() WHERE products_id='" . $id . "'");
							 }
					   }
		    }
			   if($HTTP_POST_VARS['product_new_tax']){
					   foreach($HTTP_POST_VARS['product_new_tax'] as $id => $new_tax_id) {
							 if ($HTTP_POST_VARS['product_new_tax'][$id] != $HTTP_POST_VARS['product_old_tax'][$id]) {
							   $count_update++;
							   $item_updated[$id] = 'updated';
							   mysql_query("UPDATE " . TABLE_PRODUCTS . " SET products_tax_class_id='" . $new_tax_id . "', products_last_modified=now() WHERE products_id='" . $id . "'");
							 }
					   }
		    }
 $count_item = array_count_values($item_updated);
 if ($count_item['updated'] > 0) $messageStack->add($count_item['updated'].' '.TEXT_PRODUCTS_UPDATED . " $count_update " . TEXT_QTY_UPDATED, 'success');
 break;
 case 'calcul' :
  if ($HTTP_POST_VARS['spec_price']) $preview_global_price = 'true';
 break;
}
//// explode string parameters from preview product
 if($info_back && $info_back!="-") {
   $infoback = explode('-',$info_back);
   $sort_by = $infoback[0];
   $page =  $infoback[1];
   $current_category_id = $infoback[2];
   $row_by_page = $infoback[3];
   $manufacturer = $infoback[4];
   $customers_group_id = $infoback[5];
 }
//// define the step for rollover lines per page
  for ($i = 10; $i <= 100 ; $i = $i+5) {
 if ($row_by_page < 10 && $i == 10) {
   $row_bypage_array[] = array('id' => $row_by_page, 'text' => $row_by_page);
 }
  $row_bypage_array[] = array('id' => $i, 'text' => $i);
 if ($row_by_page > 10 && $row_by_page%5 !== 0) {
   if (($i < $row_by_page) && ($i+5 > $row_by_page)) {
	 $row_bypage_array[] = array('id' => $row_by_page, 'text' => $row_by_page);
   }
 }   
  } // end for ($i = 10; $i <= 100 ; $i = $i+5)
require(DIR_WS_INCLUDES . 'template_top.php');
?>
<script language="javascript">
<!--
var browser_family;
var up = 1;
if (document.all && !document.getElementById)
 browser_family = "dom2";
else if (document.layers)
 browser_family = "ns4";
else if (document.getElementById)
 browser_family = "dom2";
else
 browser_family = "other";
function display_ttc(action, prix, taxe, up){
 if(action == 'display'){
	  if(up != 1)
	  valeur = Math.round((prix + (taxe / 100) * prix) * 100) / 100;
 }else{
	  if(action == 'keyup'){
		    valeur = Math.round((parseFloat(prix) + (taxe / 100) * parseFloat(prix)) * 100) / 100;
    }else{
	 valeur = '0';
    }
 }
 switch (browser_family){
   case 'dom2':
	  document.getElementById('descDiv').innerHTML = '<?php echo TOTAL_COST; ?> : '+valeur;
  break;
   case 'ie4':
  document.all.descDiv.innerHTML = '<?php echo TOTAL_COST; ?> : '+valeur;
  break;
   case 'ns4':
  document.descDiv.document.descDiv_sub.document.write(valeur);
  document.descDiv.document.descDiv_sub.document.close();
  break;
   case 'other':
  break;
 }
}
var tax_rates = new Array();
<?php
   for ($i=0, $n=sizeof($tax_class_array); $i<$n; $i++) {
  if ($tax_class_array[$i]['id'] > 0) {
    echo 'tax_rates["' . $tax_class_array[$i]['id'] . '"] = ' . tep_get_tax_rate_value($tax_class_array[$i]['id']) . ';' . "\n";
  }
   }
?>
function doRound(x, places) {
 return Math.round(x * Math.pow(10, places)) / Math.pow(10, places);
}
function getTaxRate(product_id) {
 var selected_value = document.forms.update.elements["product_new_tax[" + product_id + "]"].selectedIndex;
 var parameterVal = document.forms.update.elements["product_new_tax[" + product_id + "]"].value;
 if ( (parameterVal > 0) && (tax_rates[parameterVal] > 0) ) {
   return tax_rates[parameterVal];
 } else {
   return 0;
 }
}

function updateGross(product_id) {
 var taxRate = getTaxRate(product_id);
 var grossValue = document.forms.update.elements["product_new_price[" + product_id + "]"].value;
 if (taxRate > 0) {
   grossValue = grossValue * ((taxRate / 100) + 1);
 }
 document.forms.update.elements["product_new_price_gross[" + product_id + "]"].value = doRound(grossValue, 4);
}
function updateNet(product_id) {
 var taxRate = getTaxRate(product_id);
 var netValue = document.forms.update.elements["product_new_price_gross[" + product_id + "]"].value;
 if (taxRate > 0) {
   netValue = netValue / ((taxRate / 100) + 1);
 }
 document.forms.update.elements["product_new_price[" + product_id + "]"].value = doRound(netValue, 4);
}
-->
</script>
<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" colspan="3" valign="top"><?php echo HEADING_TITLE; ?></td>
					 <td class="pageHeading" align="right">
					 <?php
							 if($current_category_id != 0){
								    $image_query = tep_db_query("select c.categories_image from " . TABLE_CATEGORIES . " c where c.categories_id=" . $current_category_id);
								    $image = tep_db_fetch_array($image_query);
								    echo tep_image(DIR_WS_CATALOG . DIR_WS_IMAGES . $image['categories_image'], '', 40);
						    }else{
								    if($manufacturer){
										    $image_query = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id=" . $manufacturer);
										    $image = tep_db_fetch_array($image_query);
										    echo tep_image(DIR_WS_CATALOG . DIR_WS_IMAGES . $image['manufacturers_image'], '', 40);
								    }
						    }
				    ?>
			   </td></tr>
			 </table></td></tr>
  <tr><td align="center">
			   <table width="100%" cellspacing="0" cellpadding="0" border="1" bgcolor="#F3F9FB" bordercolor="#D1E7EF" height="100"><tr align="left"><td valign="middle">
						    <table width="100%" cellspacing="0" cellpadding="0" border="0">
<!-- SPPC mod: next tr changed for better HTML -->
								    <tr><td colspan="5" class="smalltext"> </td></tr>
<tr align="center">
 <td class="smalltext"><?php echo tep_draw_form('row_by_page', FILENAME_QUICK_UPDATES, '', 'get'); echo tep_draw_hidden_field( 'manufacturer', $manufacturer); echo tep_draw_hidden_field( 'cPath', $current_category_id);
 // BOF Separate Pricing Per Customer
 echo tep_draw_hidden_field('customers_group_id', $customers_group_id);
 ?></td>
 <td class="smallText"><?php echo TEXT_MAXI_ROW_BY_PAGE . '  ' . tep_draw_pull_down_menu('row_by_page', $row_bypage_array, $row_by_page, 'onChange="this.form.submit();"');
 echo tep_hide_session_id(); ?></form></td>
 <?php echo tep_draw_form('categorie', FILENAME_QUICK_UPDATES, '', 'get'); echo tep_draw_hidden_field( 'row_by_page', $row_by_page); echo tep_draw_hidden_field( 'manufacturer', $manufacturer); echo tep_draw_hidden_field('customers_group_id', $customers_group_id);?>
 <td class="smallText" align="center" valign="top"><?php echo DISPLAY_CATEGORIES . '  ' . tep_draw_pull_down_menu('cPath', tep_get_category_tree(), $current_category_id, 'onChange="this.form.submit();"'); ?></td>
 <?php echo tep_hide_session_id(); ?></form>
 <?php echo tep_draw_form('manufacturers', FILENAME_QUICK_UPDATES, '', 'get'); echo tep_draw_hidden_field( 'row_by_page', $row_by_page); echo tep_draw_hidden_field( 'cPath', $current_category_id); echo tep_draw_hidden_field('customers_group_id', $customers_group_id);?>
 <td class="smallText" align="center" valign="top"><?php echo DISPLAY_MANUFACTURERS . '  ' . manufacturers_list(); ?></td>
 <?php echo tep_hide_session_id(); ?></form>
 <td class="smallText" align="center" valign="top"><?php
 echo tep_draw_form('customers_groups', FILENAME_QUICK_UPDATES, '', 'get'); echo tep_draw_hidden_field( 'row_by_page', $row_by_page); echo tep_draw_hidden_field( 'cPath', $current_category_id); echo tep_draw_hidden_field( 'manufacturer', $manufacturer);
 echo DISPLAY_CUSTOMERS_GROUPS . '  ' . customers_groups_list();
 echo tep_hide_session_id(); ?></form></td>
   </tr>
   </table>
				    <table width="100%" cellspacing="0" cellpadding="0" border="0">
								    <tr align="center">

										    <td align="center">
  <table border="0" cellspacing="0">
  <form name="spec_price" <?php echo 'action="' . tep_href_link(FILENAME_QUICK_UPDATES, tep_get_all_get_params(array('action', 'info', 'pID')) . "action=calcul&page=" . $page . "&sort_by=" . $sort_by . "&cPath=" . $current_category_id . "&row_by_page=". $row_by_page . "&manufacturer=" . $manufacturer."&customers_group_id=" . $customers_group_id ."" , 'NONSSL') . '"'; ?> method="post">
  <tr>
	 <td class="main"  align="center" valign="middle" nowrap> <?php echo TEXT_INPUT_SPEC_PRICE; ?></td>
	 <td align="center" valign="middle"> <?php echo tep_draw_input_field('spec_price',0,'size="5"'); ?> </td>
	 <td class="smalltext" align="center" valign="middle"><?php
	  if ($preview_global_price != 'true') {
	    echo '  ' . tep_image_submit('button_preview.gif', IMAGE_PREVIEW, "page=$page&sort_by=$sort_by&cPath=$current_category_id&row_by_page=$row_by_page&manufacturer=$manufacturer&customers_group_id=" . $customers_group_id ."");
	    } else echo '  <a href="' . tep_href_link(FILENAME_QUICK_UPDATES, "page=$page&sort_by=$sort_by&cPath=$current_category_id&row_by_page=$row_by_page&manufacturer=$manufacturer&customers_group_id=" . $customers_group_id ."") . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';?></td>
<?php if(ACTIVATE_COMMERCIAL_MARGIN == 'true') {
echo '<td class="smalltext" align="center" valign="middle">    ' . tep_draw_checkbox_field('marge','yes','','no') . ' ' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', TEXT_MARGE_INFO) . '</td>';}
?>
   </tr>
   <tr>
  <td class="smalltext" align="center" valign="middle" colspan="3" nowrap>
  <?php if ($preview_global_price != 'true') {
	    echo TEXT_SPEC_PRICE_INFO1 ;
	    } else echo TEXT_SPEC_PRICE_INFO2;?>
  </td>
   </tr>
<?php echo tep_hide_session_id(); ?>
   </form>
</table>
										    </td>
								    </tr>
								    <tr><td height="5"></td></tr>
				    </td></tr>
				    <br>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
 <tr align="center">
 <form name="update" method="POST" action="<?php echo $_SERVER['PHP_SELF']."?action=update&page=". $page."&sort_by=". $sort_by ."&cPath=". $current_category_id. "&row_by_page=". $row_by_page ."&manufacturer=". $manufacturer ."&customers_group_id=" . $customers_group_id .""; ?>">
 <td class="smalltext" align="middle"><?php echo WARNING_MESSAGE; ?></td>
 <?php echo "<td class=\"pageHeading\" align=\"right\">" . '<script language="javascript"><!--
	   switch (browser_family)
	   {
	   case "dom2":
	   case "ie4":
	   document.write(\'<div id="descDiv">\');
	   break;
	   default:
	   document.write(\'<ilayer id="descDiv"><layer id="descDiv_sub">\');
	   break;
	   }
	   -->
	   </script>' . "</td>\n";
  ?>
  <td align="right" valign="middle"><?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE, "action=update&cPath=$current_category_id&page=$page&sort_by=$sort_by&row_by_page=$row_by_page");?></td>
<!-- question: why no manufacturer above? -->
  </tr>
</table>
  </td>
  </tr>
	  <tr>
    <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
	  <tr>
	    <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr class="dataTableHeadingRow">
		    <td class="dataTableHeadingContent" align="left" valign="middle">
			  <table border="0" cellspacing="0" cellpadding="0">
			    <tr class="dataTableHeadingRow">
				 <td class="dataTableHeadingContent" align="left" valign="middle">
				 <?php if(DISPLAY_MODEL == 'true') echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_model ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer . '&customers_group_id=' . $customers_group_id)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_MODEL . ' ' . TEXT_ASCENDINGLY)."</a>
				 <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_model DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer . '&customers_group_id=' . $customers_group_id)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_MODEL . ' ' . TEXT_DESCENDINGLY)."</a>
				 <br>"  .TABLE_HEADING_MODEL . "</td>" ; ?>
			    </tr>
			  </table>
		    </td>
		    <td class="dataTableHeadingContent" align="left" valign="middle">
			  <table border="0" cellspacing="0" cellpadding="0">
			    <tr class="dataTableHeadingRow">
				 <td class="dataTableHeadingContent" align="left" valign="middle">
				 <?php echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=pd.products_name ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer . '&customers_group_id=' . $customers_group_id)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_PRODUCTS . TEXT_ASCENDINGLY)."</a>
				 <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=pd.products_name DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer . '&customers_group_id=' . $customers_group_id)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_PRODUCTS . ' ' . TEXT_DESCENDINGLY)."</a>
				 <br>"  .TABLE_HEADING_PRODUCTS . "</td>" ; ?>
			    </tr>
			  </table>
		    </td>
		    <td class="dataTableHeadingContent" align="center" valign="middle">
			  <table border="0" cellspacing="0" cellpadding="0">
			    <tr class="dataTableHeadingRow">
				 <td class="dataTableHeadingContent" align="center" valign="middle">
				 <?php if(DISPLAY_STATUT == 'true')echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_status ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer . '&customers_group_id=' . $customers_group_id)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . 'OFF ' . TEXT_ASCENDINGLY)."</a>
				 <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_status DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer . '&customers_group_id=' . $customers_group_id)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . 'ON ' . TEXT_ASCENDINGLY)."</a>
				 <br>off / on</td>" ; ?>
			    </tr>
			  </table>
		    </td>
		    <td class="dataTableHeadingContent" align="center" valign="middle">
			  <table border="0" cellspacing="0" cellpadding="0">
			    <tr class="dataTableHeadingRow">
				 <td class="dataTableHeadingContent" align="center" valign="middle">
				 <?php if(DISPLAY_WEIGHT == 'true')echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_weight ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer . '&customers_group_id=' . $customers_group_id)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_WEIGHT . ' ' . TEXT_ASCENDINGLY)."</a>
				 <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_weight DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer . '&customers_group_id=' . $customers_group_id)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_WEIGHT . ' ' . TEXT_DESCENDINGLY)."</a>
				 <br>" . TABLE_HEADING_WEIGHT . "</td>" ; ?>
			    </tr>
			  </table>
		    </td>
		    <td class="dataTableHeadingContent" align="center" valign="middle">
			  <table border="0" cellspacing="0" cellpadding="0">
			    <tr class="dataTableHeadingRow">
				 <td class="dataTableHeadingContent" align="center" valign="middle" width="50">
				 <?php if(DISPLAY_QUANTITY == 'true')echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_quantity ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer . '&customers_group_id=' . $customers_group_id)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_QUANTITY . ' ' . TEXT_ASCENDINGLY)."</a>
				 <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_quantity DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer . '&customers_group_id=' . $customers_group_id)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_QUANTITY . ' ' . TEXT_DESCENDINGLY)."</a>
				 <br>" . TABLE_HEADING_QUANTITY . "</td>" ; ?>
			    </tr>
			  </table>
		    </td>
			  <td class="dataTableHeadingContent" align="left" valign="middle">
			  <table border="0" cellspacing="0" cellpadding="0">
			    <tr class="dataTableHeadingRow">
				 <td class="dataTableHeadingContent" align="left" valign="middle">
				 <?php if(DISPLAY_IMAGE == 'true')echo "  <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_image ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer . '&customers_group_id=' . $customers_group_id)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_IMAGE . ' ' . TEXT_ASCENDINGLY)."</a>
				 <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_image DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer . '&customers_group_id=' . $customers_group_id)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_IMAGE . ' ' . TEXT_DESCENDINGLY)."</a>
				 <br>  " . TABLE_HEADING_IMAGE . "</td>" ; ?>
			    </tr>
			  </table>
		    </td>
			  <td class="dataTableHeadingContent" align="left" valign="middle">
			  <table border="0" cellspacing="0" cellpadding="0">
			    <tr class="dataTableHeadingRow">
				 <td class="dataTableHeadingContent" align="left" valign="middle">
				 <?php if(DISPLAY_MANUFACTURER == 'true')echo "   <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=manufacturers_id ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer . '&customers_group_id=' . $customers_group_id)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_MANUFACTURERS . ' ' . TEXT_ASCENDINGLY)."</a>
				 <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=manufacturers_id DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer . '&customers_group_id=' . $customers_group_id)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_MANUFACTURERS . ' ' . TEXT_DESCENDINGLY)."</a>
				 <br>   " . TABLE_HEADING_MANUFACTURERS . "</td>" ; ?>
			    </tr>
			  </table>
		    </td>
			  <td class="dataTableHeadingContent" align="left" valign="middle">
			   <?php echo "    <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_price ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer . '&customers_group_id=' . $customers_group_id) ."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_PRICE . ' ' . TEXT_ASCENDINGLY)."</a>
			    <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_price DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer . '&customers_group_id=' . $customers_group_id) ."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_PRICE . ' ' . TEXT_DESCENDINGLY)."</a>
				 <br>    " . TABLE_HEADING_PRICE . "</td>";?>
			  <td class="dataTableHeadingContent" align="left" valign="middle">
			   <?php if(DISPLAY_TAX == 'true')echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_tax_class_id ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer . '&customers_group_id=' . $customers_group_id)."\" >".tep_image(DIR_WS_IMAGES  . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_TAX . ' ' . TEXT_ASCENDINGLY)."</a>
			    <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_tax_class_id DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer . '&customers_group_id=' . $customers_group_id)."\" >".tep_image(DIR_WS_IMAGES  . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_TAX . ' ' . TEXT_DESCENDINGLY)."</a>
			    <br>" . TABLE_HEADING_TAX . " </td> " ; ?>
			 <td class="dataTableHeadingContent" align="center" valign="middle"></td>
		    <td class="dataTableHeadingContent" align="center" valign="middle"></td>
		    </tr><tr class="datatableRow">
<?php
//// control string sort page
 if ($sort_by && !preg_match('/order by/i',$sort_by)) $sort_by = 'order by '.$sort_by ;
//// define the string parameters for good back preview product
 $origin = FILENAME_QUICK_UPDATES."?info_back=$sort_by-$page-$current_category_id-$row_by_page-$manufacturer-$customers_group_id";
//// controle length (lines per page)
 $split_page = (int)$_GET['page'];
 if ($split_page > 1) $rows = $split_page * MAX_DISPLAY_ROW_BY_PAGE - MAX_DISPLAY_ROW_BY_PAGE;
////  select categories
 if ($current_category_id == 0){
	  if($manufacturer){
	    $products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id from  " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION .  " pd where p.products_id = pd.products_id and pd.language_id = '$languages_id' and p.manufacturers_id = " . $manufacturer . " $sort_by ";
	  }else{
		    $products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id from  " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION .  " pd where p.products_id = pd.products_id and pd.language_id = '$languages_id' $sort_by ";
    }
 } // end if ($current_category_id == 0)
 else {
	 if($manufacturer){
			 $products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id from  " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION .  " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc where p.products_id = pd.products_id and pd.language_id = '$languages_id' and p.products_id = pc.products_id and pc.categories_id = '" . $current_category_id . "' and p.manufacturers_id = " . $manufacturer . " $sort_by ";
	  }else{
		    $products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id from  " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION .  " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc where p.products_id = pd.products_id and pd.language_id = '$languages_id' and p.products_id = pc.products_id and pc.categories_id = '" . $current_category_id . "' $sort_by ";
    }
 }
//// page splitter and display each products info
 $products_split = new splitPageResults($split_page, MAX_DISPLAY_ROW_BY_PAGE, $products_query_raw, $products_query_numrows);
 $products_query = tep_db_query($products_query_raw);
 while ($_products = tep_db_fetch_array($products_query)) {
$products[] = $_products;
$list_of_products_ids[] = $_products['products_id'];
 }
 if (tep_not_null($list_of_products_ids)) {
  if (isset($customers_group_id) && $customers_group_id != '0' && $customers_group_id != '') {
 $pg_query = tep_db_query("select pg.products_id, customers_group_price as price from " . TABLE_PRODUCTS_GROUPS . " pg where products_id in ('".implode("','",$list_of_products_ids)."') and pg.customers_group_id = '".$customers_group_id."' ");
 while ($pg_array = tep_db_fetch_array($pg_query)) {
 $new_prices[] = array ('products_id' => $pg_array['products_id'], 'products_price' => $pg_array['price']);
 }
  for ($x = 0; $x < count($list_of_products_ids); $x++) {
   // delete products_price (retail) first
   $products[$x]['products_price'] = '';
   // need to know whether a customer group price is in the table products_groups or not
   // (for choosing update or insert)
   $products[$x]['cg_price_in_db'] = 'no';
// replace products prices with those from customers_group table
  if(!empty($new_prices)) {
	 for ($i = 0; $i < count($new_prices); $i++) {
  if ($products[$x]['products_id'] == $new_prices[$i]['products_id'] ) {
  $products[$x]['products_price'] = $new_prices[$i]['products_price'];
  $products[$x]['cg_price_in_db'] = 'yes';
  }
 } // end for ($i = 0; $i < count($new_prices); $i++)
  } // end if(!empty($new_prices))
  } // end for ($x = 0; $x < count($list_of_products_ids); $x++)
  } // end if (isset($customers_group_id) && $customers_group_id != '0')

// now make sure we get all the specials_id and specials_prices in one query instead of one by one
 if (isset($customers_group_id) && $customers_group_id != '0' && $customers_group_id != '') {
  $specials_query = tep_db_query("select products_id, specials_id from " . TABLE_SPECIALS . " where products_id in ('".implode("','",$list_of_products_ids)."') and status = '1' and customers_group_id = '" .$customers_group_id. "'");
 } else {
  $specials_query = tep_db_query("select products_id, specials_id from " . TABLE_SPECIALS . " where products_id in ('".implode("','",$list_of_products_ids)."') and status = '1' and customers_group_id = '0'");
 }
  while ($specials_array = tep_db_fetch_array($specials_query)) {
$new_s_prices[] = array ('products_id' => $specials_array['products_id'], 'specials_id' => $specials_array['specials_id']);
}
// put in the specials id's
  for ($x = 0; $x < count($list_of_products_ids); $x++) {
   // make sure a value for special price and specials_id is added
   $products[$x]['specials_id'] = '';
	  if(!empty($new_s_prices)) {
	 for ($i = 0; $i < count($new_s_prices); $i++) {
  if ($products[$x]['products_id'] == $new_s_prices[$i]['products_id'] ) {
  $products[$x]['specials_id'] = $new_s_prices[$i]['specials_id'];
  }
 } // end for ($i = 0; $i < count($new_prices); $i++)
  } // end if(!empty($new_s_prices))  
  } // end ($x = 0; $x < count($list_of_products_ids); $x++)

// debug:   echo '<pre>products array'; print_r($products);

  for ($x = 0; $x < count($list_of_products_ids); $x++) {  
   $rows++;
   if (strlen($rows) < 2) {
  $rows = '0' . $rows;
   }
//// check for global add value or rates, calcul and round values rates
   if ($HTTP_POST_VARS['spec_price']){
  $flag_spec = 'true' ;
  if (substr($HTTP_POST_VARS['spec_price'],-1) == '%') {
			  if($HTTP_POST_VARS['marge'] && substr($HTTP_POST_VARS['spec_price'],0,1) != '-'){
				    $valeur = (1 - (ereg_replace("%", "", $HTTP_POST_VARS['spec_price']) / 100));
				    $price = sprintf("%01.2f", round($products[$x]['products_price'] / $valeur,2));
		    }else{
		    $price = sprintf("%01.2f", round($products[$x]['products_price'] + (($spec_price / 100) * $products[$x]['products_price']),2));
		  }
	  } else $price = sprintf("%01.2f", round($products[$x]['products_price'] + $spec_price,2));
   } else $price = $products[$x]['products_price'] ;
//// Check Tax_rate for displaying TTC
    $tax_query = tep_db_query("select r.tax_rate, c.tax_class_title from " . TABLE_TAX_RATES . " r, " . TABLE_TAX_CLASS . " c where r.tax_class_id=" . $products[$x]['products_tax_class_id'] . " and c.tax_class_id=" . $products[$x]['products_tax_class_id']);
    $tax_rate = tep_db_fetch_array($tax_query);
    if($tax_rate['tax_rate'] == '')$tax_rate['tax_rate'] = 0;
// SPPC v1.0: added && DISPLAY_MANUFACTURER == 'true'
    if (MODIFY_MANUFACTURER == 'false' && DISPLAY_MANUFACTURER == 'true') {
		    $manufacturer_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id=" . $products[$x]['manufacturers_id']);
 // mixing of global manufacturer and local manufacturer in original quick_updates
 // change original $manufacturer to another variable
		    $products_manufacturer = tep_db_fetch_array($manufacturer_query);
    }
//// display infos per row
// SPPC v1.1 this.style.cursor='hand' changed to this.style.cursor='pointer' (valid CSS)
		    if($flag_spec){echo '<tr class="dataTableRow" onmouseover="'; if(DISPLAY_TVA_OVER == 'true'){echo 'display_ttc(\'display\', ' . $price . ', ' . $tax_rate['tax_rate'] . ');';} echo 'this.className=\'dataTableRowOver\';this.style.cursor=\'pointer\'" onmouseout="'; if(DISPLAY_TVA_OVER == 'true'){echo 'display_ttc(\'delete\');';} echo 'this.className=\'dataTableRow\'">'; }else{ echo '<tr class="dataTableRow" onmouseover="'; if(DISPLAY_TVA_OVER == 'true'){echo 'display_ttc(\'display\', ' . $products[$x]['products_price'] . ', ' . $tax_rate['tax_rate'] . ');';} echo 'this.className=\'dataTableRowOver\';this.style.cursor=\'pointer\'" onmouseout="'; if(DISPLAY_TVA_OVER == 'true'){echo 'display_ttc(\'delete\', \'\', \'\', 0);';} echo 'this.className=\'dataTableRow\'">';}
		    if(DISPLAY_MODEL == 'true'){if(MODIFY_MODEL == 'true')echo "<td class=\"smallText\" align=\"center\"><input type=\"text\" size=\"8\" name=\"product_new_model[".$products[$x]['products_id']."]\" value=\"".$products[$x]['products_model']."\"></td>\n";else echo "<td class=\"smallText\" align=\"left\">" . $products[$x]['products_model'] . "</td>\n";}else{ echo "<td class=\"smallText\" align=\"left\">";}
    if(MODIFY_NAME == 'true')echo "<td class=\"smallText\" align=\"center\"><input type=\"text\" size=\"30\" name=\"product_new_name[".$products[$x]['products_id']."]\" value=\"".str_replace("\"",""",$products[$x]['products_name'])."\"></td>\n";else echo "<td class=\"smallText\" align=\"left\">".$products[$x]['products_name']."</td>\n";
//// Product status radio button
		    if(DISPLAY_STATUT == 'true'){
				    if ($products[$x]['products_status'] == '1') {
					 echo "<td class=\"smallText\" align=\"center\" style=\"white-space: nowrap;\"><input  type=\"radio\" name=\"product_new_status[".$products[$x]['products_id']."]\" value=\"0\" ><input type=\"radio\" name=\"product_new_status[".$products[$x]['products_id']."]\" value=\"1\" checked ></td>\n";
				    } else {
					 echo "<td class=\"smallText\" align=\"center\" style=\"white-space: nowrap;\"><input type=\"radio\" style=\"background-color: #EEEEEE\" name=\"product_new_status[".$products[$x]['products_id']."]\" value=\"0\" checked ><input type=\"radio\" style=\"background-color: #EEEEEE\" name=\"product_new_status[".$products[$x]['products_id']."]\" value=\"1\"></td>\n";
				    }
		    }else{
				    echo "<td class=\"smallText\" align=\"center\"></td>";
		    }
    if(DISPLAY_WEIGHT == 'true')echo "<td class=\"smallText\" align=\"center\"><input type=\"text\" size=\"5\" name=\"product_new_weight[".$products[$x]['products_id']."]\" value=\"".$products[$x]['products_weight']."\"></td>\n";else echo "<td class=\"smallText\" align=\"center\"></td>";
    if(DISPLAY_QUANTITY == 'true')echo "<td class=\"smallText\" align=\"center\"><input type=\"text\" size=\"3\" name=\"product_new_quantity[".$products[$x]['products_id']."]\" value=\"".$products[$x]['products_quantity']."\"></td>\n";else echo "<td class=\"smallText\" align=\"center\"></td>";
		    if(DISPLAY_IMAGE == 'true')echo "<td class=\"smallText\" align=\"center\"><input type=\"text\" size=\"8\" name=\"product_new_image[".$products[$x]['products_id']."]\" value=\"".$products[$x]['products_image']."\"></td>\n";else echo "<td class=\"smallText\" align=\"center\"></td>";
		    if(DISPLAY_MANUFACTURER == 'true'){if(MODIFY_MANUFACTURER == 'true')echo "<td class=\"smallText\" align=\"center\">".tep_draw_pull_down_menu("product_new_manufacturer[".$products[$x]['products_id']."]", $manufacturers_array, $products[$x]['manufacturers_id'])."</td>\n";else echo "<td class=\"smallText\" align=\"center\">" . $products_manufacturer['manufacturers_name'] . "</td>";}else{ echo "<td class=\"smallText\" align=\"center\"></td>";}
//// get the specials products list
/*   deleted code */
//// check specials
//  original: if ( in_array($products[$x]['products_id'],$specials_array)) {
    if (tep_not_null($products[$x]['specials_id'])) { 
/* deleted code */
	    echo "<td class=\"smallText\" style=\"white-space: nowrap;\">    <input type=\"text\" size=\"8\" name=\"product_new_price[".$products[$x]['products_id']."]\" value=\"".$products[$x]['products_price']."\" style=\"background-color: lightyellow;\" disabled > <a target=blank href=\"".tep_href_link (FILENAME_SPECIALS, 'sID='.$products[$x]['specials_id']).'&action=edit'."\">". tep_image(DIR_WS_IMAGES . 'icon_info.gif', TEXT_SPECIALS_PRODUCTS) ."</a></td>\n";
    } else {
	    if ($flag_spec == 'true') {
			   echo "<td class=\"smallText\" align=\"left\">    <input type=\"text\" size=\"8\" name=\"product_new_price[".$products[$x]['products_id']."]\" "; if(DISPLAY_TVA_UP == 'true'){ echo "onKeyUp=\"display_ttc('keyup', this.value" . ", " . $tax_rate['tax_rate'] . ", 1);\"";} echo " value=\"".$price ."\" style=\"background-color: lightyellow;\">". tep_draw_checkbox_field('update_price['. $products[$x]['products_id'] .']','yes','checked','no')."</td>\n";
	    } else {
 echo "<td class=\"smallText\" style=\"white-space: nowrap;\">    <input type=\"text\" size=\"6\" name=\"product_new_price_gross[".$products[$x]['products_id']."]\" ";
  echo "onkeyup=\"updateNet(".$products[$x]['products_id'].");\"";
  echo " value=\"".($price*(1+$tax_rate['tax_rate']/100)) ."\">  <input type=\"text\" size=\"6\" name=\"product_new_price[".$products[$x]['products_id']."]\" ";
 echo "onkeyup=\"updateGross(".$products[$x]['products_id'].");\"";
 echo " value=\"".$price ."\" style=\"background-color: lightyellow;\">".tep_draw_hidden_field('update_price['.$products[$x]['products_id'].']','yes'). "</td>\n";}
    } // end if-else (tep_not_null($products[$x]['specials_id']))
  if (DISPLAY_TAX == 'true') {
   if (MODIFY_TAX == 'true') {
   echo "<td class=\"smallText\" align=\"left\">". tep_draw_pull_down_menu("product_new_tax[". $products[$x]['products_id'] ."]", $tax_class_array, $products[$x]['products_tax_class_id'], 'onchange="updateGross('.$products[$x]['products_id'].')"')."</td>\n";
	   } else {
		  echo "<td class=\"smallText\" align=\"left\">" . $tax_rate['tax_class_title'] . "<input type=\"hidden\" name=\"product_new_tax[". $products[$x]['products_id'] ."]\" value=\"" . $products[$x]['products_tax_class_id'] . "\"></td>";
   } // end if-else (MODIFY_TAX == 'true')
  }  else {
 echo "<td class=\"smallText\" align=\"center\"><input type=\"hidden\" name=\"product_new_tax[". $products[$x]['products_id'] ."]\" value=\"" . $products[$x]['products_tax_class_id'] . "\"></td>";
	   }
//// links to preview or full edit
 if (DISPLAY_PREVIEW == 'true') {
echo "<td class=\"smallText\" align=\"left\"><a href=\"". tep_href_link (FILENAME_CATEGORIES, 'pID='. $products[$x]['products_id'] .'&action=new_product_preview&read=only&sort_by='. $sort_by .'&page='. $split_page .'&origin='. $origin)."\">". tep_image(DIR_WS_IMAGES . 'icon_info.gif', TEXT_IMAGE_PREVIEW) ."</a></td>\n";
 } // end if(DISPLAY_PREVIEW == 'true')
 if (DISPLAY_EDIT == 'true') {
  echo "<td class=\"smallText\" align=\"left\"><a href=\"". tep_href_link (FILENAME_CATEGORIES, 'pID='. $products[$x]['products_id'] .'&cPath='. $categories_products[0] .'&action=new_product')."\">". tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', TEXT_IMAGE_SWITCH_EDIT) ."</a></td>\n";
 } // end if (DISPLAY_EDIT == 'true')
//// Hidden parameters for cache old values
  if (MODIFY_NAME == 'true') {
echo tep_draw_hidden_field('product_old_name['.$products[$x]['products_id'].'] ',$products[$x]['products_name']);
  } // end if (MODIFY_NAME == 'true')
  if (MODIFY_MODEL == 'true') {
  echo tep_draw_hidden_field('product_old_model['.$products[$x]['products_id'].'] ',$products[$x]['products_model']);
 } // end if (MODIFY_MODEL == 'true')
  echo tep_draw_hidden_field('product_old_status['. $products[$x]['products_id'] .']',$products[$x]['products_status']);
  echo tep_draw_hidden_field('product_old_quantity['. $products[$x]['products_id'] .']',$products[$x]['products_quantity']);
  echo tep_draw_hidden_field('product_old_image['. $products[$x]['products_id'] .']',$products[$x]['products_image']);
  if (MODIFY_MANUFACTURER == 'true') {
   echo tep_draw_hidden_field('product_old_manufacturer['. $products[$x]['products_id'] .']',$products[$x]['manufacturers_id']);
  } // end if (MODIFY_MANUFACTURER == 'true')   
  echo tep_draw_hidden_field('product_old_weight['. $products[$x]['products_id'] .']',$products[$x]['products_weight']);
  echo tep_draw_hidden_field('product_old_price['. $products[$x]['products_id'] .']',$products[$x]['products_price']);
  echo tep_draw_hidden_field('cg_price_in_db['. $products[$x]['products_id'] .']',$products[$x]['cg_price_in_db']);  
  if (MODIFY_TAX == 'true') {
   echo tep_draw_hidden_field('product_old_tax['. $products[$x]['products_id'] .']',$products[$x]['products_tax_class_id']);
  } // end if (MODIFY_TAX == 'true')
 } // end for ($x = 0; $x < count($list_of_products_ids); $x++)
 //// hidden display parameters (only once)
    echo tep_draw_hidden_field( 'row_by_page', $row_by_page);
    echo tep_draw_hidden_field( 'sort_by', $sort_by);
    echo tep_draw_hidden_field( 'page', $split_page);
if (isset($customers_group_id) && $customers_group_id !='') {
echo tep_draw_hidden_field( 'customers_group_id', $customers_group_id);
} else {
echo tep_draw_hidden_field( 'customers_group_id', '0');
}
 } // end if (tep_not_null($list_of_products_ids)
   echo "</table>\n";
?>
	  </td>
    </tr>
   </table></td>
  </tr>
<tr>
<td align="right">
<?php
			 //// display bottom page buttons
		    echo '<a href="javascript:window.print()">' . PRINT_TEXT . '</a>  ';
		  echo tep_image_submit('button_update.gif', IMAGE_UPDATE);
		  echo '  <a href="' . tep_href_link(FILENAME_QUICK_UPDATES,"row_by_page=".$row_by_page."&customers_group_id=" . $customers_group_id . "") . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';
?></td>
</tr>
<?php echo tep_hide_session_id(); ?>
</form>
	    <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		    <td class="smallText" valign="top"><?php echo $products_split->display_count($products_query_numrows, MAX_DISPLAY_ROW_BY_PAGE, $split_page, TEXT_DISPLAY_NUMBER_OF_PRODUCTS);  ?></td>
		    <td class="smallText" align="right"><?php echo $products_split->display_links($products_query_numrows, MAX_DISPLAY_ROW_BY_PAGE, MAX_DISPLAY_PAGE_LINKS, $split_page, '&cPath='. $current_category_id .'&sort_by='.$sort_by . '&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer . '&customers_group_id=' . $customers_group_id); ?></td>
	    </table></td>
	  </tr>
    </table></td>
  </tr>
   </table></td>
<!-- body_text_eof //-->
 </tr>
</table>
<!-- body_eof //-->
 </tr>
</table>
<?php
 require(DIR_WS_INCLUDES . 'template_bottom.php');
 require(DIR_WS_INCLUDES . 'application_bottom.php');
?>


REMEMBER BACKUP, BACKUP AND BACKUP

Get the latest Responsive osCommerce CE (community edition) here

It's very easy to over complicate what are simple things in life

Share this post


Link to post
Share on other sites

After replacing the code above, the dropdowns function correctly and the prices update. However, prices do not change when pressing the preview button, regardless of what is in the textbox, i.e. (+1, -3, +5%, -7%) All of these options just revert the price boxes to their original prices

 

The header in your file mentions gross price beta addon, which I'm not using. I'm not sure if this is the cause for it not functioning correctly on my store. Any suggestions?

 

Thanks for your reply.

Edited by Mestopholis

Share this post


Link to post
Share on other sites

Hi

I build a web-shop with osCommerce 2.3.1 and installed also Quick Updates.

 

Everything worked perfect until I moved the whole shop to the live-domaine.

 

I exported the test-sql-database and imported it to the live one.

After that the Quick Updates do not save changes anymore!

What could be the reason? I moved the test-version 1:1.

 

Thanks a lot for your answers!

Ute

Share this post


Link to post
Share on other sites

Hey, incredibly (w00t), replacing the code shown above has solved my problem ... although the topic was different because my version 2.3.1 runs first perfect with quick updates.

 

Dschabadabadou :D

Share this post


Link to post
Share on other sites

OSC2334 prices do not change when pressing the preview button, regardless of what is in the textbox, i.e. (+1, -3, +5%, -7%) All of these options just revert the price boxes to their original prices at the live or localhost

 

Attila Elmacigil

Share this post


Link to post
Share on other sites

Thanks greasemonkey

Now If I want to change the price by hand at table is ok.

But When I try to i.e. (+1, -3, +5%, -7%) preiew dosn't change the prices and also price update button cant change the prices.

 

Regards

Attila

Share this post


Link to post
Share on other sites

I have found a solition

if you change the code bellow

 

 

PHP Code:

if (isset($_GET['row_by_page'])) {

$row_by_page = (int)$_GET['row_by_page'];

}

if (isset($_GET['manufacturer'])) {

$manufacturer = (int)$_GET['manufacturer'];

}

if (isset($_GET['sort_by'])) {

$sort_by = $_GET['sort_by'];

}

if (isset($_GET['page'])) {

$page = $_GET['page'];

}

 

 

To

 

foreach($_POST AS $key => $value) {

${$key} = $value;

}

foreach($_GET AS $key => $value) {

${$key} = $value;

}

 

 

it is working

Share this post


Link to post
Share on other sites

Hi,

 

I get this message:

 

1146 - Table 'osCommerce.TABLE_CUSTOMERS_GROUPS' doesn't exist

 

select customers_group_id, customers_group_name from TABLE_CUSTOMERS_GROUPS order by customers_group_id

 

I install this version http://addons.oscommerce.com/info/8999 (only), the question is I need install another thing?

 

Because when I see my database I don't see the table

 

Thanks, and sorry my english :P

Share this post


Link to post
Share on other sites

@@bedto it looks like you don't have separate price per customer group install. SPPC would have installed this table (and other tables used in SPPC).

 

There is a version of this addon for those without SPPC - just search the addon area.

Share this post


Link to post
Share on other sites

installed and working fine, except 1 thing, how can i turn off the price (other than retail) ?

 

if i empty the text field content of price, the product price become zero. it should display the price of retail instead.

 

I'm using quick price update for 2.3.3.2

 

and thank you @@greasemonkey for all the good work for this community.

Edited by Psytanium

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×