Jump to content



Photo
* * * * * 1 votes

CONTRIBUTION Product Quick Edit


  • Please log in to reply
105 replies to this topic

#1   spooks

spooks
  • Members
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 09 June 2008 - 18:21

Product Quick Edit

This contribution let's you edit products much quicker than going through the categories menu, by searching for the product name, Short Description (if you have that), model (sku), or id.

Items displayed on search now include, SKU/Model, ID, Name, Short Description (if you have that), Price and Stock

In edit you can alter Products Name, Stock status, Tax Class, Net Price, Gross Price, Description, Short Description (if you have that), Quantity (can be disabled), SKU/Model, Image.




Contribution is at: http://addons.oscommerce.com/info/5680
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Contributions:


Auto Backup your Database, Easy way

Multi Images with Fancy Pop-ups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#2   ContemptInc

ContemptInc
  • Members
  • 3 posts
  • Real Name:Alex X
  • Gender:Male
  • Location:Walhalla

Posted 10 June 2008 - 07:12

Thank you for this addon , is very helpfull for me . Though , i have some problems . I managed install it , i have run an alternate mysql command and I replaced pd.short_desc with p.short_desc to get it work . Now , when i search for a product , it displays duplicates . For example , i have only one product and it display three. (doesn't matter which is the product) Here are my files :


product_quickedit.php

<?php/*  $Id: categories.php,v 1.146 2003/07/11 14:40:27 hpdl Exp $  osCommerce, Open Source E-Commerce Solutions  [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]  Copyright © 2003 osCommerce  Released under the GNU General Public License*/  require('includes/application_top.php');  require(DIR_WS_CLASSES . 'currencies.php');  $currencies = new currencies();$pID = 0;if (isset($HTTP_GET_VARS['pID'])) $pID = $HTTP_GET_VARS['pID'];$short=false; // set this to true if you have the short description mod		  $prod_search = "";//$prod_search = $_REQUEST['prod_search'];//if($prod_search=="")//{if(isset($HTTP_GET_VARS['pSearch'])) {		$prod_search = $HTTP_GET_VARS['pSearch'];	}//}if($_REQUEST['prod_search']!="" || $prod_search !=""){  	  if ($prod_search == "") $prod_search = $_REQUEST['prod_search'];	  $product_query = tep_db_query("select pd.products_name, " . ($short ? 'p.short_desc, ' : '') . "p.products_id, p.products_status, p.products_quantity, p.products_price, p.products_model, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and (pd.products_name like '%".$prod_search."%'  or p.products_model like '%".$prod_search."%' or p.products_id like '%".$prod_search."%' or p.short_desc like '%".$prod_search."%') order by pd.products_name");}else{ }?><!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 language="javascript" src="includes/general.js"></script></head><body onload="SetFocus();"><div id="spiffycalendar" class="text"></div><!-- header //--><?php require(DIR_WS_INCLUDES . 'header.php'); ?><!-- header_eof //--><!-- body //--><!-- body_text //--><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>		  <td width="100%" valign="top" >			<table border="0" width="100%" cellspacing="0" cellpadding="0">				<tr>					<td class="pageHeading">Quick Edit Products</td>					<form name="search_products" method="POST" action="product_quickedit.php"><!-- product_quickedit.php -->					<td class="smallText" align="right" valign="top"> &nbsp;&nbsp;&nbsp;(search by Name or SKU/ID)					<input type="text" name="prod_search" value="%">&nbsp;					<input type="submit" name="search" value="Search">&nbsp;Just Click to list all					<?php echo tep_draw_separator('pixel_trans.gif', '1', '1'); ?>					</td>					</form>			  </tr>				<?php				if($_REQUEST['Update']=="Success")				{				?>				<tr><td><font color="#FF3333">Record has been updated successfully</font></td></tr>				<?php				}				?>					<tr>					<td valign="top" colspan="2">	<form name="form1" method="POST" action="product_quickedit.php">						<table border="0" width="100%" cellspacing="0" cellpadding="2">							<tr class="dataTableHeadingRow">								<td class="dataTableHeadingContent" width="8%">Model</td>								<td class="dataTableHeadingContent" width="5%">ID</td>								<td class="dataTableHeadingContent" width="45%">Name</td>								<td class="dataTableHeadingContent" width="8%"></td>								<td class="dataTableHeadingContent" width="8%">Price</td>								<td class="dataTableHeadingContent" width="8%">Stock</td>								<td class="dataTableHeadingContent" width="8%">Edit</td>							</tr>							<?php										  if (!$product_query) {										  } else {							$i=0;while($product = tep_db_fetch_array($product_query))							{$i++;							 							echo '<tr valign="top"' . ($pID == $product['products_id'] ? 'bgcolor="#9999ff"' : (((int)($i/2)*2) == $i ? 'bgcolor="#DFE4F4"' : '')) . '>';							?>							<td  valign="top" class="dataTableContent"><?php echo $product['products_model'];?></td>							<td  width="5%" valign="top" class="dataTableContent"><?php echo $product['products_id'];?></td>							<?php echo '<td  width="45%" valign="top" class="dataTableContent">' . 															'<b>' . $product['products_name'] . '</b>' . ($short ? '<br>' . $product['short_desc'] : '');															?>							</td>							<td width="10%" valign="top" class="dataTableContent"></td>							<td width="10%" valign="top" class="dataTableContent"><?php echo $currencies->display_price($product['products_price'], tep_get_tax_rate($product['products_tax_class_id'])); ?></td>							<td width="10%" valign="top" class="dataTableContent"><?php echo $product['products_quantity']; ?></td>							<td width="10%" valign="top" class="dataTableContent"><a href="product_quickedit_info.php?pID=<?php echo $product['products_id'] . "&prod_search=" . $prod_search; ?>">Edit</a></td>							</tr>							<?php							}							}							?>							</table>							</form>					 </td>				  </tr>				</table>			</td>		</tr></table><!-- body_text_eof //--><!-- body_eof //--><!-- footer //--><?php require(DIR_WS_INCLUDES . 'footer.php'); ?><!-- footer_eof //--><br></body></html><?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>


product_quickedit_info.php


Edited by ContemptInc, 10 June 2008 - 07:15.

begin . What does not kill me makes me stronger . die();

Contempt is teh brain, Furian is da muscle. Respect ma authorita!!!


#3   spooks

spooks
  • Members
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 10 June 2008 - 17:47

Sorry, I should have tested more but someone was keen to have this. As you can tell I Have lots of extra mods on my sites, so its remembering to allow for them all when I do a contrib.

If you change the query in product_quickedit.php to:

$product_query = tep_db_query("select distinct pd.products_name, " . ($short ? 'pd.short_desc, ' : '') . "p.products_id, p.products_status, p.products_quantity, p.products_price, p.products_model, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and (pd.products_name like '%".$prod_search."%' or p.products_model like '%".$prod_search."%' or p.products_id like '%".$prod_search."%' " .($short ? "or pd.short_desc like '%".$prod_search."%'" : "")." ) order by pd.products_name");

That should fix it for you.

I have made further changes already including a preview function, but it may take a little while before its safe to release.

/blush.gif' class='bbc_emoticon' alt=':blush:' />
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Contributions:


Auto Backup your Database, Easy way

Multi Images with Fancy Pop-ups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#4   ContemptInc

ContemptInc
  • Members
  • 3 posts
  • Real Name:Alex X
  • Gender:Male
  • Location:Walhalla

Posted 11 June 2008 - 08:29

Yes , it's fixed. Thank you spooks.

LE : The same thing it's happening in product_quickedit_info.php . The edit formular is displayed twice , also .
I tried to fix it , but didn't succeed.

Edited by ContemptInc, 11 June 2008 - 08:36.

begin . What does not kill me makes me stronger . die();

Contempt is teh brain, Furian is da muscle. Respect ma authorita!!!


#5   spooks

spooks
  • Members
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 11 June 2008 - 16:35

Yes , it's fixed. Thank you spooks.

LE : The same thing it's happening in product_quickedit_info.php . The edit formular is displayed twice , also .
I tried to fix it , but didn't succeed.


Ahh, this is an old bug, quick edit is not multi-lingual, so if you have more than one language active, it will show an edit window for each, BUT each window will be default language!!

Do`nt worry I`ve already fixed this by making it truely multi-lingual for edits, this will appear in the next release.

/cool.gif' class='bbc_emoticon' alt='B)' />
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Contributions:


