I know that there is basic functionality, but it does not suit me.
How to display my template under the form with the link to the privacy-policy page?
Or tell me how to do it right. I need a checkbox under the form that asks to confirm that the privacy policy has been read.
I create a js file: app/design/frontend/Vendor/theme/Magento_Checkout/web/js/checkout-privacy.js
define(
['ko', 'uiComponent'],
function (ko, Component) {
"use strict";
return Component.extend({
defaults: {
template: 'Magento_Checkout/checkout-privacy/checkout-privacy'
}
});
}
);
and file: app/design/frontend/Vendor/theme/Magento_Checkout/web/template/checkout-privacy/checkout-privacy.html
<form id="checkbox-policy-form" data-mage-init='{"validation":{}}'>
<input type="checkbox" class="checkbox-policy input required-entry" data-validate="{ required: true, 'validate-one-required-by-name': true, attr: { id: 'checkbox-policy' }}">
<label class="label" data-bind="attr: {for: 'checkbox-policy'}">
<span data-bind="i18n: 'I agree to the'"></span>
<a href="checkbox-policy" data-bind="i18n: 'Terms and Conditions'"></a>
</label>
</form>
<script type="text/x-magento-init">
{
"#checkbox-policy-form": {
"validation": {}
}
}
</script>
on payment step
<span data-bind="i18n: 'I agree to the'"></span><a href="checkbox-policy" data-bind="i18n: 'Terms and Conditions'"></a>