Title: Deleted Code still working/affecting
Last modified: November 16, 2022

---

# Deleted Code still working/affecting

 *  [irma8888](https://wordpress.org/support/users/irma8888/)
 * (@irma8888)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/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](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdeleted-code-still-working-affecting%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Author [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * (@bungeshea)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/deleted-code-still-working-affecting/#post-16540253)
 * Hi [@irma8888](https://wordpress.org/support/users/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.

 * ![](https://ps.w.org/code-snippets/assets/icon.svg?rev=2148878)
 * [Code Snippets](https://wordpress.org/plugins/code-snippets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/code-snippets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/code-snippets/)
 * [Active Topics](https://wordpress.org/support/plugin/code-snippets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/code-snippets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/code-snippets/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * Last activity: [3 years, 3 months ago](https://wordpress.org/support/topic/deleted-code-still-working-affecting/#post-16540253)
 * Status: not a support question