• 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]

Viewing 1 replies (of 1 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    Hi @irma8888,

    If the code is deactivated or deleted, then Code Snippets will stop running it on your site. I recommend ensuring you have completely cleaned any caching layers you might have active, and double-checking you don’t also have this code running through a different source.

Viewing 1 replies (of 1 total)
  • The topic ‘Deleted Code still working/affecting’ is closed to new replies.