diff --git a/src/Model/Order/ConvertimOrderDataToOrderDataMapper.php b/src/Model/Order/ConvertimOrderDataToOrderDataMapper.php index d4b6781..3318b9f 100644 --- a/src/Model/Order/ConvertimOrderDataToOrderDataMapper.php +++ b/src/Model/Order/ConvertimOrderDataToOrderDataMapper.php @@ -283,7 +283,11 @@ protected function mapProducts(ConvertimOrderData $convertimOrderData, OrderData */ protected function mapPromoCodes(ConvertimOrderData $convertimOrderData, OrderData $orderData): void { - $orderData->promoCode = $convertimOrderData->getPromoCodes()[0]->getCode(); + $promoCodes = $convertimOrderData->getPromoCodes(); + + if (count($promoCodes) > 0) { + $orderData->promoCode = $promoCodes[0]->getCode(); + } } /**