-
Notifications
You must be signed in to change notification settings - Fork 9.4k
/
Copy pathLayoutProcessor.php
41 lines (37 loc) · 1.04 KB
/
LayoutProcessor.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
/**
* Copyright 2025 Adobe.
* All Rights Reserved.
*/
declare(strict_types=1);
namespace Magento\Captcha\Block\Customer\AuthenticationPopup;
use Magento\Captcha\Helper\Data as HelperCaptcha;
use Magento\Checkout\Block\Checkout\LayoutProcessorInterface;
class LayoutProcessor implements LayoutProcessorInterface
{
/**
* @param HelperCaptcha $helper
*/
public function __construct(
private readonly HelperCaptcha $helper
) {
}
/**
* Process jsLayout of checkout page
*
* @param array $jsLayout
* @return array
*/
public function process($jsLayout): array
{
if ($this->helper->getConfig('enable')) {
$jsLayout['components']['authenticationPopup']['children']['captcha'] = [
'component' => 'Magento_Captcha/js/view/checkout/loginCaptcha',
'displayArea' => 'additional-login-form-fields',
'formId' => 'user_login',
'configSource' => 'checkout'
];
}
return $jsLayout;
}
}