/** * Filling the options specified for the product. * * @param InjectableFixture $product * @return void * * @SuppressWarnings(PHPMD.NPathComplexity) */ public function fillOptions(InjectableFixture $product) { /** @var DownloadableProduct $product */ $downloadableLinks = isset($product->getDownloadableLinks()['downloadable']['link']) ? $product->getDownloadableLinks()['downloadable']['link'] : []; $checkoutData = $product->getCheckoutData(); if (isset($checkoutData['options'])) { foreach ($checkoutData['options']['links'] as $key => $linkData) { $linkKey = str_replace('link_', '', $linkData['label']); $linkData['label'] = $downloadableLinks[$linkKey]['title']; $checkoutData['options']['links'][$key] = $linkData; } $this->getDownloadableLinksBlock()->fill($checkoutData['options']['links']); } parent::fillOptions($product); }