Quickly Update Product Stock
#141
Posted 14 May 2009 - 01:09 PM
#142
Posted 14 May 2009 - 01:31 PM
azrin_aris, on May 14 2009, 09:09 AM, said:
Thanks... That's cool. Wish I new enough PHP to write my own mods.
- My Toolbox ~ Adobe Web Bundle & WinMerge | Install ~ osCommerce
- Not 4 Hire ~ Please DO NOT PM me for help. I really do not have a clue what I am doing! -
- Working on a new 2.3.3 install -
#144
Posted 14 June 2009 - 10:46 AM
I just upgraded from 3.6 to 3.8.1 wonderful change!
Would it be possible to leave the default language other than English? For those who are using another language
Thank you very much for everything
#145
Posted 15 June 2009 - 11:02 PM
This is a great contri, thanks!!
But I also have the same problem as mentioned below. Did you have time to look into it?
Also default langauge other then English would be great.
Thanks,
Martin.
hanoman77, on Feb 22 2009, 11:03 PM, said:
I'm using this configuration for Currency Localization :
Decimal point : ,
Thousand point : .
When I update the price, the price went wrong. for example original price was 10000 it shows 10,000 in quick updater.
I update the stock, leave the price as it is. when i check the store, the price is 10, back to the updater, yup it's a 10.
I dont know a thing about php. To work this out i set the decimal and thousand point back to default.
Thx for this Azrin, its great.
#146
Posted 14 July 2009 - 01:59 AM
MartinvD, on Jun 15 2009, 08:02 PM, said:
This is a great contri, thanks!!
But I also have the same problem as mentioned below. Did you have time to look into it?
Also default langauge other then English would be great.
Thanks,
Martin.
Quote
Found a bug
I'm using this configuration for Currency Localization :
Decimal point : ,
Thousand point : .
When I update the price, the price went wrong. for example original price was 10000 it shows 10,000 in quick updater.
I update the stock, leave the price as it is. when i check the store, the price is 10, back to the updater, yup it's a 10.
I dont know a thing about php. To work this out i set the decimal and thousand point back to default.
Thx for this Azrin, its great.
Test this:
eliminate format_number and unformat_number into admin/quick_stockupdate.php
replace:
<td class="dataTableContent" align="center"><input type="text" size="<?php echo QUICK_STOCK_PRICESIZE ?>" name="stock_update[<?php echo $results['products_id'] ?>][price]" value="<?php echo number_format($results['products_price'],QUICK_STOCK_PRICEDEC,'.',','); ?>" onchange="<?php echo $doChange?>" onblur="<?php echo $doValidate_flt?>"></td>
by:
<td class="dataTableContent" align="center"><input type="text" size="<?php echo QUICK_STOCK_PRICESIZE ?>" name="stock_update[<?php echo $results['products_id'] ?>][price]" value="<?php echo $results['products_price'] ?>" onchange="<?php echo $doChange?>" onblur="<?php echo $doValidate_flt?>"></td>
AND
replace:
$items_price = number_unformat($items['price']);by:
$items_price = $items['price'];
For my work fine. Rights for you?
#147
Posted 14 July 2009 - 08:12 AM
PiLLaO, on Jun 14 2009, 12:46 PM, said:
I just upgraded from 3.6 to 3.8.1 wonderful change!
Would it be possible to leave the default language other than English? For those who are using another language
Thank you very much for everything
MartinvD, on Jun 16 2009, 01:02 AM, said:
This is a great contri, thanks!!
But I also have the same problem as mentioned below. Did you have time to look into it?
Also default langauge other then English would be great.
Thanks,
Martin.
while (list($key, $value) = each ($languages_list)) {
if($lang_id==$key){
$result .= '<option value="' . $key . '" selected="selected">' . $value . '</option>';
} else {
$result .= '<option value="' . $key . '">' . $value . '</option>';
} }
by while (list($key, $value) = each ($languages_list)) {
if($lang_id==$key){
$result .= '<option value="' . $key . '">' . $value . '</option>';
} else {
$result .= '<option value="' . $key . '" selected="selected">' . $value . '</option>';
} }
Spanish appears by default Thanks for that contrib!!
#148
Posted 14 July 2009 - 05:32 PM
The default language suggestion from PiLLaO didn't work for me, but thanks!
#149
Posted 20 August 2009 - 02:20 PM
I have problem with this cont.
Please can you help me...
Edited by jolie102003, 20 August 2009 - 02:21 PM.
#150
Posted 03 September 2009 - 10:06 AM
This is the right tool for updating products quickly.
But I have a problem with the price update:
When I enter a category, the products will be listed.
The price is listed with 8 decimal places, which is what I need and want to have.
The correct price of a product is for example "1.00840336".
Now, I want to change the price for example to "1.26050420", so I entered that numbers to the price field.
As soon as I left the field with tab, the price is rounded with 2 decimal places and displayed "1.26".
But I still need 8 decimal places.
So, my first problem is, how to disable the function to round the price and keep 8 decimal places.
Now my second problem:
When I press the update button, the former shown price with "1.26" is updated in the database and shows up with "126.00".
So I think, here is an error with the "," or "." and the complete size of digits, the field is able to handle.
IMHO, the code line, responsible for that, is this one:
<td class="dataTableContent" align="right"><input type="text" size="<?php echo QUICK_STOCK_PRICESIZE ?>" style="text-align: right;" name="stock_update[<?php echo $results['products_id'] ?>][price]" value="<?php echo number_format($results['products_price'],QUICK_STOCK_PRICEDEC,'.',','); ?>" onchange="<?php echo $doChange?>" onblur="<?php echo $doValidate_flt?>"></td>But I don't understand the full line of code, so I don't know what to change.
Hope I have given you enough information and hope, that someone of you experts can help me with these 2 problems.
Thanks for any help,
Regards
Andreas
PS: on my local system I have exact the same problem with the login as Jolie102003, so I'm look forward in solving that problem too.
The login appears as soon as a category is chosen, but the page appears with default settings after login again and again.
Edited by Andreas2003, 03 September 2009 - 10:09 AM.
#151
Posted 10 September 2009 - 07:15 PM
Or have I understand something wrong in using this tool?
#152
Posted 15 September 2009 - 09:42 AM
And I found out, why the values are stored so strange as described in my second problem.
There is a function included, so that the entry of the values depends on your country settings.
But IMHO the function is working strange.
On what country settings is the function depending?
Browser language, settings of osC admin, default language in osC?
I changed the first two (browser and admin language) and the entry of values is still only possible with a comma instead of a dot.
I learned, that the function is rewriting the values with a comma to a dot and write it into the DB.
But is it possible to disable that function (in the price field)?
All my calculations based on entering the values for the price with a dot, so I dont need this function.
And the function is causing another problem:
The values for the price are shown with dots.
But when you update the number of items in stock and update the item, the price-values with dot are written to the database as well, but the format gets screwed.
You have to rewrite the shown dots manually to comma and update then the whole thing.
Not very efficient.
Thank you in advance,
Regards
Andreas
Edited by Andreas2003, 15 September 2009 - 09:48 AM.
#153
Posted 22 September 2009 - 01:18 PM
I am getting the following error when using this contribution:
Warning: reset() [function.reset]: Passed variable is not an array or object in /home/mp3extra/public_html/admin/quick_stockupdate.php on line 205
Warning: Variable passed to each() is not an array or object in /home/mp3extra/public_html/admin/quick_stockupdate.php on line 206
This just repeats itself down the page. Any ideas what is the problem ?
Even with this it seems to work fine still ?
Thanks,
Eddy
#154
Posted 25 September 2009 - 04:59 AM
The following code works to update the columns in table 'products' but can someone help me modify the following SQL UPDATE code to add the proper code to also update field 'products_name' from table 'products_description'? I've tried, but I can't figure out how to get it to work.
$sql = "UPDATE products SET products_quantity = '".$current_stock."', products_model = '".$items['model']."', products_price = '".$items_price."', products_weight = '".$items['weight']."', products_length = '".$items['length']."', products_width = '".$items['width']."', products_height = '".$items['height']."', manufacturers_id = '".$items['manufacturer']."', products_status = '".$items['active']."' WHERE products_id = $key";
Code that I tried, that didn't work:
$sql = "UPDATE products, products_description SET products.products_quantity = '".$current_stock."', products.products_model = '".$items['model']."', products.products_price = '".$items_price."', products.products_weight = '".$items['weight']."', products.products_length = '".$items['length']."', products.products_width = '".$items['width']."', products.products_height = '".$items['height']."', products.manufacturers_id = '".$items['manufacturer']."', products.products_status = '".$items['active']."', products_description.products_name = '".$items['name']."' WHERE products_id = $key";
here's the syntax for the SELECT query
$sql = tep_db_query("SELECT p.products_model, p.products_id, p.products_quantity, p.products_status, p.products_weight, p.products_length, p.products_width, p.products_height, p.products_price, p.manufacturers_id, pd.products_name, pd.language_id, ptc.categories_id 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 ptc.categories_id = '" . $sel_id . "' and pd.language_id = '" . (int)$lang_id . "' order by pd.products_name");
and
<tr class="dataTableRow"> <td class="dataTableContent" align="center"><input type="CHECKBOX" name="stock_update[<?php echo $results['products_id'] ?>][changed]"> <input type="HIDDEN" name="stock_update[<?php echo $results['products_id'] ?>][ptc]" value="<?php echo $results['categories_id'] ?>"></td> <td class="dataTableContent" align="center"><?php echo $results['products_id'] ?></td> <td class="dataTableContent" align="center"><input type="text" size="<?php echo QUICK_STOCK_MODELSIZE ?>" name="stock_update[<?php echo $results['products_id'] ?>][model]" value="<?php echo $results['products_model'] ?>" onchange="<?php echo $doChange?>"></td> <td class="dataTableContent" align="center"><?php echo $catman_select?></td> <td class="dataTableContent" align="left" ><input type="text" size="<?php echo QUICK_STOCK_PRODUCTNAMESIZE ?>" name="stock_update[<?php echo $results['products_id'] ?>][name]" value="<?php echo $results['products_name'] ?>" onchange="<?php echo $doChange?>"></td> <td class="dataTableContent" align="center"><input type="text" size="<?php echo QUICK_STOCK_WEIGHTSIZE ?>" name="stock_update[<?php echo $results['products_id'] ?>][weight]" value="<?php echo $results['products_weight'] ?>" onchange="<?php echo $doChange?>" onblur="<?php echo $doValidate_flt?>"></td> <td class="dataTableContent" align="center"><input type="text" size="<?php echo QUICK_STOCK_LENGTHSIZE ?>" name="stock_update[<?php echo $results['products_id'] ?>][length]" value="<?php echo $results['products_length'] ?>" onchange="<?php echo $doChange?>" onblur="<?php echo $doValidate_flt?>"></td> <td class="dataTableContent" align="center"><input type="text" size="<?php echo QUICK_STOCK_WIDTHSIZE ?>" name="stock_update[<?php echo $results['products_id'] ?>][width]" value="<?php echo $results['products_width'] ?>" onchange="<?php echo $doChange?>" onblur="<?php echo $doValidate_flt?>"></td> <td class="dataTableContent" align="center"><input type="text" size="<?php echo QUICK_STOCK_HEIGHTSIZE ?>" name="stock_update[<?php echo $results['products_id'] ?>][height]" value="<?php echo $results['products_height'] ?>" onchange="<?php echo $doChange?>" onblur="<?php echo $doValidate_flt?>"></td> <td class="dataTableContent" align="center"><input type="text" size="<?php echo QUICK_STOCK_PRICESIZE ?>" name="stock_update[<?php echo $results['products_id'] ?>][price]" value="<?php echo number_format($results['products_price'],QUICK_STOCK_PRICEDEC,'.',','); ?>" onchange="<?php echo $doChange?>" onblur="<?php echo $doValidate_flt?>"></td> <td class="dataTableContent" align="center"><?php echo $results['products_quantity'] ?><input type="hidden" size="4" name="stock_update[<?php echo $results['products_id'] ?>][oldstock]" value="<?php echo $results['products_quantity'] ?>" onchange="<?php echo $doChange?>"></td> <td class="dataTableContent" width = "50px" align="center"><input type="text" size="<?php echo QUICK_STOCK_STOCKSIZE ?>" name="stock_update[<?php echo $results['products_id'] ?>][newstock]" value="0" onchange="<?php echo $doChange?>" onblur="<?php echo $doValidate_int?>"></td> <td class="dataTableContent" align="center" ><input type="radio" name="stock_update[<?php echo $results['products_id'] ?>][active]" value="1" <?php echo $active ?> onclick="<?php echo $doChange?>"></td> <td class="dataTableContent" align="center" ><input type="radio" name="stock_update[<?php echo $results['products_id'] ?>][active]" value="0" <?php echo $inactive ?> onclick="<?php echo $doChange?>"></td> </tr>
#155
Posted 25 September 2009 - 02:22 PM
TropicalWebDesign, on Sep 25 2009, 12:59 AM, said:
The following code works to update the columns in table 'products' but can someone help me modify the following SQL UPDATE code to add the proper code to also update field 'products_name' from table 'products_description'? I've tried, but I can't figure out how to get it to work.
$sql = "UPDATE products SET products_quantity = '".$current_stock."', products_model = '".$items['model']."', products_price = '".$items_price."', products_weight = '".$items['weight']."', products_length = '".$items['length']."', products_width = '".$items['width']."', products_height = '".$items['height']."', manufacturers_id = '".$items['manufacturer']."', products_status = '".$items['active']."' WHERE products_id = $key";
Code that I tried, that didn't work:
$sql = "UPDATE products, products_description SET products.products_quantity = '".$current_stock."', products.products_model = '".$items['model']."', products.products_price = '".$items_price."', products.products_weight = '".$items['weight']."', products.products_length = '".$items['length']."', products.products_width = '".$items['width']."', products.products_height = '".$items['height']."', products.manufacturers_id = '".$items['manufacturer']."', products.products_status = '".$items['active']."', products_description.products_name = '".$items['name']."' WHERE products_id = $key";
here's the syntax for the SELECT query
$sql = tep_db_query("SELECT p.products_model, p.products_id, p.products_quantity, p.products_status, p.products_weight, p.products_length, p.products_width, p.products_height, p.products_price, p.manufacturers_id, pd.products_name, pd.language_id, ptc.categories_id 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 ptc.categories_id = '" . $sel_id . "' and pd.language_id = '" . (int)$lang_id . "' order by pd.products_name");
and
<tr class="dataTableRow"> <td class="dataTableContent" align="center"><input type="CHECKBOX" name="stock_update[<?php echo $results['products_id'] ?>][changed]"> <input type="HIDDEN" name="stock_update[<?php echo $results['products_id'] ?>][ptc]" value="<?php echo $results['categories_id'] ?>"></td> <td class="dataTableContent" align="center"><?php echo $results['products_id'] ?></td> <td class="dataTableContent" align="center"><input type="text" size="<?php echo QUICK_STOCK_MODELSIZE ?>" name="stock_update[<?php echo $results['products_id'] ?>][model]" value="<?php echo $results['products_model'] ?>" onchange="<?php echo $doChange?>"></td> <td class="dataTableContent" align="center"><?php echo $catman_select?></td> <td class="dataTableContent" align="left" ><input type="text" size="<?php echo QUICK_STOCK_PRODUCTNAMESIZE ?>" name="stock_update[<?php echo $results['products_id'] ?>][name]" value="<?php echo $results['products_name'] ?>" onchange="<?php echo $doChange?>"></td> <td class="dataTableContent" align="center"><input type="text" size="<?php echo QUICK_STOCK_WEIGHTSIZE ?>" name="stock_update[<?php echo $results['products_id'] ?>][weight]" value="<?php echo $results['products_weight'] ?>" onchange="<?php echo $doChange?>" onblur="<?php echo $doValidate_flt?>"></td> <td class="dataTableContent" align="center"><input type="text" size="<?php echo QUICK_STOCK_LENGTHSIZE ?>" name="stock_update[<?php echo $results['products_id'] ?>][length]" value="<?php echo $results['products_length'] ?>" onchange="<?php echo $doChange?>" onblur="<?php echo $doValidate_flt?>"></td> <td class="dataTableContent" align="center"><input type="text" size="<?php echo QUICK_STOCK_WIDTHSIZE ?>" name="stock_update[<?php echo $results['products_id'] ?>][width]" value="<?php echo $results['products_width'] ?>" onchange="<?php echo $doChange?>" onblur="<?php echo $doValidate_flt?>"></td> <td class="dataTableContent" align="center"><input type="text" size="<?php echo QUICK_STOCK_HEIGHTSIZE ?>" name="stock_update[<?php echo $results['products_id'] ?>][height]" value="<?php echo $results['products_height'] ?>" onchange="<?php echo $doChange?>" onblur="<?php echo $doValidate_flt?>"></td> <td class="dataTableContent" align="center"><input type="text" size="<?php echo QUICK_STOCK_PRICESIZE ?>" name="stock_update[<?php echo $results['products_id'] ?>][price]" value="<?php echo number_format($results['products_price'],QUICK_STOCK_PRICEDEC,'.',','); ?>" onchange="<?php echo $doChange?>" onblur="<?php echo $doValidate_flt?>"></td> <td class="dataTableContent" align="center"><?php echo $results['products_quantity'] ?><input type="hidden" size="4" name="stock_update[<?php echo $results['products_id'] ?>][oldstock]" value="<?php echo $results['products_quantity'] ?>" onchange="<?php echo $doChange?>"></td> <td class="dataTableContent" width = "50px" align="center"><input type="text" size="<?php echo QUICK_STOCK_STOCKSIZE ?>" name="stock_update[<?php echo $results['products_id'] ?>][newstock]" value="0" onchange="<?php echo $doChange?>" onblur="<?php echo $doValidate_int?>"></td> <td class="dataTableContent" align="center" ><input type="radio" name="stock_update[<?php echo $results['products_id'] ?>][active]" value="1" <?php echo $active ?> onclick="<?php echo $doChange?>"></td> <td class="dataTableContent" align="center" ><input type="radio" name="stock_update[<?php echo $results['products_id'] ?>][active]" value="0" <?php echo $inactive ?> onclick="<?php echo $doChange?>"></td> </tr>
#156
Posted 28 September 2009 - 12:05 PM
homewetbar, on Mar 20 2005, 08:12 PM, said:
Contribution:
http://www.oscommerce.com/community/contributions,558
A very good contribution.
However, I get a Internal Server Error (500) when trying to view certain manufacturers. (In my experience this usually means that a SQL statement is failing somewhere.) It doesn't happen on all manufacturers, and I think it may be to do with the number of products as it fails on the large manufacturers. (Those with >200 products). Anyone have a quick fix for this, or am I looking entirely in the wrong place... and the error is to do with something else.
Thanks,
-Phill.
#157
Posted 12 October 2009 - 08:17 PM
Andreas2003, on 03 September 2009 - 10:06 AM, said:
This is the right tool for updating products quickly.
But I have a problem with the price update:
When I enter a category, the products will be listed.
The price is listed with 8 decimal places, which is what I need and want to have.
The correct price of a product is for example "1.00840336".
Now, I want to change the price for example to "1.26050420", so I entered that numbers to the price field.
As soon as I left the field with tab, the price is rounded with 2 decimal places and displayed "1.26".
But I still need 8 decimal places.
So, my first problem is, how to disable the function to round the price and keep 8 decimal places.
Now my second problem:
When I press the update button, the former shown price with "1.26" is updated in the database and shows up with "126.00".
So I think, here is an error with the "," or "." and the complete size of digits, the field is able to handle.
IMHO, the code line, responsible for that, is this one:
<td class="dataTableContent" align="right"><input type="text" size="<?php echo QUICK_STOCK_PRICESIZE ?>" style="text-align: right;" name="stock_update[<?php echo $results['products_id'] ?>][price]" value="<?php echo number_format($results['products_price'],QUICK_STOCK_PRICEDEC,'.',','); ?>" onchange="<?php echo $doChange?>" onblur="<?php echo $doValidate_flt?>"></td>But I don't understand the full line of code, so I don't know what to change.
Hope I have given you enough information and hope, that someone of you experts can help me with these 2 problems.
Thanks for any help,
Regards
Andreas
PS: on my local system I have exact the same problem with the login as Jolie102003, so I'm look forward in solving that problem too.
The login appears as soon as a category is chosen, but the page appears with default settings after login again and again.
to Andreas2003
did you solve the problem with back to login panel?
Regards
jolie102003
#158
Posted 19 October 2009 - 11:14 AM
jolie102003, on 12 October 2009 - 08:17 PM, said:
did you solve the problem with back to login panel?
Regards
jolie102003
No, not yet.
IMHO the login problem is based on a cookie issue.
On my local server, I have some problems with cookies, on my productive site not.
The contribution works well on productive, not on the local server, so my suggestion, that the problems have to do with cookie handling.
This is the only help/hint, I can give you right now, I'm sorry.
As soon as I found out more, I write again.
#159
Posted 19 October 2009 - 06:34 PM
Andreas2003, on 19 October 2009 - 11:14 AM, said:
IMHO the login problem is based on a cookie issue.
On my local server, I have some problems with cookies, on my productive site not.
The contribution works well on productive, not on the local server, so my suggestion, that the problems have to do with cookie handling.
This is the only help/hint, I can give you right now, I'm sorry.
As soon as I found out more, I write again.
Are you sure, that it's connected with cookie?
a thought that with
1. Add "Title" tag to Category/Manufacture selector to show its category/manufacture id -
BugFix:
1. MySQL not updating if manufactures_id is not set when MySQL is configures as 'STRICT' -
<http://addons.oscommerce.com/info/558>
Brgs
#160
Posted 20 October 2009 - 10:43 PM
i have a store that sells tshirts...is there a way to edit the quantity of individual attributes? for instance if i have a VanHalen shirt it comes in S, M, L, XL....total inventory might be 120 shirts but i need to be able to edit quantity of each size...im also using QTpro for the attributes...any suggestions?
thanks!
azrin_aris, on 14 May 2009 - 01:09 PM, said:









