حذف / إزالة التفاصيل من الخروج في WooCommerce (الرمز البريدي ، الشركة ، الهاتف …)

WooCommerce este un sistem foarte simplu pentru oricine doreste sa creeze un مجلة على الانترنت, avand la baza وورد.
La instalarea default, WooCommerce va adauga un formular standard pentru detaliile de facturare. In pagina deCheckouta clientului.
Conceput ca un sistem de مجلة على الانترنت 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;
}

Undebilling_postcodeeste campul pentru codul postal. Daca dorim sa eliminam al doilea camp de adresa, vom inlocuibilling_postcode” النحاس “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.

شغوفة بالتكنولوجيا ، أكتب بسرور على موقع Stealthsetts.com بدءًا من عام 2006. لدي تجربة غنية في أنظمة التشغيل: MacOS و Windows و Linux ، ولكن أيضًا في لغات البرمجة ومنصات التدوين (WordPress) والمتاجر عبر الإنترنت (WooCommerce ، Magento ، Presashop).

Home مصدر دروس تكنولوجيا المعلومات الخاصة بك ونصائح وأخبار مفيدة. حذف / إزالة التفاصيل من الخروج في WooCommerce (الرمز البريدي ، الشركة ، الهاتف …)

6 أفكار حول "حذف / إزالة التفاصيل من الخروج في WooCommerce (الرمز البريدي ، الشركة ، الهاتف …)”

  1. 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. 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. Merhaba
    Ben ödeme kısmında kifatura bilgileriyazısınıteslimat adresiolarak değiştirmek istiyorum. Ne yapabiliriz.

    رد
    • مرحبًا،
      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.

      رد
اترك تعليقًا