merge the shopping cart function