#1
|
||||
|
||||
Shop Stock
Shops with 'stock' that depletes and replenishes... I'm trying to wrap my head around how I might implement this. I'm pretty good with manipulating the framework to my needs but, conceptually, I'm wondering what the best way to do this would be...
I don't want cron jobs. Surely there is another way to fudge some automation? More database tables will be needed. I'm thinking 'stock' for current stock, a restock threshold, and a timestamp for when the item was last purchased. (In addition to the current restock threshold, its constant restock threshold -the amount it'll always reset to when the stock falls to zero.) PHP Code:
Each time any item in that shop is bought we'll call a function that'll decrease the restock threshold of every item in that shop whose current stock is equal to zero. Rarer items you want to restock less often should have greater restock thresholds. In addition, every hour, the item's restock threshold will diminish by 1 every hour - this will be determined on page load of viewing shop, calculated from the last time the item was bought. Does this sound feasible?
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it. Last edited by Kyttias; 03-25-2015 at 02:15 AM. |
Tags |
restock, shop, stock |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Art Shop here on site! | Mortain | Art Gallery | 0 | 11-20-2015 09:30 AM |
Shop to buy an adoptable? | SilverDragonTears | Questions and Supports | 8 | 08-16-2011 03:17 PM |
System Shop | sensacion | Questions and Supports | 0 | 05-08-2011 07:40 PM |
Shop and... | 12345 | Questions and Supports | 1 | 03-05-2009 08:59 AM |
Shop? | trollis76 | Questions and Supports | 6 | 02-20-2009 01:46 AM |
What's New? |
What's Hot? |
What's Popular? |