Hide City and Postcode from Cart page
-
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’ );
- The topic ‘Hide City and Postcode from Cart page’ is closed to new replies.