1.
Paket
auswählen

 

 

 

 

2.
Domain
angeben

 

 

 

 

3.
Screenshots
hochladen

 

 

 

4.
Wir
kümmern
uns darum!

 

Inhaltsverzeichnis

Hier eine einfache Möglicheit beim Checkout / Kasse die Abfrage des Bundeslandes zu deaktivieren. Fügen Sie einfach in die functions.php Ihres WordPress Themes folgende Zeile:

add_filter( 'woocommerce_states' , 'keep_specific_country_states', 10, 1 );
function keep_specific_country_states( $states ) {
$new_country_states = array();

// Loop though all country states
foreach( $states as $country_code => $country_states ){
if( ! in_array( $country_code, $countries ) ){
// Remove states from all countries except the defined ones
$states[$country_code] = array();
}
}
return $states;
}

 

Falls Sie die Abfrage dennoch für ein bestimmtes Land wollen. Fügen Sie die jeweilige Länderkennung hinzu:

add_filter( 'woocommerce_states' , 'keep_specific_country_states', 10, 1 );
function keep_specific_country_states( $states ) {
// LANDKENNUNG

$countries = array('DE', 'AT', 'IT');

$new_country_states = array();

// Loop though all country states
foreach( $states as $country_code => $country_states ){
if( ! in_array( $country_code, $countries ) ){
// Remove states from all countries except the defined ones
$states[$country_code] = array();
}
}
return $states;
}

WordPress Theme: Manche Themes bieten diese Einstellung unter Customizer –> WooCommerce –> Kasse / Checkout