YaleSTC / reservations

Manage equipment loans & reservations. Who can borrow what, for how long?
yalestc.github.io/reservations
MIT License
139 stars 57 forks source link

Popup with suggested items in cart #516

Open orenyk opened 10 years ago

orenyk commented 10 years ago

Via IdeaScale:

Some equipment pieces, specifically the projectors, may need adapters in order to work with a Mac. However, many students don't know this, and often check out a projector without one. A new feature on Reservations could be a "Suggested Items" pop-up once it is added to the cart. This might say something like "Have a Mac? You will need an adapter in order for the projector to connect. Click here to see adapters."

This would also be incredibly helpful once the School of Art merges onto Reservations, since many of their items don't come as kits but require other cords.

We have some of this functionality with associated_equipment_models, not sure if this could just be adding some JS magic to the cart.

mnquintana commented 10 years ago

Would this make more sense on the finalize reservation view? It would certainly be easier to implement.

If we did go the JS route, we could do something like Amazon, where they display a modal that both confirms that you added an item to your cart and suggests other items to add.

orenyk commented 10 years ago

This isn't going to be trivial and isn't strictly necessary prior to export; moving to the Wish List.

mnquintana commented 9 years ago

Ah yeah, I'm remembering now, this is actually an even older feature idea, and we realized quickly back then that it would be pretty hard to implement. (We were thinking we'd need some kind of Amazon-esque related products algorithm :grimacing:)

We ended up going with the "associated equipment models" feature instead so admins can decide what equipment models go with what. But for this feature we'd need to add another view for it in the cart. Not as hard as making an Amazon algorithm, but what would take the longest is figuring out where exactly it should go for the best UX.

squidgetx commented 9 years ago

true. although an (extremely simplified) amazon-esque algorithm wouldn't actually be too difficult to implement I think

You could make a graph where the vertices represent equipment models and the (weighted) edges representing how many times two models have been reserved at the same time, (you could even go through reservation history to build associations, and you also probably need to normalize all the weights somehow).

Then you can use these associations to build a hash of 'suggested' models where the key is the model and the value is the 'weight' or 'closeness' of the associated model (just add the edge values), and throw out any entries with too-low closeness values.

The implementation would probably be easiest with equipment_model has_many_and_belongs_to assocation

At checkout you can just update the table. Normalizing (so that there's a maintainable 'threshold' for deciding if an item is 'close enough' to be recommended) is trickier, but I think you can just divide everything by em.reservations.count to get a figure for 'when someone reserves X how often do they also get Y'

Definitely a wishlist kind of feature but fun to think about

orenyk commented 9 years ago

Nice, it would be great to add a little more machine learning / intelligence to the backend. I feel like we also discussed something like this in terms of expected reservation lengths, maybe with the waitlist? Either way, good stuff!