Deleted Code still working/affecting
-
Hi,
I created a code for hide some fields in the checkout of woocommerce. It works ok, but now I need to show these fields and although I have change the code, desactivated de code and even deteled, the fields didn’t show up.
This is the code:
add_filter( ‘woocommerce_checkout_fields’ , ‘ayudawp_pago_virtual_simple’ );
function ayudawp_pago_virtual_simple( $fields ) {$only_virtual = true;
foreach( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
// Comprobamos si hay productos que no sean virtuales
if ( ! $cart_item[‘data’]->is_virtual() ) $only_virtual = false;
}if( $only_virtual ) {
unset($fields[‘billing’][‘billing_first_name’]);
unset($fields[‘billing’][‘billing_last_name’]);
unset($fields[‘billing’][‘billing_company’]);
unset($fields[‘billing’][‘billing_address_1’]);
unset($fields[‘billing’][‘billing_address_2’]);
unset($fields[‘billing’][‘billing_city’]);
unset($fields[‘billing’][‘billing_postcode’]);
unset($fields[‘billing’][‘billing_phone’]);
unset($fields[‘billing’][‘billing_nif’]);
add_filter( ‘woocommerce_enable_order_notes_field’, ‘__return_false’ );
}return $fields;
}`The page I need help with: [log in to see the link]
- The topic ‘Deleted Code still working/affecting’ is closed to new replies.