reincorportating old functionality from spree frontend