protected function setAddonData(
        ItemInterface $lastProcessedProductItem,
        ItemInterface $item,
        ProductInterface $parentItemProduct = null
    ) {
        $item->setParent($lastProcessedProductItem);

        $parentProduct = $lastProcessedProductItem->getProduct();
        $addonProduct = $item->getProduct();
        /** @var Addon $addon */
        $addon = $this->addonRepository->findOneBy(['product' => $parentProduct, 'addon' => $addonProduct]);

        // Check if parent product has an addon relation.
        if (!$addon && $parentItemProduct) {
            $addon = $this->addonRepository->findOneBy(['product' => $parentProduct, 'addon' => $parentItemProduct]);
        }

        if (!$addon) {
            throw new \Exception(
                'Addon id ' . $addonProduct->getId() . ' for product id ' . $parentProduct->getId() . ' not found.'
            );
        }
        $item->setAddon($addon);

        return $addon;
    }