Esempio n. 1
0
 /**
  * Fill in the option specified for the product
  *
  * @param FixtureInterface $product
  * @return void
  */
 public function fillOptions(FixtureInterface $product)
 {
     $configureButton = $this->_rootElement->find($this->customizeButton);
     $configureSection = $this->_rootElement->find('.product-options-wrapper');
     if ($configureButton->isVisible()) {
         $configureButton->click();
         $bundleOptions = $product->getSelectionData();
         $this->getBundleBlock()->fillBundleOptions($bundleOptions);
     }
     if ($configureSection->isVisible()) {
         $productOptions = $product->getProductOptions();
         $this->getCustomOptionsBlock()->fillProductOptions($productOptions);
     }
 }
Esempio n. 2
0
 /**
  * Return the name of the specified product.
  *
  * @param FixtureInterface $product
  * @return string
  */
 private function getProductName($product)
 {
     $productName = $product->getName();
     if ($product instanceof ConfigurableProduct) {
         $productOptions = $product->getProductOptions();
         if (!empty($productOptions)) {
             $productName = $productName . ' ' . key($productOptions) . ' ' . current($productOptions);
         }
     }
     return $productName;
 }