|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* @license LGPLv3, http://opensource.org/licenses/LGPL-3.0 |
|
5
|
|
|
* @copyright Metaways Infosystems GmbH, 2013 |
|
6
|
|
|
* @copyright Aimeos (aimeos.org), 2015-2022 |
|
7
|
|
|
* @package Client |
|
8
|
|
|
* @subpackage Html |
|
9
|
|
|
*/ |
|
10
|
|
|
|
|
11
|
|
|
|
|
12
|
|
|
namespace Aimeos\Client\Html\Checkout\Update; |
|
13
|
|
|
|
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* Default implementation of update checkout HTML client. |
|
17
|
|
|
* |
|
18
|
|
|
* @package Client |
|
19
|
|
|
* @subpackage Html |
|
20
|
|
|
*/ |
|
21
|
|
|
class Standard |
|
22
|
|
|
extends \Aimeos\Client\Html\Common\Client\Factory\Base |
|
23
|
|
|
implements \Aimeos\Client\Html\Common\Client\Factory\Iface |
|
24
|
|
|
{ |
|
25
|
|
|
/** |
|
26
|
|
|
* Processes the input, e.g. store given values. |
|
27
|
|
|
* |
|
28
|
|
|
* A view must be available and this method doesn't generate any output |
|
29
|
|
|
* besides setting view variables. |
|
30
|
|
|
*/ |
|
31
|
|
|
public function init() |
|
32
|
|
|
{ |
|
33
|
|
|
$view = $this->view(); |
|
34
|
|
|
$context = $this->context(); |
|
35
|
|
|
|
|
36
|
|
|
try |
|
37
|
|
|
{ |
|
38
|
|
|
$cntl = \Aimeos\Controller\Frontend::create( $context, 'service' ); |
|
39
|
|
|
$cntl->updatePush( $view->request(), $view->response(), $view->param( 'code', '' ) ); |
|
40
|
|
|
} |
|
41
|
|
|
catch( \Exception $e ) |
|
42
|
|
|
{ |
|
43
|
|
|
$view->response()->withStatus( 500, 'Error updating order status' ); |
|
44
|
|
|
$view->response()->getBody()->write( $e->getMessage() ); |
|
45
|
|
|
|
|
46
|
|
|
$body = (string) $view->request()->getBody(); |
|
47
|
|
|
$str = "Updating order status failed: %1\$s\n%2\$s\n%3\$s"; |
|
48
|
|
|
$msg = sprintf( $str, $e->getMessage(), print_r( $view->param(), true ), $body ); |
|
|
|
|
|
|
49
|
|
|
$context->logger()->error( $msg, 'client/html' ); |
|
50
|
|
|
} |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
|
|
54
|
|
|
/** client/html/checkout/update/template-body |
|
55
|
|
|
* Relative path to the HTML body template of the checkout update client. |
|
56
|
|
|
* |
|
57
|
|
|
* The template file contains the HTML code and processing instructions |
|
58
|
|
|
* to generate the result shown in the body of the frontend. The |
|
59
|
|
|
* configuration string is the path to the template file relative |
|
60
|
|
|
* to the templates directory (usually in client/html/templates). |
|
61
|
|
|
* |
|
62
|
|
|
* You can overwrite the template file configuration in extensions and |
|
63
|
|
|
* provide alternative templates. These alternative templates should be |
|
64
|
|
|
* named like the default one but suffixed by |
|
65
|
|
|
* an unique name. You may use the name of your project for this. If |
|
66
|
|
|
* you've implemented an alternative client class as well, it |
|
67
|
|
|
* should be suffixed by the name of the new class. |
|
68
|
|
|
* |
|
69
|
|
|
* @param string Relative path to the template creating code for the HTML page body |
|
70
|
|
|
* @since 2014.03 |
|
71
|
|
|
* @category Developer |
|
72
|
|
|
* @see client/html/checkout/update/template-header |
|
73
|
|
|
*/ |
|
74
|
|
|
|
|
75
|
|
|
/** client/html/checkout/update/template-header |
|
76
|
|
|
* Relative path to the HTML header template of the checkout update client. |
|
77
|
|
|
* |
|
78
|
|
|
* The template file contains the HTML code and processing instructions |
|
79
|
|
|
* to generate the HTML code that is inserted into the HTML page header |
|
80
|
|
|
* of the rendered page in the frontend. The configuration string is the |
|
81
|
|
|
* path to the template file relative to the templates directory (usually |
|
82
|
|
|
* in client/html/templates). |
|
83
|
|
|
* |
|
84
|
|
|
* You can overwrite the template file configuration in extensions and |
|
85
|
|
|
* provide alternative templates. These alternative templates should be |
|
86
|
|
|
* named like the default one but suffixed by |
|
87
|
|
|
* an unique name. You may use the name of your project for this. If |
|
88
|
|
|
* you've implemented an alternative client class as well, it |
|
89
|
|
|
* should be suffixed by the name of the new class. |
|
90
|
|
|
* |
|
91
|
|
|
* @param string Relative path to the template creating code for the HTML page head |
|
92
|
|
|
* @since 2014.03 |
|
93
|
|
|
* @category Developer |
|
94
|
|
|
* @see client/html/checkout/update/template-body |
|
95
|
|
|
*/ |
|
96
|
|
|
} |
|
97
|
|
|
|