Fix undefined index when adding an item to cart