ved

6

Slett / fjern detaljer fra kassen i WooCommerce (postnummer, selskap, telefon …)

Slett / fjern detaljer fra kassen i WooCommerce (postnummer, selskap, telefon …)

6

WooCommerce este un sistem foarte simplu pentru oricine doreste sa creeze un Magasin online, avand la baza WordPress.
La instalarea default, WooCommerce va adauga un formular standard pentru detaliile de facturare. In pagina deCheckouta clientului.
Conceput ca un sistem de Magasin online care sa permita atat livrarea unor produse fizice cat si descarcarea unora virtuale, WooCommerce cere in formularul standard o serie de date ale clientului: Nume, Prenume, Numar de telefon, Tara, Adresa, Oras, Cod Postal. Unele dintre aceste campuri nu ne sunt necesare pentru o comanda virtuala de exemplu. Un produs care sa poata fi descarcat sau un produs care a fost platit prin PayPal nu ar avea nevoie de datele pentru livrare. In acest caz este bine sa usuram sistemul de comanda pentru utilizator, prin eliminarea unor campuri din Checkout.

Eliminarea campuluiCod Postaldin WooCommerce Checkout

Sa putem eliminaCodul Postal/ Billing Postcode din WooCommerce, trebuie sa mergem si sa editam fisierul functions.php al temei de WordPress care este activa pe website. In functions.php adaugam liniile:

add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
function custom_override_checkout_fields( $fields ) {
unset($fields['billing']['billing_postcode']);
return $fields;
}

Hvor “billing_postcodeeste campul pentru codul postal. Daca dorim sa eliminam al doilea camp de adresa, vom inlocuibilling_postcode” Cu “billing_address_2”.

 unset($fields['billing']['billing_address_2']);

Sunt situatii in care s-ar putea sa nu intereseze niciun detaliu de plata al clientului. De regula atunci cand plata se face prin PayPal. In acest scenariu putem alege sa eliminam toate campurile din pagina de comanda.

add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
function custom_override_checkout_fields( $fields ) {
unset($fields['billing']['billing_postcode']);
unset($fields['billing']['billing_country']);
unset($fields['billing']['billing_state']);
unset($fields['billing']['billing_phone']);
unset($fields['order']['order_comments']);
unset($fields['billing']['billing_address_2']);
unset($fields['billing']['billing_postcode']);
unset($fields['billing']['billing_company']);
unset($fields['billing']['billing_last_name']);
unset($fields['billing']['billing_email']);
unset($fields['billing']['billing_city']);
return $fields;
}

In acest fel veti sterge toate campurile din WooCommerce Checkout.

Slett / fjern detaljer fra kassen i WooCommerce (postnummer, selskap, telefon …)

Du kan også være interessert i...

6 tanker om “Slett / fjern detaljer fra kassen i WooCommerce (postnummer, selskap, telefon …)

  1. louvet sier:

    Bonjour Merci pour ce post !
    J’avais besoin de supprimer le nom de l’entreprise et c’est parfait ça a fonctionné !!
    Je souhaite supprimer également le nom de l’entreprise surexpédier à une adresse différente”.
    mais je ne sais pas par quoi remplacer custom_override_checkout_fields dans votre code. Pourriez vous m’aider ?

  2. Nkem sier:

    Hi,I added this code to functions.php as guided but my website crashed. It’s totally blank. I’m not totally new to stuff like this but i’m not a pro either.

    If i could access my dashboard, i would just erase it but i cannot access anything on my website at all.

    Please help, what should i do? Urgent response needed please!

  3. Musa sier:

    Merhaba
    Ben ödeme kısmında kifatura bilgileriyazısınıteslimat adresiolarak değiştirmek istiyorum. Ne yapabiliriz.

  4. kadın spor sier:

    teşekkürler gerçekten ariyordum.Müşteriler posta kodunu bilmediği için çok sorun yaşamıştım teşekkürler

  5. Souza Martin sier:

    Agora dá pra fazer direto pelo painel de personalizar do wordpress, super prático. (wp-admin/customize.php?)

    1. Stealth sier:

      Hallo,
      Yes, is a good ideea in customizer but in the latest version of Woo I see onlyaddress 2”, “company. For postal code and oher fileds is req functions code to hide.

Legg igjen et svar

E-postadressen din vil ikke bli publisert. Nødvendige felt er merket *