您好我一直在尝试在我的Woocommerce结帐页面添加一个额外的条件复选框,与条款和条件相同,但有关于新GDPR(数据保护)的信息和我的隐私政策的链接.他们必须在结账前打勾.
我一直在使用我在这里找到的各种代码片段,并设法添加一个条件复选框和一些文本,但无法添加隐私政策的链接.我必须在Checkout Box下面添加它.理想情况下,我希望在条款和条件之一的复选框旁边显示链接.
任何有助于在结帐框中获取隐私页面链接的帮助将不胜感激.
条件复选框隐私政策链接截图:
这是我到目前为止所拥有的:
//Here is the function for adding the checkbox:
function cw_custom_checkbox_fields( $checkout ) {
echo '<div class="cw_custom_class"><h3>'.__('Give Sepration Heading: ').'</h3>';
woocommerce_form_field( 'custom_checkbox', array(
'type' => 'checkbox',
'label' => __('Agreegation Policy.'),
'required' => true,
), $checkout->get_value( 'custom_checkbox' ));
echo '</div>';
}
add_action('woocommerce_checkout_after_terms_and_conditions', 'checkout_additional_checkboxes');
function checkout_additional_checkboxes( ){
$checkbox1_text = __( "I have read and accept the Privacy Policy and understand how you manage my Data under GDPR", "woocommerce" );
?>
<p class="form-row custom-checkboxes">
<label class="woocommerce-form__label checkbox custom-one"> …Run Code Online (Sandbox Code Playgroud)