Ich bekomme diesen Code, um ein benutzerdefiniertes Feld zum WooCommerce Billing Formular hinzuzufügen.Ein benutzerdefiniertes Feld zu WooCommerce Fakturierungsformular hinzufügen?
Das Feld wird gezeigt, aber das Problem ist, dass das Feld nicht label
hat noch placeholder
noch class name
.
Was fehlt mir hier? Ich habe diesen Code zu functions.php in meinem Child Theme hinzugefügt.
/*******************************
CUSTOM BILLING FIELD
******************************** */
add_filter('woocommerce_billing_fields', 'custom_woocommerce_billing_fields');
function custom_woocommerce_billing_fields($fields)
{
$fields['billing']['billing_options'] = array(
'label' => __('NIF', 'woocommerce'), // Add custom field label
'placeholder' => _x('Your NIF here....', 'placeholder', 'woocommerce'), // Add custom field placeholder
'required' => false, // if field is required or not
'clear' => false, // add clear or not
'type' => 'text', // add field type
'class' => array('my-css') // add class name
);
return $fields;
}
Sie können Ihren Code für das Custombilling-Feld zu der 'get_default_address_fields()' Funktion in der 'class-wc-countries.php' Datei hinzufügen –