1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* @license MIT, http://opensource.org/licenses/MIT |
5
|
|
|
* @copyright Aimeos (aimeos.org), 2014-2016 |
6
|
|
|
* @package symfony |
7
|
|
|
* @subpackage Controller |
8
|
|
|
*/ |
9
|
|
|
|
10
|
|
|
|
11
|
|
|
namespace Aimeos\ShopBundle\Controller; |
12
|
|
|
|
13
|
|
|
use Symfony\Component\HttpFoundation\Response; |
14
|
|
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; |
15
|
|
|
|
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* Aimeos controller for checkout related functionality. |
19
|
|
|
* |
20
|
|
|
* @package symfony |
21
|
|
|
* @subpackage Controller |
22
|
|
|
*/ |
23
|
|
|
class CheckoutController extends AbstractController |
24
|
|
|
{ |
25
|
|
|
/** |
26
|
|
|
* Returns the html for the checkout confirmation page. |
27
|
|
|
* |
28
|
|
|
* @return Response Response object containing the generated output |
29
|
|
|
*/ |
30
|
|
|
public function confirmAction( \Twig\Environment $twig ) : Response |
31
|
|
|
{ |
32
|
|
|
$params = []; |
33
|
|
|
$shop = $this->container->get( 'shop' ); |
34
|
|
|
|
35
|
|
|
foreach( $this->container->getParameter( 'aimeos_shop.page' )['checkout-confirm'] as $name ) |
|
|
|
|
36
|
|
|
{ |
37
|
|
|
$params['aiheader'][$name] = $shop->get( $name )->header(); |
38
|
|
|
$params['aibody'][$name] = $shop->get( $name )->body(); |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
return new Response( |
42
|
|
|
$twig->render( '@AimeosShop/Checkout/confirm.html.twig', $params ), |
43
|
|
|
200, ['Cache-Control' => 'no-store, , max-age=0'] |
44
|
|
|
); |
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* Returns the html for the standard checkout page. |
50
|
|
|
* |
51
|
|
|
* @return Response Response object containing the generated output |
52
|
|
|
*/ |
53
|
|
|
public function indexAction( \Twig\Environment $twig ) : Response |
54
|
|
|
{ |
55
|
|
|
$params = []; |
56
|
|
|
$shop = $this->container->get( 'shop' ); |
57
|
|
|
|
58
|
|
|
foreach( $this->container->getParameter( 'aimeos_shop.page' )['checkout-index'] as $name ) |
59
|
|
|
{ |
60
|
|
|
$params['aiheader'][$name] = $shop->get( $name )->header(); |
61
|
|
|
$params['aibody'][$name] = $shop->get( $name )->body(); |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
return new Response( |
65
|
|
|
$twig->render( '@AimeosShop/Checkout/index.html.twig', $params ), |
66
|
|
|
200, ['Cache-Control' => 'no-store, , max-age=0'] |
67
|
|
|
); |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* Returns the view for the order update page. |
73
|
|
|
* |
74
|
|
|
* @return Response Response object containing the generated output |
75
|
|
|
*/ |
76
|
|
|
public function updateAction( \Twig\Environment $twig ) : Response |
77
|
|
|
{ |
78
|
|
|
$params = []; |
79
|
|
|
$shop = $this->container->get( 'shop' ); |
80
|
|
|
|
81
|
|
|
foreach( $this->container->getParameter( 'aimeos_shop.page' )['checkout-update'] as $name ) |
82
|
|
|
{ |
83
|
|
|
$params['aiheader'][$name] = $shop->get( $name )->header(); |
84
|
|
|
$params['aibody'][$name] = $shop->get( $name )->body(); |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
return new Response( |
88
|
|
|
$twig->render( '@AimeosShop/Checkout/update.html.twig', $params ), |
89
|
|
|
200, ['Cache-Control' => 'no-store, , max-age=0'] |
90
|
|
|
); |
91
|
|
|
} |
92
|
|
|
} |
93
|
|
|
|