updateOrderAddressWithNotSpecifiedSalutation example


        $payloads = $event->getPayloads();
        foreach ($payloads as $payload) {
            if (\array_key_exists('salutationId', $payload) && $payload['salutationId']) {
                continue;
            }

            if (!isset($payload['id'])) {
                continue;
            }

            $this->updateOrderAddressWithNotSpecifiedSalutation($payload['id']);
        }
    }

    private function updateOrderAddressWithNotSpecifiedSalutation(string $id): void
    {
        $this->connection->executeStatement(
            ' UPDATE `order_address` SET `salutation_id` = ( SELECT `id` FROM `salutation` WHERE `salutation_key` = :notSpecified LIMIT 1 ) WHERE `id` = :id AND `salutation_id` is NULL ',
Home | Imprint | This part of the site doesn't use cookies.