added addtocart, purchase function