Recommendations based on other products seen
For very large datasets there are more powerful methods than k-nn, try to look at what the well known companies like Google, Amazon, Netflix, etc. have published.

Since you are learning, I assume your dataset is small. You can define a graph and recommend based on all views of a user. One simple method is "user-based" recommendations. A more general perspective is that of path counting / random walk ("personalized pagerank", spectral methods, etc). 

If you can read math papers, you could start with C. Cooper et al Random Walks in Recommender Systems:Exact Computation and Simulations.

For book content similarities, with a small dataset, apart from the item-based similarity itself, probably your only choice is to try to find some external metadata.