extracting out add to cart function

to allow other implementations to add to cart with their own product details