Statistics for people's shoppings -
i building project (website) on people's shopping (stuff stored in refrigerator) . need generate automatic shopping cart based on people's shopping . example if person buys every week 1 bottle of milk , website offer person buy milk once week (if there no milk in refrigerator) . storing shopping history of each family. calculating shopping cart need generate statistics formula . have no clue how it. because there might scenarios (for example birthday) , when family buy more products needed, , make me false data statistics. want ignore such scenarios. has idea how , statistics should use?
pseudocode
assuming customer had account , database mysql
every purchase must save customerid, product id/name ,date of purchase,comment(optional) table (e.g. purchased table)
customer has own table includes @ least personal info(e.g. customer table)
lets customer browses product (viewing website)
• customer clicks product
• system/server counts number of purchase in purchase table
• if number of purchase more 1
- last date of purchased product - current date purchased product = frequency of product needed date - total number of product purchased / total number of times product purchased = frequency of product needed item count
update
i suggest purchase table has field specifies if current order/purchase occasional field instead, excluded.
example
• system/server counts number of purchase in purchase table if purchase not occasional
Comments
Post a Comment