/**
  * {@inheritdoc}
  */
 public function getQueryBuilder(ColumnCollection $columns, DataSetRequestInterface $request)
 {
     $queryBuilder = parent::getQueryBuilder($columns, $request);
     $expression = $queryBuilder->expr()->eq('cart_product.cart', ':cart');
     $queryBuilder->andWhere($expression);
     $queryBuilder->setParameter('cart', $this->cartContext->getCurrentCartIdentifier());
     $queryBuilder->setParameter('date', new \DateTime());
     return $queryBuilder;
 }
示例#2
0
 /**
  * {@inheritdoc}
  */
 public function buildForm(FormInterface $form)
 {
     $cart = $this->cartContext->getCurrentCart();
     $shippingMethod = $form->addChild($this->getElement('radio_group', ['name' => 'shippingMethodCost', 'label' => $this->trans('cart.shipping_method.label'), 'options' => [], 'transformer' => $this->getRepositoryTransformer('entity', $this->get('shipping_method_cost.repository'))]));
     $this->addShippingOptions($shippingMethod, $cart);
     $paymentMethod = $form->addChild($this->getElement('radio_group', ['name' => 'paymentMethod', 'label' => $this->trans('cart.payment_method.label'), 'options' => [], 'transformer' => $this->getRepositoryTransformer('entity', $this->get('payment_method.repository'))]));
     $this->addPaymentOptions($paymentMethod, $cart);
     $form->addFilter($this->getFilter('no_code'));
     $form->addFilter($this->getFilter('trim'));
     $form->addFilter($this->getFilter('secure'));
 }
示例#3
0
 public function getGlobals()
 {
     return ['cart' => $this->cartContext->getCurrentCart(), 'cartProducts' => $this->cartProductDataSet->getResult('array')];
 }