getAgreements()) { return; } /** @var \Magento\CheckoutAgreements\Model\ResourceModel\Agreement\Collection $argeementsCollection */ $argeementsCollection = $block->getAgreements(); $agreementMappedArray = []; /** @var \Magento\CheckoutAgreements\Model\Agreement $agreement */ foreach ($argeementsCollection as $agreement) { if ($agreement->getIsActive()) { $agreementMappedArray[] = [ 'mode' => $agreement->getMode(), 'agreementId' => $agreement->getAgreementId(), 'checkboxText' => $agreement->getCheckboxText(), 'content' => $agreement->getContent() ]; } } $agreementJson = json_encode($agreementMappedArray); ?>