This is a patch that adds hook_nodeapi to the uc_stock module so that node updates, inserts, deletes, loads & views for product nodes also include stock data.

This is very useful if you are importing products using node_save and you have stock data in your import csv, among other things.

The patch also has some changes to uc_product, which work with the new uc_stock nodeapi code to allow the stock levels to be displayed when viewing products. The quantity available is now a selectable field in the product settings page (admin/store/settings/products).
This allows users to see how much of a product is in stock. It can also be themed so that if the qty is zero it displays a message saying that there will be a delivery delay or something like that.

Comments

rszrama’s picture

Version: 5.x-1.4 » 5.x-1.6
Status: Needs review » Needs work

The problem I see with this patch is that we don't have a 1 to 1 correlation between product nodes and SKUs. This code assumes the node will have a single stock value, whereas a product with multiple SKUs and different stock levels would be left in the cold. I'm not opposed to the concept here, I just don't think this accommodates core well enough.

rszrama’s picture

Version: 5.x-1.6 » 6.x-2.x-dev
Status: Needs work » Postponed
agileware’s picture

StatusFileSize
new7.43 KB

Here is a new version of this patch that works for 6.x-2.0-beta5.

It still doesn't have support for products with multiple sku's though. I'll have a look into that at some point.

agileware’s picture

Can this please be considered for Ubercart 3? Added to the battle plans.

Cheers
Justin

rich.yumul’s picture

Subscribing...

hanoii’s picture

Issue tags: +uc_stock

adding tags

hanoii’s picture

Not exactly the same issue, but this one might be a bit too wide.

Have a look at the related issue #423262: Stock information not deleted with node

tr’s picture

Version: 6.x-2.x-dev » 7.x-3.x-dev
Status: Postponed » Needs work
tr’s picture

Component: Code » Stock
Issue tags: -uc_stock

Changing component.

Sindbad-1’s picture

Hi,

My requirement is to be able to display the Stock level on the Product node. I did apply the patch mentioned in #3, I did it manually by updating the necessary files. I have set the appropriate role permission as well. Under Store Administration->Configuration->Product Fields, I have enabled "Available Stock Qty". However, I still can't view the stock levels on the Product page.

Do I have to do anything else? This is quite urgent. Any help is greatly appreciated.

Thanks.

smartango’s picture

would you revise this: #1398448: stock sku consistency on node update/delete
it is (would be) a solution for ubercart 7.x-3.x-dev