Update the replaceOnInvalidCart function

Update the if in the function replaceOnInvalidCart to catch when
products are valid