Esempio n. 1
0
 /**
  * Add product to shopping cart.
  *
  * @param InjectableFixture $product
  * @return void
  */
 public function fillOptions(InjectableFixture $product)
 {
     $this->getGiftCardForm()->fill($product);
     parent::fillOptions($product);
 }
Esempio n. 2
0
 /**
  * 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);
 }