Zen Cart Logo
Forums / All Other Contributions/Addons / Quick Updates 2.0*

Quick Updates 2.0*

Locked

Views: 2,476

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
22 May 2007, 3:18 PM
#1
doodlebuckets avatar

doodlebuckets

Totally Zenned

Join Date:
Jul 2005
Posts:
497
Plugin Contributions:
0

Quick Updates 2.0*

Just wanted to pop in and say how much I love this contribution. It has saved me years of time, especially when a manufacturer issues a price change and I need to update 100's of products. Thanks so much to Paul Mathot for his fab contribution! Works like a charm :o)

Amy

22 May 2007, 5:15 PM
#2
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Quick Updates 2.0*

:blush: :blush:

Thanks for the nice words Amy :smile: And I love that contribution too :smartalec:

I must say though that that I am certainly not the only one that worked on quick updates. At least 2 other zenners have contributed to it. Portali converted it to Zen and also Andrews (a_berezin) work on it has been very usefull. And I think about 10-20 osC members worked on it earlier (although doubt if there is much osC code left in recent versions).

The developement of quick updates by so many people is a great example of the possibilities of open source software and the GPL licence.

For the fun I looked up the first version of quick updates. This was the whole (stand alone) script:

<?php
### --- quick_updates.php --- ###

$dbhost = ""; // database host
$dbuser = ""; // database username
$dbpassword = ""; // database password
$db2use = ""; // name of database

// opening database conx.
function dbconnect() {
    global $dbhost, $dbuser, $dbpassword, $db2use;
    $link = @mysql_connect($dbhost,$dbuser,$dbpassword) or die("Connection failed: Please try later.");
    @mysql_select_db($db2use,$link) or die("Connection to database refused: Please try later.");
    return $link;
}
?>
<?php
if ($action == "updateprices") {
    dbconnect();
    foreach($HTTP_POST_VARS['product_new_price'] as $id => $new_price) {
        mysql_query("UPDATE products SET products_price=$new_price WHERE products_id=$id");
    }
    echo "Your price list has been updated.";
    exit;
}
?>
<html>
<head>
<title>Update</title>
<style type="text/css">
<!--
h4 {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; text-align: center}
p {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small}
th {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small}
td {  font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small}
-->
</style>
<head>
<body>
<form name="update" method="post" action="<?php echo "$PHP_SELF?action=updateprices"; ?>">
<table width="550" border="1" cellspacing="1" bordercolor="gray">
<tr>
<td colspan="3">
<h4>Update</h4>
</td>
</tr>
<?
dbconnect();
    echo "<tr><th>Product ID</th><th>Product Name</th><th>Product Price</th></tr><tr>";
    $result = mysql_query("SELECT * FROM products, products_description WHERE products.products_id = products_description.products_id ORDER BY products.products_id");
    if ($row = mysql_fetch_array($result)) {
        do {
            echo "<td>".$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";
?>
<br>
<input type="submit" value="Update Prices">
</form>
</body>
</html>
```Simple, but very fast and effective!
25 May 2007, 11:54 AM
#3
doodlebuckets avatar

doodlebuckets

Totally Zenned

Join Date:
Jul 2005
Posts:
497
Plugin Contributions:
0

Re: Quick Updates 2.0*

Well, thanks to all 3 of you! I think it should be incorporated into a zen release, but that's just my humble opinion.

25 May 2007, 3:58 PM
#4
ingenuitor avatar

ingenuitor

New Zenner

Join Date:
Sep 2006
Posts:
13
Plugin Contributions:
0

Re: Quick Updates 2.0*

Yes this is a great mod.... one of the best yet. PM sent to you Paul.

6 Jun 2007, 12:32 PM
#5
doodlebuckets avatar

doodlebuckets

Totally Zenned

Join Date:
Jul 2005
Posts:
497
Plugin Contributions:
0

Re: Quick Updates 2.0*

Paul, I have a question for you. I have uploaded about 245 new products via .csv file from the manufacturer. But the images in the file are all wrong and I have had to do major revamping of my input data since Easy Populate boogered up many of my products with wrong prices, weights, etc. I have corrected all of those with your fabulous mod (THANK YOU!) but I shudder at the idea of trying to redo all those products through Easy Populate again just to have the same corrections to be made all over again.

OH PLEASE, is there a way through Quick Updates to alter the images for each product or am I going to have to go into each product individually to update the photos?

Amy