• Resolved charmp121

    (@charmp121)


    Hi,

    I am using your login plugin but when I try to register on my site as new user – get a message that’Privacy Policy consent is required!’. There is no checkbox on the popup. How and where would I add the checkbox option so that new users could register on my site.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor xootixsupport

    (@xootixsupport)

    Hi,

    Do you have any other plugin related to privacy checkbox?
    Please provide your website link.

    Thread Starter charmp121

    (@charmp121)

    Sorry for the delay getting back to you – the code I added to the site was the following…

    /**
    * @snippet Add Privacy Policy Checkbox @ WooCommerce My Account Registration Form
    */

    add_action( ‘woocommerce_register_form’, ‘bbloomer_add_registration_privacy_policy’, 11 );

    function bbloomer_add_registration_privacy_policy() {

    woocommerce_form_field( ‘privacy_policy_reg’, array(
    ‘type’ => ‘checkbox’,
    ‘class’ => array(‘form-row privacy’),
    ‘label_class’ => array(‘woocommerce-form__label woocommerce-form__label-for-checkbox checkbox’),
    ‘input_class’ => array(‘woocommerce-form__input woocommerce-form__input-checkbox input-checkbox’),
    ‘required’ => true,
    ‘label’ => ‘I\’ve read and accept the Privacy Policy‘,
    ));

    }

    // Show error if user does not tick

    add_filter( ‘woocommerce_registration_errors’, ‘bbloomer_validate_privacy_registration’, 10, 3 );

    function bbloomer_validate_privacy_registration( $errors, $username, $email ) {
    if ( ! (int) isset( $_POST[‘privacy_policy_reg’] ) ) {
    $errors->add( ‘privacy_policy_reg_error’, __( ‘Privacy Policy consent is required!’, ‘woocommerce’ ) );
    }
    return $errors;
    }

    Required the privacy policy checkbox to be checked from woo login / register pages. However, I deactivated the code now and your plugin works fine now.
    Just wanted to let you know the code I was using. Once activated – it would require a privacy policy checkbox so it would not let people login until box was checked which was not visible with your login popup.
    Please review and advise. Thanks.

    Plugin Contributor xootixsupport

    (@xootixsupport)

    Hi,

    Terms & Conditions checkbox is available in the new version,
    So you can keep your code only for the woocommerce page.
    Here is the modified version of your code.

    add_action( ‘woocommerce_register_form’, ‘bbloomer_add_registration_privacy_policy’, 11 );
    
    function bbloomer_add_registration_privacy_policy() {
    
    woocommerce_form_field( ‘privacy_policy_reg’, array(
    ‘type’ => ‘checkbox’,
    ‘class’ => array(‘form-row privacy’),
    ‘label_class’ => array(‘woocommerce-form__label woocommerce-form__label-for-checkbox checkbox’),
    ‘input_class’ => array(‘woocommerce-form__input woocommerce-form__input-checkbox input-checkbox’),
    ‘required’ => true,
    ‘label’ => ‘I\’ve read and accept the Privacy Policy‘,
    ));
    
    }
    
    // Show error if user does not tick
    
    add_filter( ‘woocommerce_registration_errors’, ‘bbloomer_validate_privacy_registration’, 10, 3 );
    
    function bbloomer_validate_privacy_registration( $errors, $username, $email ) {
    
    if( isset($_POST['_xoo_el_form'] ) ){
    	return;
    }
    
    if ( ! (int) isset( $_POST[‘privacy_policy_reg’] ) ) {
    $errors->add( ‘privacy_policy_reg_error’, __( ‘Privacy Policy consent is required!’, ‘woocommerce’ ) );
    }
    return $errors;
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Requires Privacy Policy checkbox’ is closed to new replies.