Auto Backup your Database, Easy way

Multi Images with Fancy Pop-ups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#6   spooks

spooks
  • Members
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 13 June 2008 - 23:05

Uploaded New Version 2.0

This edition involved a large amount of re-writing code and removal of some redunant stuff, also fixed is a bug from my last release.

Major new additions are: Now Multi-Lingual for edits, added preview function, added image browse/upload function, you can now also delete a product image should you wish.
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Contributions:


Auto Backup your Database, Easy way

Multi Images with Fancy Pop-ups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#7   JangoF

JangoF
  • Members
  • 258 posts
  • Real Name:John Doe #597

Posted 14 June 2008 - 10:08

I never expected to see my little contribution getting so many post fixes/releases, that's nice to see.

I realize that when I first added the initial release, a lot of things were missing and/or could cause problems for vanilla users, because I use such a heavily modded store. I don't even use the left admin menu, but a horizontal top menu.

But I just wanted to drop in and say thanks to everyone for keeping it alive. Especially Sam/spooks here. Btw, I am also a huge fan of Blade Runner! /cool.gif' class='bbc_emoticon' alt='B)' />

#8   Coopco

Coopco
  • Members
  • 9,557 posts
  • Real Name:Leslie Cooper
  • Gender:Male
  • Location:Sea Lake, Victoria, Australia

Posted 14 June 2008 - 12:43

Uploaded New Version 2.0

This edition involved a large amount of re-writing code and removal of some redunant stuff, also fixed is a bug from my last release.

