Support » Plugin: Checkout Field Editor (Checkout Manager) for WooCommerce » Missing function after update

  • Resolved nicolasrenard

    (@nicolasrenard)


    I use the thwcfd_billing_fields_lite function in checkout-form-designer.php file but it has disappeared in the new version.
    Can you help me ?
    Here is the code I use :

    $fields = thwcfd_billing_fields_lite();
        $gender_html = '';
    
        if( isset( $fields['billing_gender'] ) && !empty( $fields['billing_gender']['options'] ) ){
            $gender_html .= '<p class="clearfix">
                <label>%s<br />
                <select id="gender" class="user_gender select" tabindex="75" name="gender">';
                $i = 0;
                foreach( $fields['billing_gender']['options'] as $key=>$gender ) :
                    $gender_html .= '<option value="' . $gender . '"';
                    if ( $i === 0 )
                        $gender_html .= ' selected="selected"';
                    $i++;
                    $gender_html .= '>' . $gender . '</option>';
                endforeach;
            $gender_html .= '</select></label></p>';
        }
Viewing 1 replies (of 1 total)
  • Plugin Author ThemeHigh

    (@themehigh)

    In the latest version of our plugin, to get the field settings you have to use the function “THWCFD_Utils::get_fields(‘billing’);” instead of “thwcfd_billing_fields_lite();“.

    You can use the below code:

    if(class_exists('THWCFD_Utils')){
        $fields = THWCFD_Utils::get_fields('billing');
        $gender_html = '';
    
        if( isset( $fields['billing_gender'] ) && !empty( $fields['billing_gender']['options'] ) ){
           $gender_html .= '<p class="clearfix">
               <label>%s<br />
               <select id="gender" class="user_gender select" tabindex="75" name="gender">';
               $i = 0;
               foreach( $fields['billing_gender']['options'] as $key=>$gender ) :
                   $gender_html .= '<option value="' . $gender . '"';
                   if ( $i === 0 )
                       $gender_html .= ' selected="selected"';
                   $i++;
                   $gender_html .= '>' . $gender . '</option>';
               endforeach;
           $gender_html .= '</select></label></p>';
        }
    }

    Hope this help.

    Thank you!

Viewing 1 replies (of 1 total)
  • The topic ‘Missing function after update’ is closed to new replies.