modified the view function to accomodate change according to 'add to cart function'