Tags/topics: 
1
Answers
Vote up!
0
Vote down!

Updating stock using preprocess

Hi, I am developing a site for a client with an EPOS system, and ideally I'd need to check stock value on page load.

Is this possible? My initial attempts using preprocess_node altered the stock value in the database, but I'm not sure what I'd need to set in $variables to display that change on the page (particularly in terms of add to cart/sold out messages). Just wondering if someone could point me in the right direction?

Asked by: Pfriedo
on September 25, 2012

1 Answer

Vote up!
1
Vote down!

I believe stock is simply a fancy field that gets decremented when an item is purchased. I'd think you could modify the value in the same way any other field could be modified.

Josh Miller
Answer by: Josh Miller
Posted: Nov 16, 2012