Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $currencies = array();
     foreach ($this->currencyProvider->getAvailableCurrencies() as $currency) {
         $currencies[$currency->getCode()] = $currency->getName();
     }
     $builder->add('currency', 'choice', array('choices' => $currencies))->add('product', 'hidden', array('mapped' => false))->add('state', 'choice', array('choices' => array(OrderInterface::STATE_CART => 'sylius.order.state.checkout', OrderInterface::STATE_CART_LOCKED => 'sylius.order.state.cart_locked', OrderInterface::STATE_PENDING => 'sylius.order.state.ordered', OrderInterface::STATE_CONFIRMED => 'sylius.order.state.order_confimed', OrderInterface::STATE_SHIPPED => 'sylius.order.state.shipped', OrderInterface::STATE_ABANDONED => 'sylius.order.state.abandoned', OrderInterface::STATE_CANCELLED => 'sylius.order.state.cancelled', OrderInterface::STATE_RETURNED => 'sylius.order.state.returned')));
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormBuilderInterface $builder, array $options)
 {
     parent::buildForm($builder, $options);
     $builder->add('currency', 'sylius_currency_choice')->add('state', 'sylius_order_state_choice')->add('product', 'hidden', array('mapped' => false));
 }