Excused for my English.
I have installed this contribution :Quick Price Updates (by Category)
http://www.oscommerce.com/community/contri...ons,700/page,20
I have only 2 categories:Retail and Commercianti
This contribution it allows to only change the price Retail :(
I would want to change also to the price Commercianati
You can help me? B) B) www.fiorucciricambi.it
<?php
include('includes/application_top.php');
// category drop down
$sql3 = mysql_query("SELECT categories_id, categories_name FROM categories_description ORDER BY categories_name");
?>
<?php
if ($action == "category") {
echo "<form name=\"update\" method=\"post\" action=\"".$_SERVER["PHP_SELF"]."?action=update_prices\">";
echo "<table>";
echo "<tr><th>Product ID</th><th>Product Name</th><th>Prezzo privati</th><th>Prezzo Commercio</th></tr><tr>";
$result = mysql_query("SELECT * FROM products, products_description, products_to_categories WHERE products_to_categories.categories_id = $option AND products_to_categories.products_id = products.products_id AND products.products_id = products_description.products_id");
if ($row = mysql_fetch_array($result)) {
do {
echo "<td align=\"center\">".$row["products_id"]."</td>\n";
echo "<td>".$row["products_name"]."</td>\n";
echo "<td align=\"center\"><input type=\"text\" name=\"product_new_price[".$row['products_id']."]\" value={$row['products_price']}></td>\n";
echo "</tr>\n";
}
while($row = mysql_fetch_array($result));
}
echo "</table>\n";
echo "<br><input type=\"submit\" value=\"Update Prices\">";
echo "</form>";
}
?>
<?php
if ($action == "update_prices") {
foreach($HTTP_POST_VARS['product_new_price'] as $id => $new_price) {
mysql_query("UPDATE products SET products_price=$new_price WHERE products_id=$id");
}
$random = date("U");
echo "<p><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\"><b>Prices Updated</b></font></p>";
echo "<p><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\">Your price list for this Category has been updated.</p>";
echo "<p><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\">Click <a href=\"$PHP_SELF?$random\">here to Update</a> prices in a different category.</font></p>";
exit;
}
?>
<html>
<head>
<title>Product Quick Add</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
th { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; background-color: #eeeeee}
table { border: #666666; border-style: dashed; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px}
td { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small; padding-top: 3px; padding-bottom: 3px; padding-left: 5px}
td.left { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small; padding-top: 3px; padding-bottom: 3px; padding-left: 5px; text-align: right; padding-right: 16px}
-->
</style>
</head>
<body bgcolor="#FFFFFF">
<table>
<tr>
<th>Choose Category to update prices</td>
</tr>
<tr>
<td>
<?php
if(mysql_num_rows($sql3)) {
while($row = mysql_fetch_row($sql3)) {
print("<a href=\"".$_SERVER["PHP_SELF"]."?action=category&option={$row[0]}\">$row[1]</a><br>");
}
}
?>
</td>
</tr>
</table>
</form>
</body>
</html>