8 replies [Last post]
uaneme's picture
Offline
Joined: 01/30/2010
Juice: 41
Was this information Helpful?

For the Stock module / An option that sets stock activation on for all new products by default.

Right now, after i added a product i need to go to stock, activate it an set it to 1. (and not forget this because i cannot see ANYWHERE globally what/if products are all active)
Everything ia add i am adding because i DO have it in stock.

So such option would not only save me 4 click and some time, but also saves me the hassle of figuring out if i didn't forget to set it.. because i only can check it by clicking Edit > Stock and see if it is active.

zeezhao's picture
Offline
Joined: 04/23/2008
Juice: 969
Re: For the Stock module / An option that sets stock activation

In the interim, you can update manually via a database query e.g. something like this example query should setup all products with a default stock of 1...

insert into uc_product_stock(sku, nid , active, stock,threshold)
select model, nid, 1, 1, 0 from uc_products

uaneme's picture
Offline
Joined: 01/30/2010
Juice: 41
Re: Re: For the Stock module / An option that sets stock activat

thanks zeezhao

2dogrc's picture
Offline
Joined: 03/12/2010
Juice: 87
zeezhao wrote: In the
zeezhao wrote:

In the interim, you can update manually via a database query e.g. something like this example query should setup all products with a default stock of 1...

insert into uc_product_stock(sku, nid , active, stock,threshold)
select model, nid, 1, 1, 0 from uc_products

What would it be if you already have some products in, but just added a BUNCH more! When I ran the code it said duplicate entry. Could you edit that SQL to ship entries if they are all ready in the uc_product_stock table?

woof
Thanx

James Peck's picture
Offline
Joined: 10/20/2010
Juice: 51
Re: zeezhao wrote: In the

Big thanks for sharing - saved a potential nightmare of a task!

doomhammer's picture
Offline
Joined: 05/18/2011
Juice: 3
no dupes

Had the same Problem and used the following sql-statement to solve it

insert into uc_product_stock(sku, nid , active, stock,threshold)
select model, nid, 1, 1, 10 from uc_products
where model NOT IN (select sku from uc_product_stock)

pls notice that i set the threshold to 10 for good measure Smiling

bwv
bwv's picture
Offline
Uber DonorBug FinderEarly adopter... addicted to alphas.Spreading the word - Ubercart for president.
Joined: 08/07/2007
Juice: 417
Re: no dupes

Hello, would you please provide the exact SQL statement that you used? I have 4000 products I need to update stock levels for (all single products) . Each needs to be marked active, and have a stock level of 1 and a threshold level of 1. I would be very grateful if you could show me the statement I need to use. thanks, david

hosais's picture
Offline
Joined: 01/02/2010
Juice: 66
This is very useful. Thanks!

Thanks you very much Zeezhao.

I am very lucky to know this useful method because of uaneme's post. Thank you uaneme too.

Hosais

uaneme's picture
Offline
Joined: 01/30/2010
Juice: 41
Re: This is very useful. Thanks!

You are welcome Smiling

It would be great to have some kind of Orphan Stock button that can show what stock isn't activated or 0 stock, and a select all function + setting to activate all non active stock and set it to x number of stock.

All in good time ofcourse...