Example #1
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $sizes)
 {
     parent::buildForm($builder, $sizes);
     //        Необходимо разработать функцию выбора размера
     //        if (isset($sizes['product']) && $sizes['product']->hasSizes()) {
     //            $sizes = $options['product']->isVariantPickingModeChoice() ? 'sylius_assortment_variant_choice' : 'sylius_assortment_variant_match';
     //            $builder->add('size', $type, array(
     //                'product'  => $options['product']
     //            ));
     //        }
 }
Example #2
0
 /**
  * We need to override this method to allow setting 'product'
  * option, by default it will be null so we don't get the variant choice
  * when creating full cart form.
  *
  * {@inheritdoc}
  */
 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     parent::setDefaultOptions($resolver);
     $resolver->setOptional(array('product'))->setAllowedTypes(array('product' => array('Sylius\\Component\\Core\\Model\\ProductInterface')));
 }
Example #3
0
 /**
  * We need to override this method to allow setting 'product'
  * option, by default it will be null so we don't get the variant choice
  * when creating full cart form.
  *
  * {@inheritdoc}
  */
 public function configureOptions(OptionsResolver $resolver)
 {
     parent::configureOptions($resolver);
     $resolver->setDefined(array('product'))->setAllowedTypes('product', ProductInterface::class);
 }