Did the controls and checks for the last entry of the product items and converted it to a JSON object that holds each item's attributes as a whole from productItems array.