Ejemplo n.º 1
0
 /**
  * @param $data
  * @return Struct\Configurator\Set
  */
 private function createSet($data)
 {
     $set = new Struct\Configurator\Set();
     $set->setId((int) $data['__configuratorSet_id']);
     $set->setName($data['__configuratorSet_name']);
     $set->setType((int) $data['__configuratorSet_type']);
     return $set;
 }
Ejemplo n.º 2
0
 /**
  * Creates the settings array for the passed configurator set
  *
  * @param StoreFrontBundle\Struct\Configurator\Set $set
  * @param StoreFrontBundle\Struct\ListProduct $product
  * @return array
  */
 public function getConfiguratorSettings(StoreFrontBundle\Struct\Configurator\Set $set, StoreFrontBundle\Struct\ListProduct $product)
 {
     $settings = array('instock' => $product->isCloseouts(), 'articleID' => $product->getId(), 'type' => $set->getType());
     //switch the template for the different configurator types.
     if ($set->getType() == 1) {
         //Selection configurator
         $settings["template"] = "article_config_step.tpl";
     } elseif ($set->getType() == 2) {
         //Table configurator
         $settings["template"] = "article_config_picture.tpl";
     } else {
         //Other configurator types
         $settings["template"] = "article_config_upprice.tpl";
     }
     return $settings;
 }
Ejemplo n.º 3
0
 private function assertInactiveOptions(Set $configurator, $expectedOptions)
 {
     foreach ($configurator->getGroups() as $group) {
         foreach ($group->getOptions() as $option) {
             if (in_array($option->getName(), $expectedOptions)) {
                 $this->assertFalse($option->getActive());
             } else {
                 $this->assertTrue($option->getActive());
             }
         }
     }
 }