| @@ 411-441 (lines=31) @@ | ||
| 408 | /** |
|
| 409 | * お届け先変更がクリックされた場合の処理 |
|
| 410 | */ |
|
| 411 | public function shippingChange(Application $app, Request $request, $id) |
|
| 412 | { |
|
| 413 | $Order = $app['eccube.service.shopping']->getOrder($app['config']['order_processing']); |
|
| 414 | if (!$Order) { |
|
| 415 | $app->addError('front.shopping.order.error'); |
|
| 416 | return $app->redirect($app->url('shopping_error')); |
|
| 417 | } |
|
| 418 | ||
| 419 | $form = $app['eccube.service.shopping']->getShippingForm($Order); |
|
| 420 | ||
| 421 | if ('POST' === $request->getMethod()) { |
|
| 422 | $form->handleRequest($request); |
|
| 423 | ||
| 424 | if ($form->isValid()) { |
|
| 425 | $data = $form->getData(); |
|
| 426 | $message = $data['message']; |
|
| 427 | $Order->setMessage($message); |
|
| 428 | // 受注情報を更新 |
|
| 429 | $app['orm.em']->flush(); |
|
| 430 | // お届け先設定一覧へリダイレクト |
|
| 431 | return $app->redirect($app->url('shopping_shipping', array('id' => $id))); |
|
| 432 | } else { |
|
| 433 | return $app->render('Shopping/index.twig', array( |
|
| 434 | 'form' => $form->createView(), |
|
| 435 | 'Order' => $Order, |
|
| 436 | )); |
|
| 437 | } |
|
| 438 | } |
|
| 439 | ||
| 440 | return $app->redirect($app->url('shopping')); |
|
| 441 | } |
|
| 442 | ||
| 443 | /** |
|
| 444 | * お届け先の設定一覧からの選択 |
|
| @@ 534-564 (lines=31) @@ | ||
| 531 | /** |
|
| 532 | * お届け先の設定(非会員)がクリックされた場合の処理 |
|
| 533 | */ |
|
| 534 | public function shippingEditChange(Application $app, Request $request, $id) |
|
| 535 | { |
|
| 536 | $Order = $app['eccube.service.shopping']->getOrder($app['config']['order_processing']); |
|
| 537 | if (!$Order) { |
|
| 538 | $app->addError('front.shopping.order.error'); |
|
| 539 | return $app->redirect($app->url('shopping_error')); |
|
| 540 | } |
|
| 541 | ||
| 542 | $form = $app['eccube.service.shopping']->getShippingForm($Order); |
|
| 543 | ||
| 544 | if ('POST' === $request->getMethod()) { |
|
| 545 | $form->handleRequest($request); |
|
| 546 | ||
| 547 | if ($form->isValid()) { |
|
| 548 | $data = $form->getData(); |
|
| 549 | $message = $data['message']; |
|
| 550 | $Order->setMessage($message); |
|
| 551 | // 受注情報を更新 |
|
| 552 | $app['orm.em']->flush(); |
|
| 553 | // お届け先設定一覧へリダイレクト |
|
| 554 | return $app->redirect($app->url('shopping_shipping_edit', array('id' => $id))); |
|
| 555 | } else { |
|
| 556 | return $app->render('Shopping/index.twig', array( |
|
| 557 | 'form' => $form->createView(), |
|
| 558 | 'Order' => $Order, |
|
| 559 | )); |
|
| 560 | } |
|
| 561 | } |
|
| 562 | ||
| 563 | return $app->redirect($app->url('shopping')); |
|
| 564 | } |
|
| 565 | ||
| 566 | ||
| 567 | /** |
|
| @@ 891-921 (lines=31) @@ | ||
| 888 | /** |
|
| 889 | * 複数配送処理がクリックされた場合の処理 |
|
| 890 | */ |
|
| 891 | public function shippingMultipleChange(Application $app, Request $request) |
|
| 892 | { |
|
| 893 | $Order = $app['eccube.service.shopping']->getOrder($app['config']['order_processing']); |
|
| 894 | if (!$Order) { |
|
| 895 | $app->addError('front.shopping.order.error'); |
|
| 896 | return $app->redirect($app->url('shopping_error')); |
|
| 897 | } |
|
| 898 | ||
| 899 | $form = $app['eccube.service.shopping']->getShippingForm($Order); |
|
| 900 | ||
| 901 | if ('POST' === $request->getMethod()) { |
|
| 902 | $form->handleRequest($request); |
|
| 903 | ||
| 904 | if ($form->isValid()) { |
|
| 905 | $data = $form->getData(); |
|
| 906 | $message = $data['message']; |
|
| 907 | $Order->setMessage($message); |
|
| 908 | // 受注情報を更新 |
|
| 909 | $app['orm.em']->flush(); |
|
| 910 | // 複数配送設定へリダイレクト |
|
| 911 | return $app->redirect($app->url('shopping_shipping_multiple')); |
|
| 912 | } else { |
|
| 913 | return $app->render('Shopping/index.twig', array( |
|
| 914 | 'form' => $form->createView(), |
|
| 915 | 'Order' => $Order, |
|
| 916 | )); |
|
| 917 | } |
|
| 918 | } |
|
| 919 | ||
| 920 | return $app->redirect($app->url('shopping')); |
|
| 921 | } |
|
| 922 | ||
| 923 | ||
| 924 | /** |
|