• Good day!

    My client has a pizzeria, and the don’t deliver. Only local pick up. But in the form on the checkout page there is input windows “Address”, “Postal Code” and “City”. If we leave its empty – we can not order.
    This is why “display:none” can not help.

    I need to remove that parts from the page.

    https://wordpress.org/plugins/woocommerce/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @Elizaurus, you can paste below codes into your theme functions.php:

    add_filter( 'woocommerce_default_address_fields', 'custom_override_default_address_fields' );
    
    function custom_override_checkout_fields( $address_fields ) {
        unset( $address_fields['address_1'] );
        unset( $address_fields['address_2'] );
        unset( $address_fields['city'] );
        unset( $address_fields['state'] );
        unset( $address_fields['postcode'] );
        unset( $address_fields['country'] );
    
        return $fields;
    }
    Thread Starter Stanislav Mykhaylenko

    (@elizaurua)

    Thanks a lot.

    Unfortunately i’m not as good in wordpress and woocommerce so I made this in another way:
    wp-content/plugins/woocommerce/includes/class-wc-countries.php

    'address_1' => array(
    				'required'    => false,
    			),
    			'address_2' => array(
    				'required'    => false
    			),
    			'city' => array(
    				'required'    => false,
    			),
    			'state' => array(
    				'required'    => false,
    			),
    			'postcode' => array(
    				'required'    => false,
    			),

    In styles.css they had same class, so i made display:none

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove Address from checkout page’ is closed to new replies.