Support » Plugin: WooCommerce » Custom Field’s Name in purchase page

  • Via function.php of my theme I changed named of some fields and hided few fields. The Tittle of Adress 2’s fild is apperaring, but title of Adress 1, and placeholder of both are not.
    My code:

    add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
    
    function custom_override_checkout_fields( $fields ) {
     
    unset($fields['billing']['billing_company']); 
    unset($fields['billing_company']['billing_company']); 
    unset($fields['billing']['billing_postcode']); // 
    unset($fields['billing']['billing_city']); // 
    unset($fields['billing']['billing_state']); //
     
    $fields['billing']['billing_address_1']['label'] = 'Область и город'; 
    $fields['billing']['billing_address_1']['placeholder'] = 'г. Киев';  
    $fields['billing']['billing_address_2']['label'] = 'Номер отделения почты'; 
    $fields['billing']['billing_address_2']['placeholder'] = 'Новая почта. Отделение №1'; 
    return $fields;
    }
    add_filter( 'woocommerce_default_address_fields' , 'custom_override_default_address_fields' );
     
    function custom_override_default_address_fields( $address_fields ) {
    $address_fields['state']['required'] = false; 
    $address_fields['postcode']['required'] = false;
    $address_fields['city']['required'] = false; 
     
    return $address_fields;
    }

    Site: https://greip.com.ua/checkout/

    • This topic was modified 4 years, 5 months ago by Dima Budzin.
  • The topic ‘Custom Field’s Name in purchase page’ is closed to new replies.