Adding / deleting from the cart works Data is written to the sylius_order table. But what conditions must be met to order became an order? (ceased to be displayed in the basket at the client and appeared in the admin as a new order).

I try to change the order status to pending , but orders in the admin panel are not displayed.

here is an example of a record from the sylius_order sylius_order

 [ { 'id' : 39, 'shipping_address_id' : NULL, 'billing_address_id' : NULL, 'user_id' : 17, 'number' : NULL, 'email' : 'username@mail.ru', 'state' : 'cart', 'completed_at' : NULL, 'items_total' : 200, 'adjustments_total' : 0, 'total' : 200, 'created_at' : '2015-08-07 15:57:28', 'updated_at' : '2015-08-10 11:58:10', 'deleted_at' : NULL, 'expires_at' : '2015-08-07 18:57:28', 'currency' : 'UAH', 'payment_state' : 'cart', 'shipping_state' : 'checkout' } ] 

How to make a purchase using this bundle? I want to move an order from a basket to new orders. the documentation didn't help much


sylius docs didn’t help much to figure out how the bundle works, but didn’t find any examples of working with the bundle

Order statuses

maybe someone already has experience with this bundle and will share experiences or examples of github code.

    1 answer 1

    based on sorts

     /vendor/sylius/sylius/src/Sylius/Bundle/CoreBundle/Checkout/Step/PaymentStep.php 

    I try to create from оrder'a -> payment

      public function paymentAction(Request $request) { $cartProvider = $this->container->get('sylius.cart_provider'); $order = $cartProvider->getCart(); $paymentStep = $this->container->get('event_dispatcher'); $paymentStep->dispatch(SyliusCheckoutEvents::PAYMENT_INITIALIZE, new GenericEvent($order)); $form = $this->createForm('sylius_checkout_payment', $order); if ($form->handleRequest($request)) { $paymentStep->dispatch(SyliusCheckoutEvents::PAYMENT_PRE_COMPLETE, new GenericEvent($order)); $orm = $this->container->get('doctrine')->getManager(); $orm->persist($order); $orm->flush(); $paymentStep->dispatch(SyliusCheckoutEvents::PAYMENT_COMPLETE, new GenericEvent($order)); return new ActionResult(); } return JsonResponse::create(true); } 

    sylius_payment appeared in the sylius_payment table

      id, method_id, credit_card_id, order_id, currency, amount, state, details, created_at, updated_at '2', NULL, NULL, '46', 'UAH', '10', 'new', '[]', '2015-08-14 12:22:40', '2015-08-14 12:22:47' 

    order_id 46 in the sylius_order table sylius_order not changed. Generated admin does not see any orders at all