• Resolved creativeundertaker

    (@creativeundertaker)


    Hi,

    I want to hide the City and Post Code field from the cart page.

    xyz.com/cart

    I found one solution but it didnt worked for me.

    https://woocommerce.com/posts/customize-checkout-fields-woocommerce/

    I followed Remove a checkout field instructions from the above page and inserted this in the snippet.

    /**
    Remove all possible fields
    **/
    function wc_remove_checkout_fields( $fields ) {

    // Billing fields
    unset( $fields[‘billing’][‘billing_city’] );
    unset( $fields[‘billing’][‘billing_postcode’] );

    // Shipping fields
    unset( $fields[‘shipping’][‘shipping_city’] );
    unset( $fields[‘shipping’][‘shipping_postcode’] );

    // Order fields
    unset( $fields[‘order’][‘order_comments’] );

    return $fields;
    }
    add_filter( ‘woocommerce_checkout_fields’, ‘wc_remove_checkout_fields’ );

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Senff – a11n

    (@senff)

    Hey @creativeundertaker

    Are you referring to the shipping calculator on the cart page?


    Image link: https://d.pr/i/7DShlT

    The easiest way to hide that, is to go to WooCommerce → Settings → Shipping → Shipping Options and then uncheck “Enable the shipping calculator on the cart page” first.

    You will also need some CSS code to hide it completely. Go to Appearance → Customize →?Additional CSS, and then in the CSS textbox on the left, add the following code:

    .woocommerce-cart .woocommerce-shipping-destination {
      display: none;
    }

    Select “Save Changes” from the top, and your changes will be applied to your site.

    Plugin Support mouli a11n

    (@mouli)

    It’s been a while since we heard from you, so I’m marking this thread resolved. Hopefully, you’ve been able to resolve this, but if you haven’t, please open up a new topic and we’ll be happy to help out.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hide City and Postcode from Cart page’ is closed to new replies.