// Remove empty fields that are not-nullable in the s_order table, they will be set with an empty string by default
foreach(['comment', 'customerComment', 'internalComment', 'temporaryId', 'trackingCode', 'transactionId', 'referer']as$key){ if(empty($params[$key])){ unset($params[$key]); } }