Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-checkout-agreements
view
frontend
templates
additional_agreements.phtml
Go to the documentation of this file.
1
<?php
7
// @codingStandardsIgnoreFile
8
12
if
(!
$block
->getAgreements()) {
13
return
;
14
}
15
17
$agreementsCollection
=
$block
->getAgreements();
18
$agreementMappedArray
= [];
20
foreach
(
$agreementsCollection
as
$agreement
) {
21
if
(
$agreement
->getIsActive()) {
22
$agreementMappedArray
[] = [
23
'mode'
=>
$agreement
->getMode(),
24
'agreementId'
=>
$agreement
->getAgreementId(),
25
'checkboxText'
=>
$agreement
->getCheckboxText(),
26
'content'
=>
$agreement
->getContent()
27
];
28
}
29
}
30
$agreementJson
= json_encode(
$agreementMappedArray
);
31
?>
32
33
<div data-bind=
"scope: 'checkout-agreements-component-scope'"
class
=
"checkout-agreements-block"
>
34
<!-- ko
template
: getTemplate() --><!-- /ko -->
35
</div>
36
<script type=
"text/x-magento-init"
>
37
{
38
"*"
: {
39
"Magento_Ui/js/core/app"
: {
40
"components"
: {
41
"checkout-agreements-component-scope"
: {
42
"component"
:
"Magento_CheckoutAgreements/js/view/checkout-agreements"
,
43
"agreements"
: <?=
/* @noEscape */
$agreementJson
?>,
44
"isVisible"
:
true
45
}
46
}
47
}
48
}
49
}
50
</script>
$agreementJson
foreach($agreementsCollection as $agreement) $agreementJson
Definition:
additional_agreements.phtml:30
$agreementMappedArray
$agreementMappedArray
Definition:
additional_agreements.phtml:18
$agreementsCollection
$agreementsCollection
Definition:
additional_agreements.phtml:17
$block
$block
Definition:
block.php:8
$agreement
$agreement
Definition:
agreement_active_with_html_content.php:8