• The value of the Consented By Default setting has no affect on the checkbox that appears on the Booking form.

    It doesn’t look like the checkbox method that checks for the value of dbem_data_comms_consent_default, so it’s not checked by default.

    /**

    * Outputs a checkbox that can be used to obtain consent.

    * @param EM_Event|EM_Location|EM_Booking|bool $EM_Object

    */

    public static function checkbox( $EM_Object = false ){

    if( !empty($EM_Object) && (!empty($EM_Object->booking_id) || !empty($EM_Object->post_id)) ) return; //already saved so consent was given at one point

    if( !doing_action('em_booking_form_after_user_details') && did_action('em_booking_form_after_user_details') ) return; // backcompat

    $label = static::get_label();

    // check if consent was previously given and check box if true

    if( is_user_logged_in() ){

    $consent_given_already = get_user_meta( get_current_user_id(), static::$options['meta_key'], true );

    if( !empty($consent_given_already) && get_option( static::$options['remember'] ) == 1 ) return; //ignore if consent given as per settings

    if( !empty($consent_given_already) && get_option( static::$options['remember'] ) == 2 ) $checked = true;

    }

    if( empty($checked) && !empty($_REQUEST[ static::$options['param'] ]) ) $checked = true;

    // output checkbox

    ?>

    <p class="input-group input-checkbox em-consent-checkbox input-field-data_<?php echo esc_attr(static::$prefix); ?>">

    <label>

    <input type="checkbox" name="<?php echo esc_attr(static::$options['param']) ?>" value="1" <?php if( !empty($checked) ) echo 'checked="checked"'; ?>>

    <?php echo $label; ?>

    </label>

    </p>

    <?php

    }

The topic ‘Communications Consent – Default Setting Doesn’t Affect Form’ is closed to new replies.