[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
[ic] Using multiple warehouses
SB>>--I'm looking to intergrate my ic site to use multiple inventory
warehouses
[snip]
SB>>greatly appreciated.
]]DB[[
>From a database point of view, I would suggest that you make another table
and store
the inventory details. A simple version would use two tables, products and
inventory.
Products : id, price
Inventory: id, product_id, warehouse, inventory_count
'Products:id' and 'Inventory:product_id' would match, and you would use
'Inventory:product_id' and 'Inventory:warehouse' to create a key for the
Inventory (or implement a constraint of some type to assure that only one
entry for each warehouse is maintained.)
]]IC[[
In IC, I would not change the 'report.html' page at all. I would leave this
function in place for record keeping, ect (I also imagine you're warehouses
don't need credit cards, but I would be wrong...) I would instead add a
[mail] tag to 'receipt.html' to send the shipping related details to the
correct warehouse. My logic for the page would be (in pseudo code) :
[switch "products:warehouse_location"]
[case value="warehouse_1"] [set warehouse_email = "warehouse1@sucks.tv"] [db
decrement "Inventory:inventory_count] [/case]
...
[/switch]
[send mail to="[warehouse_email]" body="[some shipping data]"]
--- Original Message ---
As a start, I would add a new field to products.txt to designate the
warehouse for that item. Maybe use one letter or number, or the whole name,
or whatever you like.
I would find the place where the order is sent to the store owner and add in
a few lines with some if/else statements. If warehouse=a then email =
abcd@domain.com
(that's not the right verbiage or the right syntax.) I have no idea if this
will work