Major new additions are: Now Multi-Lingual for edits, added preview function, added image browse/upload function, you can now also delete a product image should you wish.


Hi Sam

Easy to install and works well. Thanks to you and original author.


The Coopco Underwear Shop



If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

#9   damdamletouffu

damdamletouffu
  • Members
  • 14 posts
  • Real Name:Damien
  • Gender:Male
  • Location:Paris, France

Posted 16 June 2008 - 14:06

Hi,

Just to say i've installed old version and now the new one....

Thank you very much... It works as well as we hoped!

#10   ContemptInc

ContemptInc
  • Members
  • 3 posts
  • Real Name:Alex X
  • Gender:Male
  • Location:Walhalla

Posted 17 June 2008 - 10:04

Thank you Spooks for the update, you worth all the congrats. /wink.gif' class='bbc_emoticon' alt=';)' />

begin . What does not kill me makes me stronger . die();

Contempt is teh brain, Furian is da muscle. Respect ma authorita!!!


#11   spirt

spirt
  • Members
  • 3 posts
  • Real Name:Ivan

Posted 17 July 2008 - 22:44

Thanks for the great contribution!
Please help me to do something. I want to add a button "Update all price". When u press it, it updates the price of all products in the table.
Thanks!

Edited by spirt, 17 July 2008 - 22:44.


#12   carryG

carryG
  • Members
  • 125 posts
  • Real Name:Carry G
  • Gender:Female
  • Location:USA

Posted 12 August 2008 - 18:14

Greetings. Great contribution!

We have successfully installed this mod, but need changes..

We have a three images mod installed for products I coded what I could to see the three images input fields in quick edit, but it won't even upload one of them now. Is there a way to easily add 1 - 3 images using this mod?

Also adding the weight field and UPC field or editing?

Also, it would be really neat if you could select three images (or one or whatever), hit preview and it just saves instead of having to do the duplicate step of preview then update.

Lastly the three meta fields (ideally, someone could select and deselect what they want to show in quickedit fields based on prepopulated fields from database...

I would donate money for these fixes...

Cary

Edited by carryG, 12 August 2008 - 18:24.


#13   spooks

spooks
  • Members
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 12 August 2008 - 18:22

what three images mod is it, there are many image contribs.
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Contributions:


Auto Backup your Database, Easy way

Multi Images with Fancy Pop-ups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#14   carryG

carryG
  • Members
  • 125 posts
  • Real Name:Carry G
  • Gender:Female
  • Location:USA

Posted 12 August 2008 - 18:37

what three images mod is it, there are many image contribs.


The mod is (strangely named) Product picture in new style BEST:) located here: http://addons.oscommerce.com/info/3593

I like the layout, having three pictures to side of larger image, that is why I use it. If you know of an alternative that would work just as well...

Hope this helps!

#15   spooks

spooks
  • Members
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 12 August 2008 - 19:45

its possible, would need a little fiddling to get the images added, & weight is no problem but UPC? did you meen URL?

meta fields are not any standard part of osC, where did they come from?
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Contributions:


Auto Backup your Database, Easy way

Multi Images with Fancy Pop-ups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#16   carryG

carryG
  • Members
  • 125 posts
  • Real Name:Carry G
  • Gender:Female
  • Location:USA

Posted 12 August 2008 - 20:27

its possible, would need a little fiddling to get the images added, & weight is no problem but UPC? did you meen URL?

meta fields are not any standard part of osC, where did they come from?


UPC field
Meta Fields, hmm. I added mod: HeaderTags_SEO_V_3.0.2.zip http://addons.oscommerce.com/info/5851

PM me if you need to.

Cary

#17   spooks

spooks
  • Members
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 12 August 2008 - 20:32

I thought you might have ment something like that for meta, but still there is no UPC field??? Uniniversal Personal Carrierbag?? or ISBN? Contrib??

Edited by spooks, 12 August 2008 - 20:41.

Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Contributions:


Auto Backup your Database, Easy way

Multi Images with Fancy Pop-ups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#18   carryG

carryG
  • Members
  • 125 posts
  • Real Name:Carry G
  • Gender:Female
  • Location:USA

Posted 12 August 2008 - 20:43

I thought you might have ment something like that for meta, but still there is no UPC field??? Uniniversal Personal Carrierbag??


UPC numbers, SKUs, ISBN/ISSN mod: http://addons.oscommerce.com/info/126
(we use the UPC code Universal Parcel Code - it could be manufacturers stock number, etc)

#19   spooks

spooks
  • Members
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 12 August 2008 - 20:51

Ok, I thought it might be some americanism, called ISBN in the UK
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Contributions:


Auto Backup your Database, Easy way

Multi Images with Fancy Pop-ups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#20   carryG

carryG
  • Members
  • 125 posts
  • Real Name:Carry G
  • Gender:Female
  • Location:USA

Posted 12 August 2008 - 20:59

Ok, I thought it might be some americanism, called ISBN in the UK


lol - don't make us mad or we will bring democracy to a country near you....

(that's really not funny - i apologize...)