Passed
Push — master ( 56acc7...6ec9fa )
by Aimeos
02:41
created

Standard::isSubscription()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 4
nc 3
nop 1
dl 0
loc 10
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2015-2022
6
 * @package Client
7
 * @subpackage Html
8
 */
9
10
11
namespace Aimeos\Client\Html\Checkout\Standard\Process;
12
13
14
// Strings for translation
15
sprintf( 'process' );
16
17
18
/**
19
 * Default implementation of checkout process HTML client.
20
 *
21
 * @package Client
22
 * @subpackage Html
23
 */
24
class Standard
25
	extends \Aimeos\Client\Html\Common\Client\Factory\Base
26
	implements \Aimeos\Client\Html\Common\Client\Factory\Iface
27
{
28
	/** client/html/checkout/standard/process/subparts
29
	 * List of HTML sub-clients rendered within the checkout standard process section
30
	 *
31
	 * The output of the frontend is composed of the code generated by the HTML
32
	 * clients. Each HTML client can consist of serveral (or none) sub-clients
33
	 * that are responsible for rendering certain sub-parts of the output. The
34
	 * sub-clients can contain HTML clients themselves and therefore a
35
	 * hierarchical tree of HTML clients is composed. Each HTML client creates
36
	 * the output that is placed inside the container of its parent.
37
	 *
38
	 * At first, always the HTML code generated by the parent is printed, then
39
	 * the HTML code of its sub-clients. The order of the HTML sub-clients
40
	 * determines the order of the output of these sub-clients inside the parent
41
	 * container. If the configured list of clients is
42
	 *
43
	 *  array( "subclient1", "subclient2" )
44
	 *
45
	 * you can easily change the order of the output by reordering the subparts:
46
	 *
47
	 *  client/html/<clients>/subparts = array( "subclient1", "subclient2" )
48
	 *
49
	 * You can also remove one or more parts if they shouldn't be rendered:
50
	 *
51
	 *  client/html/<clients>/subparts = array( "subclient1" )
52
	 *
53
	 * As the clients only generates structural HTML, the layout defined via CSS
54
	 * should support adding, removing or reordering content by a fluid like
55
	 * design.
56
	 *
57
	 * @param array List of sub-client names
58
	 * @since 2014.03
59
	 */
60
	private $subPartPath = 'client/html/checkout/standard/process/subparts';
61
62
	/** client/html/checkout/standard/process/account/name
63
	 * Name of the account part used by the checkout standard process client implementation
64
	 *
65
	 * Use "Myname" if your class is named "\Aimeos\Client\Html\Checkout\Standard\Process\Account\Myname".
66
	 * The name is case-sensitive and you should avoid camel case names like "MyName".
67
	 *
68
	 * @param string Last part of the client class name
69
	 * @since 2017.04
70
	 */
71
72
	/** client/html/checkout/standard/process/address/name
73
	 * Name of the address part used by the checkout standard process client implementation
74
	 *
75
	 * Use "Myname" if your class is named "\Aimeos\Client\Html\Checkout\Standard\Process\Address\Myname".
76
	 * The name is case-sensitive and you should avoid camel case names like "MyName".
77
	 *
78
	 * @param string Last part of the client class name
79
	 * @since 2017.04
80
	 */
81
	private $subPartNames = ['account', 'address'];
82
83
84
	/**
85
	 * Returns the HTML code for insertion into the body.
86
	 *
87
	 * @param string $uid Unique identifier for the output if the content is placed more than once on the same page
88
	 * @return string HTML code
89
	 */
90
	public function body( string $uid = '' ) : string
91
	{
92
		if( $this->view()->get( 'standardStepActive' ) !== 'process' ) {
93
			return '';
94
		}
95
96
		return parent::body( $uid );
97
	}
98
99
100
	/**
101
	 * Returns the sub-client given by its name.
102
	 *
103
	 * @param string $type Name of the client type
104
	 * @param string|null $name Name of the sub-client (Default if null)
105
	 * @return \Aimeos\Client\Html\Iface Sub-client object
106
	 */
107
	public function getSubClient( string $type, string $name = null ) : \Aimeos\Client\Html\Iface
108
	{
109
		/** client/html/checkout/standard/process/decorators/excludes
110
		 * Excludes decorators added by the "common" option from the checkout standard process html client
111
		 *
112
		 * Decorators extend the functionality of a class by adding new aspects
113
		 * (e.g. log what is currently done), executing the methods of the underlying
114
		 * class only in certain conditions (e.g. only for logged in users) or
115
		 * modify what is returned to the caller.
116
		 *
117
		 * This option allows you to remove a decorator added via
118
		 * "client/html/common/decorators/default" before they are wrapped
119
		 * around the html client.
120
		 *
121
		 *  client/html/checkout/standard/process/decorators/excludes = array( 'decorator1' )
122
		 *
123
		 * This would remove the decorator named "decorator1" from the list of
124
		 * common decorators ("\Aimeos\Client\Html\Common\Decorator\*") added via
125
		 * "client/html/common/decorators/default" to the html client.
126
		 *
127
		 * @param array List of decorator names
128
		 * @since 2015.08
129
		 * @see client/html/common/decorators/default
130
		 * @see client/html/checkout/standard/process/decorators/global
131
		 * @see client/html/checkout/standard/process/decorators/local
132
		 */
133
134
		/** client/html/checkout/standard/process/decorators/global
135
		 * Adds a list of globally available decorators only to the checkout standard process html client
136
		 *
137
		 * Decorators extend the functionality of a class by adding new aspects
138
		 * (e.g. log what is currently done), executing the methods of the underlying
139
		 * class only in certain conditions (e.g. only for logged in users) or
140
		 * modify what is returned to the caller.
141
		 *
142
		 * This option allows you to wrap global decorators
143
		 * ("\Aimeos\Client\Html\Common\Decorator\*") around the html client.
144
		 *
145
		 *  client/html/checkout/standard/process/decorators/global = array( 'decorator1' )
146
		 *
147
		 * This would add the decorator named "decorator1" defined by
148
		 * "\Aimeos\Client\Html\Common\Decorator\Decorator1" only to the html client.
149
		 *
150
		 * @param array List of decorator names
151
		 * @since 2015.08
152
		 * @see client/html/common/decorators/default
153
		 * @see client/html/checkout/standard/process/decorators/excludes
154
		 * @see client/html/checkout/standard/process/decorators/local
155
		 */
156
157
		/** client/html/checkout/standard/process/decorators/local
158
		 * Adds a list of local decorators only to the checkout standard process html client
159
		 *
160
		 * Decorators extend the functionality of a class by adding new aspects
161
		 * (e.g. log what is currently done), executing the methods of the underlying
162
		 * class only in certain conditions (e.g. only for logged in users) or
163
		 * modify what is returned to the caller.
164
		 *
165
		 * This option allows you to wrap local decorators
166
		 * ("\Aimeos\Client\Html\Checkout\Decorator\*") around the html client.
167
		 *
168
		 *  client/html/checkout/standard/process/decorators/local = array( 'decorator2' )
169
		 *
170
		 * This would add the decorator named "decorator2" defined by
171
		 * "\Aimeos\Client\Html\Checkout\Decorator\Decorator2" only to the html client.
172
		 *
173
		 * @param array List of decorator names
174
		 * @since 2015.08
175
		 * @see client/html/common/decorators/default
176
		 * @see client/html/checkout/standard/process/decorators/excludes
177
		 * @see client/html/checkout/standard/process/decorators/global
178
		 */
179
180
		return $this->createSubClient( 'checkout/standard/process/' . $type, $name );
181
	}
182
183
184
	/**
185
	 * Processes the input, e.g. store given order.
186
	 *
187
	 * A view must be available and this method doesn't generate any output
188
	 * besides setting view variables.
189
	 */
190
	public function init()
191
	{
192
		$view = $this->view();
193
		$context = $this->context();
194
195
		if( $view->param( 'c_step' ) !== 'process'
196
			|| $view->get( 'errors', [] ) !== []
197
			|| $view->get( 'standardStepActive' ) !== null
198
		) {
199
			return true;
200
		}
201
202
		$orderCntl = \Aimeos\Controller\Frontend::create( $context, 'order' );
203
		$basketCntl = \Aimeos\Controller\Frontend::create( $context, 'basket' );
204
205
206
		if( $view->param( 'cs_order' ) !== null )
207
		{
208
			parent::init();
209
210
			$basket = $basketCntl->store();
211
			$orderItem = $orderCntl->add( $basket->getId(), ['order.type' => 'web'] )->store();
212
213
			$context->session()->set( 'aimeos/orderid', $orderItem->getId() );
214
		}
215
		elseif( ( $orderid = $context->session()->get( 'aimeos/orderid' ) ) !== null )
216
		{
217
			$parts = ['order/base/address', 'order/base/coupon', 'order/base/product', 'order/base/service'];
218
			$orderItem = $orderCntl->get( $orderid, false );
219
			$basket = $basketCntl->load( $orderItem->getBaseId(), $parts, false );
220
		}
221
		else
222
		{
223
			return;
224
		}
225
226
		if( ( $form = $this->processPayment( $basket, $orderItem ) ) === null ) // no payment service available
227
		{
228
			$services = $basket->getService( \Aimeos\MShop\Order\Item\Base\Service\Base::TYPE_PAYMENT );
229
			$args = ( $service = reset( $services ) ) ? ['code' => $service->getCode()] : [];
230
231
			$orderCntl->save( $orderItem->setStatusPayment( \Aimeos\MShop\Order\Item\Base::PAY_AUTHORIZED ) );
232
			$view->standardUrlNext = $this->getUrlConfirm( $view, $args, ['absoluteUri' => true] );
233
			$view->standardMethod = 'POST';
234
		}
235
		else
236
		{
237
			$view = $this->addFormData( $view, $form );
0 ignored issues
show
Unused Code introduced by
The assignment to $view is dead and can be removed.
Loading history...
238
		}
239
	}
240
241
242
	/**
243
	 * Adds the required data for the payment form to the view
244
	 *
245
	 * @param \Aimeos\Base\View\Iface $view View object to assign the data to
246
	 * @param \Aimeos\MShop\Common\Helper\Form\Iface $form Form helper object including the form data
247
	 * @return \Aimeos\Base\View\Iface View object with assigned data
248
	 */
249
	protected function addFormData( \Aimeos\Base\View\Iface $view, \Aimeos\MShop\Common\Helper\Form\Iface $form )
250
	{
251
		$url = $form->getUrl();
252
253
		if( $form->getMethod() === 'GET' )
254
		{
255
			$urlParams = [];
256
257
			foreach( $form->getValues() as $item )
258
			{
259
				foreach( (array) $item->getDefault() as $key => $value ) {
260
					$urlParams[$item->getInternalCode()][$key] = $value;
261
				}
262
			}
263
264
			$url .= strpos( $url, '?' ) ? '&' : '?' . map( $urlParams )->toUrl();
265
		}
266
267
		$public = $hidden = [];
268
269
		foreach( $form->getValues() as $key => $item )
270
		{
271
			if( $item->isPublic() ) {
272
				$public[$key] = $item;
273
			} else {
274
				$hidden[$key] = $item;
275
			}
276
		}
277
278
		$view->standardUrlNext = $url;
279
		$view->standardProcessPublic = $public;
280
		$view->standardProcessHidden = $hidden;
281
		$view->standardProcessParams = $form->getValues();
282
		$view->standardUrlExternal = $form->getExternal();
283
		$view->standardMethod = $form->getMethod();
284
		$view->standardHtml = $form->getHtml();
285
286
		return $view;
287
	}
288
289
290
	/**
291
	 * Returns the form helper object for building the payment form in the frontend
292
	 *
293
	 * @param \Aimeos\MShop\Order\Item\Base\Iface $basket Saved basket object including payment service object
294
	 * @param \Aimeos\MShop\Order\Item\Iface $orderItem Saved order item created for the basket object
295
	 * @return \Aimeos\MShop\Common\Helper\Form\Iface|null Form object with URL, parameters, etc.
296
	 * 	or null if no form data is required
297
	 */
298
	protected function processPayment( \Aimeos\MShop\Order\Item\Base\Iface $basket, \Aimeos\MShop\Order\Item\Iface $orderItem ) : ?\Aimeos\MShop\Common\Helper\Form\Iface
299
	{
300
		if( $basket->getPrice()->getValue() + $basket->getPrice()->getCosts() <= 0
301
			&& $this->isSubscription( $basket->getProducts() ) === false
302
		) {
303
			return null;
304
		}
305
306
		$services = $basket->getService( \Aimeos\MShop\Order\Item\Base\Service\Base::TYPE_PAYMENT );
307
308
		if( ( $service = reset( $services ) ) === false ) {
309
			return null;
310
		}
311
312
		$view = $this->view();
313
		$conf = ['absoluteUri' => true];
314
		$args = ['code' => $service->getCode()];
315
		$urls = [
316
			'payment.url-self' => $this->getUrlSelf( $view, ['c_step' => 'process'], $conf ),
317
			'payment.url-update' => $this->getUrlUpdate( $view, $args + ['orderid' => $orderItem->getId()], $conf ),
318
			'payment.url-success' => $this->getUrlConfirm( $view, $args, $conf ),
319
		];
320
321
		$params = array_merge(
322
			(array) $view->param(),
323
			(array) $view->request()->getQueryParams(),
324
			(array) $view->request()->getParsedBody(),
325
			(array) $view->request()->getAttributes()
326
		);
327
328
		foreach( $service->getAttributeItems() as $item ) {
329
			$params[$item->getCode()] = $item->getValue();
330
		}
331
332
		$serviceCntl = \Aimeos\Controller\Frontend::create( $this->context(), 'service' );
333
		return $serviceCntl->process( $orderItem, $service->getServiceId(), $urls, $params );
334
	}
335
336
337
	/**
338
	 * Returns the list of sub-client names configured for the client.
339
	 *
340
	 * @return array List of HTML client names
341
	 */
342
	protected function getSubClientNames() : array
343
	{
344
		return $this->context()->config()->get( $this->subPartPath, $this->subPartNames );
345
	}
346
347
348
	/**
349
	 * Returns the URL to the confirm page.
350
	 *
351
	 * @param \Aimeos\Base\View\Iface $view View object
352
	 * @param array $params Parameters that should be part of the URL
353
	 * @param array $config Default URL configuration
354
	 * @return string URL string
355
	 */
356
	protected function getUrlConfirm( \Aimeos\Base\View\Iface $view, array $params, array $config ) : string
357
	{
358
		/** client/html/checkout/confirm/url/target
359
		 * Destination of the URL where the controller specified in the URL is known
360
		 *
361
		 * The destination can be a page ID like in a content management system or the
362
		 * module of a software development framework. This "target" must contain or know
363
		 * the controller that should be called by the generated URL.
364
		 *
365
		 * @param string Destination of the URL
366
		 * @since 2014.03
367
		 * @see client/html/checkout/confirm/url/controller
368
		 * @see client/html/checkout/confirm/url/action
369
		 * @see client/html/checkout/confirm/url/config
370
		 */
371
		$target = $view->config( 'client/html/checkout/confirm/url/target' );
372
373
		/** client/html/checkout/confirm/url/controller
374
		 * Name of the controller whose action should be called
375
		 *
376
		 * In Model-View-Controller (MVC) applications, the controller contains the methods
377
		 * that create parts of the output displayed in the generated HTML page. Controller
378
		 * names are usually alpha-numeric.
379
		 *
380
		 * @param string Name of the controller
381
		 * @since 2014.03
382
		 * @see client/html/checkout/confirm/url/target
383
		 * @see client/html/checkout/confirm/url/action
384
		 * @see client/html/checkout/confirm/url/config
385
		 */
386
		$cntl = $view->config( 'client/html/checkout/confirm/url/controller', 'checkout' );
387
388
		/** client/html/checkout/confirm/url/action
389
		 * Name of the action that should create the output
390
		 *
391
		 * In Model-View-Controller (MVC) applications, actions are the methods of a
392
		 * controller that create parts of the output displayed in the generated HTML page.
393
		 * Action names are usually alpha-numeric.
394
		 *
395
		 * @param string Name of the action
396
		 * @since 2014.03
397
		 * @see client/html/checkout/confirm/url/target
398
		 * @see client/html/checkout/confirm/url/controller
399
		 * @see client/html/checkout/confirm/url/config
400
		 */
401
		$action = $view->config( 'client/html/checkout/confirm/url/action', 'confirm' );
402
403
		/** client/html/checkout/confirm/url/config
404
		 * Associative list of configuration options used for generating the URL
405
		 *
406
		 * You can specify additional options as key/value pairs used when generating
407
		 * the URLs, like
408
		 *
409
		 *  client/html/<clientname>/url/config = array( 'absoluteUri' => true )
410
		 *
411
		 * The available key/value pairs depend on the application that embeds the e-commerce
412
		 * framework. This is because the infrastructure of the application is used for
413
		 * generating the URLs. The full list of available config options is referenced
414
		 * in the "see also" section of this page.
415
		 *
416
		 * @param string Associative list of configuration options
417
		 * @since 2014.03
418
		 * @see client/html/checkout/confirm/url/target
419
		 * @see client/html/checkout/confirm/url/controller
420
		 * @see client/html/checkout/confirm/url/action
421
		 * @see client/html/url/config
422
		 */
423
		$config = $view->config( 'client/html/checkout/confirm/url/config', $config );
424
425
		return $view->url( $target, $cntl, $action, $params, [], $config );
426
	}
427
428
429
	/**
430
	 * Returns the URL to the current page.
431
	 *
432
	 * @param \Aimeos\Base\View\Iface $view View object
433
	 * @param array $params Parameters that should be part of the URL
434
	 * @param array $config Default URL configuration
435
	 * @return string URL string
436
	 */
437
	protected function getUrlSelf( \Aimeos\Base\View\Iface $view, array $params, array $config ) : string
438
	{
439
		/** client/html/checkout/standard/url/target
440
		 * Destination of the URL where the controller specified in the URL is known
441
		 *
442
		 * The destination can be a page ID like in a content management system or the
443
		 * module of a software development framework. This "target" must contain or know
444
		 * the controller that should be called by the generated URL.
445
		 *
446
		 * @param string Destination of the URL
447
		 * @since 2014.03
448
		 * @see client/html/checkout/standard/url/controller
449
		 * @see client/html/checkout/standard/url/action
450
		 * @see client/html/checkout/standard/url/config
451
		 */
452
		$target = $view->config( 'client/html/checkout/standard/url/target' );
453
454
		/** client/html/checkout/standard/url/controller
455
		 * Name of the controller whose action should be called
456
		 *
457
		 * In Model-View-Controller (MVC) applications, the controller contains the methods
458
		 * that create parts of the output displayed in the generated HTML page. Controller
459
		 * names are usually alpha-numeric.
460
		 *
461
		 * @param string Name of the controller
462
		 * @since 2014.03
463
		 * @see client/html/checkout/standard/url/target
464
		 * @see client/html/checkout/standard/url/action
465
		 * @see client/html/checkout/standard/url/config
466
		 */
467
		$cntl = $view->config( 'client/html/checkout/standard/url/controller', 'checkout' );
468
469
		/** client/html/checkout/standard/url/action
470
		 * Name of the action that should create the output
471
		 *
472
		 * In Model-View-Controller (MVC) applications, actions are the methods of a
473
		 * controller that create parts of the output displayed in the generated HTML page.
474
		 * Action names are usually alpha-numeric.
475
		 *
476
		 * @param string Name of the action
477
		 * @since 2014.03
478
		 * @see client/html/checkout/standard/url/target
479
		 * @see client/html/checkout/standard/url/controller
480
		 * @see client/html/checkout/standard/url/config
481
		 */
482
		$action = $view->config( 'client/html/checkout/standard/url/action', 'index' );
483
484
		/** client/html/checkout/standard/url/config
485
		 * Associative list of configuration options used for generating the URL
486
		 *
487
		 * You can specify additional options as key/value pairs used when generating
488
		 * the URLs, like
489
		 *
490
		 *  client/html/<clientname>/url/config = array( 'absoluteUri' => true )
491
		 *
492
		 * The available key/value pairs depend on the application that embeds the e-commerce
493
		 * framework. This is because the infrastructure of the application is used for
494
		 * generating the URLs. The full list of available config options is referenced
495
		 * in the "see also" section of this page.
496
		 *
497
		 * @param string Associative list of configuration options
498
		 * @since 2014.03
499
		 * @see client/html/checkout/standard/url/target
500
		 * @see client/html/checkout/standard/url/controller
501
		 * @see client/html/checkout/standard/url/action
502
		 * @see client/html/url/config
503
		 */
504
		$config = $view->config( 'client/html/checkout/standard/url/config', $config );
505
506
		return $view->url( $target, $cntl, $action, $params, [], $config );
507
	}
508
509
510
	/**
511
	 * Returns the URL to the update page.
512
	 *
513
	 * @param \Aimeos\Base\View\Iface $view View object
514
	 * @param array $params Parameters that should be part of the URL
515
	 * @param array $config Default URL configuration
516
	 * @return string URL string
517
	 */
518
	protected function getUrlUpdate( \Aimeos\Base\View\Iface $view, array $params, array $config ) : string
519
	{
520
		/** client/html/checkout/update/url/target
521
		 * Destination of the URL where the controller specified in the URL is known
522
		 *
523
		 * The destination can be a page ID like in a content management system or the
524
		 * module of a software development framework. This "target" must contain or know
525
		 * the controller that should be called by the generated URL.
526
		 *
527
		 * @param string Destination of the URL
528
		 * @since 2014.03
529
		 * @see client/html/checkout/update/url/controller
530
		 * @see client/html/checkout/update/url/action
531
		 * @see client/html/checkout/update/url/config
532
		 */
533
		$target = $view->config( 'client/html/checkout/update/url/target' );
534
535
		/** client/html/checkout/update/url/controller
536
		 * Name of the controller whose action should be called
537
		 *
538
		 * In Model-View-Controller (MVC) applications, the controller contains the methods
539
		 * that create parts of the output displayed in the generated HTML page. Controller
540
		 * names are usually alpha-numeric.
541
		 *
542
		 * @param string Name of the controller
543
		 * @since 2014.03
544
		 * @see client/html/checkout/update/url/target
545
		 * @see client/html/checkout/update/url/action
546
		 * @see client/html/checkout/update/url/config
547
		 */
548
		$cntl = $view->config( 'client/html/checkout/update/url/controller', 'checkout' );
549
550
		/** client/html/checkout/update/url/action
551
		 * Name of the action that should create the output
552
		 *
553
		 * In Model-View-Controller (MVC) applications, actions are the methods of a
554
		 * controller that create parts of the output displayed in the generated HTML page.
555
		 * Action names are usually alpha-numeric.
556
		 *
557
		 * @param string Name of the action
558
		 * @since 2014.03
559
		 * @see client/html/checkout/update/url/target
560
		 * @see client/html/checkout/update/url/controller
561
		 * @see client/html/checkout/update/url/config
562
		 */
563
		$action = $view->config( 'client/html/checkout/update/url/action', 'update' );
564
565
		/** client/html/checkout/update/url/config
566
		 * Associative list of configuration options used for generating the URL
567
		 *
568
		 * You can specify additional options as key/value pairs used when generating
569
		 * the URLs, like
570
		 *
571
		 *  client/html/<clientname>/url/config = array( 'absoluteUri' => true )
572
		 *
573
		 * The available key/value pairs depend on the application that embeds the e-commerce
574
		 * framework. This is because the infrastructure of the application is used for
575
		 * generating the URLs. The full list of available config options is referenced
576
		 * in the "see also" section of this page.
577
		 *
578
		 * @param string Associative list of configuration options
579
		 * @since 2014.03
580
		 * @see client/html/checkout/update/url/target
581
		 * @see client/html/checkout/update/url/controller
582
		 * @see client/html/checkout/update/url/action
583
		 * @see client/html/url/config
584
		 */
585
		$config = $view->config( 'client/html/checkout/update/url/config', $config );
586
587
		return $view->url( $target, $cntl, $action, $params, [], $config );
588
	}
589
590
591
	/**
592
	 * Tests if one of the products is a subscription
593
	 *
594
	 * @param \Aimeos\Map $products Ordered products implementing \Aimeos\MShop\Order\Item\Base\Product\Iface
595
	 * @return bool True if at least one product is a subscription, false if not
596
	 */
597
	protected function isSubscription( \Aimeos\Map $products ) : bool
598
	{
599
		foreach( $products as $orderProduct )
600
		{
601
			if( $orderProduct->getAttributeItem( 'interval', 'config' ) ) {
602
				return true;
603
			}
604
		}
605
606
		return false;
607
	}
608
609
610
	/**
611
	 * Sets the necessary parameter values in the view.
612
	 *
613
	 * @param \Aimeos\Base\View\Iface $view The view object which generates the HTML output
614
	 * @param array &$tags Result array for the list of tags that are associated to the output
615
	 * @param string|null &$expire Result variable for the expiration date of the output (null for no expiry)
616
	 * @return \Aimeos\Base\View\Iface Modified view object
617
	 */
618
	public function data( \Aimeos\Base\View\Iface $view, array &$tags = [], string &$expire = null ) : \Aimeos\Base\View\Iface
619
	{
620
		$view->standardUrlPayment = $this->getUrlSelf( $view, array( 'c_step' => 'payment' ), [] );
621
622
		return parent::data( $view, $tags, $expire );
623
	}
624
625
626
	/** client/html/checkout/standard/process/template-body
627
	 * Relative path to the HTML body template of the checkout standard process client.
628
	 *
629
	 * The template file contains the HTML code and processing instructions
630
	 * to generate the result shown in the body of the frontend. The
631
	 * configuration string is the path to the template file relative
632
	 * to the templates directory (usually in client/html/templates).
633
	 *
634
	 * You can overwrite the template file configuration in extensions and
635
	 * provide alternative templates. These alternative templates should be
636
	 * named like the default one but suffixed by
637
	 * an unique name. You may use the name of your project for this. If
638
	 * you've implemented an alternative client class as well, it
639
	 * should be suffixed by the name of the new class.
640
	 *
641
	 * @param string Relative path to the template creating code for the HTML page body
642
	 * @since 2014.03
643
	 * @see client/html/checkout/standard/process/template-header
644
	 */
645
}
646