Title: script conflict
Last modified: November 20, 2021

---

# script conflict

 *  Resolved [xszejdi](https://wordpress.org/support/users/xszejdi/)
 * (@xszejdi)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/script-conflict-5/)
 * Hi. Hope you are doing great. Thank you for such a great plugin, but I have a
   problem that looks like a conflict with my script, which consists in showing /
   removing fields for the invoice depending on whether the checkbox “I want to 
   receive an invoice” is checked or unchecked. The script is located in functions.
   php. If I disable the “Advanced script rendering” option in your plugin, everything
   works fine, but the plugin does not block cookies if the user does not consent.
 * My checkbox on the order page does not work properly until it accepts cookies.
   Below is a video that shows the problem:
 * [https://vimeo.com/648116789/23a61e7bd7](https://vimeo.com/648116789/23a61e7bd7)
 * I would like to ask for quick help because I care about time. The script in functions
   php consists of the following code:
 *     ```
       /**
        * @snippet       Add a Checkbox to Hide/Show Checkout Field - WooCommerce
        * @how-to        Get CustomizeWoo.com FREE
        * @author        Rodolfo Melogli
        * @compatible    WC 4.1
        * @donate $9     https://businessbloomer.com/bloomer-armada/
        */
   
       add_filter( 'woocommerce_checkout_fields' , 'bbloomer_display_checkbox_and_new_checkout_field' );
   
       function bbloomer_display_checkbox_and_new_checkout_field( $fields ) {
   
       $fields['billing']['billing_invoice_ask'] = array(
           'type'      => 'checkbox',
           'label'     => __('Checkbox label', 'woocommerce'),
           'class'     => array('woocommerce-validated'),
           'clear'     => true
       );
   
       return $fields;
   
       }
   
       add_action( 'woocommerce_after_checkout_form', 'bbloomer_conditionally_hide_show_new_field', 9999 );
   
       function bbloomer_conditionally_hide_show_new_field() {
   
         wc_enqueue_js( "
             jQuery('input#billing_invoice_ask').change(function(){
   
                if (! this.checked) {
                   // HIDE IF NOT CHECKED
       			jQuery('#billing_address_1_field').fadeOut();
                   jQuery('#billing_address_1_field').val('');
                   jQuery('#billing_last_name_field').fadeOut();
                   jQuery('#billing_last_name_field').val('');
       			jQuery('#billing_company_field').fadeOut();
       			jQuery('#billing_company_field').val('');
       			jQuery('#billing_vat_number_field').fadeOut();
       			jQuery('#billing_vat_number_field').val('');
       			jQuery('#billing_postcode_field').fadeOut();
       			jQuery('#billing_postcode_field').val('');
       			jQuery('#billing_city_field').fadeOut();
       			jQuery('#billing_city_field').val('');
   
                } else {
                   // SHOW IF CHECKED
       			jQuery('#billing_first_name_field').fadeIn();
                   jQuery('#billing_last_name_field').fadeIn();
       			jQuery('#billing_company_field').fadeIn();
       			jQuery('#billing_vat_number_field').fadeIn();
       			jQuery('#billing_address_1_field').fadeIn();
       			jQuery('#billing_postcode_field').fadeIn();
       			jQuery('#billing_city_field').fadeIn();
   
   
                }
   
             }).change();
         ");
   
       }
       ```
   
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fscript-conflict-5%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [WebToffee](https://wordpress.org/support/users/webtoffee/)
 * (@webtoffee)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/script-conflict-5/#post-15094722)
 * Hi [@xszejdi](https://wordpress.org/support/users/xszejdi/),
 * Greetings from Webtoffee!
 * We can see the facebook’s script and the check box-related scripts are merged
   into a single script tag. So it is blocked under the Faceboook pixel’s category.
 * If you can separate (eg: add it as inline) the script from facebook’s script,
   it would solve the issue.
 *  Thread Starter [xszejdi](https://wordpress.org/support/users/xszejdi/)
 * (@xszejdi)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/script-conflict-5/#post-15104951)
 * Hi. Unfortunately, I don’t know how to add a pixel script in a separate tag because
   I use the “Facebook for WordPress” plugin. Can I put the checkbox script in a
   different tag instead? if so, can you help me convert my PHP snippet (placed 
   above by me) to make it work?
 * Best,
    Matthew.
 *  Plugin Author [WebToffee](https://wordpress.org/support/users/webtoffee/)
 * (@webtoffee)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/script-conflict-5/#post-15112107)
 * Hi [@xszejdi](https://wordpress.org/support/users/xszejdi/),
 * Then please try deactivating that plugin and adding the Facebook tracking script
   directly via any of the cookie categories. You will find the field to insert 
   script under GDPR Cookie Consent > Cookie Category > Edit page.
 *  Thread Starter [xszejdi](https://wordpress.org/support/users/xszejdi/)
 * (@xszejdi)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/script-conflict-5/#post-15115240)
 * It works. You’re the best. Thank you.
 *  Plugin Author [WebToffee](https://wordpress.org/support/users/webtoffee/)
 * (@webtoffee)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/script-conflict-5/#post-15116355)
 * Hi [@xszejdi](https://wordpress.org/support/users/xszejdi/),
 * That’s great. If you like our plugin and support, please [leave us a review.](https://wordpress.org/support/plugin/cookie-law-info/reviews/#new-post)

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘script conflict’ is closed to new replies.

 * ![](https://ps.w.org/cookie-law-info/assets/icon.svg?rev=3007243)
 * [CookieYes – Cookie Banner for Cookie Consent (Easy to setup GDPR/CCPA Compliant Cookie Notice)](https://wordpress.org/plugins/cookie-law-info/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cookie-law-info/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cookie-law-info/)
 * [Active Topics](https://wordpress.org/support/plugin/cookie-law-info/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cookie-law-info/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cookie-law-info/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [WebToffee](https://wordpress.org/support/users/webtoffee/)
 * Last activity: [4 years, 6 months ago](https://wordpress.org/support/topic/script-conflict-5/#post-15116355)
 * Status: resolved