purchases module front-end (todo: refactor js)