Is there a common practice for updating product pricing from vendors?
We have tons of products on our site. The vendors often开发者_如何学运维 raise the prices of their product line. If it is something easy like +10% we can easily make this change in the data base. But if the prices are changing chaotically; some up, some down with no common denominator. It can be a hassle keeping track that all the products pricing are up to date with the vendor.
So I was wondering if there is a common practice for this?
Ask your vendors to provide a web service that you can call to obtain all the latest product prices. You could then write a service that runs on a regular basis to update the latest prices to your database.
John,
it might be an idea to have the prices as a seperate date tracked table, i.e:
prices_xref(product_id, stt_date, end_date, price)
that way you could track the changes 'in time' if need be. of course, if this isn't possible, then another option would be to have a second table that reflected the 'last' prices and do a little compare on that and the live table and report on the differences (in an attempt to identify proces that hadn't yet changed).
of course; many ways to skin the cat :)
jim
I'd change the structure of databse by having a price_modifier
row there and making the price
as some kind of "factory value" (standard value, which then is multiplied by price_modifier). So you just set the percentage (positive or negative) for item and when displaying the actual price on page, do the math for price.
精彩评论