• Resolved Rhand

    (@rhand)


    Using

    berocket_remove_filter

    In custom JS using

    
    ...
    jQuery(document).ready(function ($) {
    // remove default filter hooks
    berocket_remove_filter('update_products', braapf_update_products);
    berocket_remove_filter('update_products',   braapf_close_tippy);
    berocket_remove_filter('update_products',   braapf_update_products_search_field, 2);
    // init request
    var currentRequest = null,
    timeout = null;
    ...
    });

    But is seems to not load on time and or clash with wp-content/plugins/woocommerce-ajax-filters/includes/compatibility/divi-theme-builder.php

    Our script is loaded with

    <?php if ($header): ?>
    <script type="text/javascript" src="<?php echo( CONSTANT_URL . '/assets/js/file.js?v=' . CONSTANT_VERSION ); ?>"></script>
    <?php endif ?>
    


    on wp-content/plugins/plugin-name-slug/templates/product-list.php .

    Any suggestions to improve our addition to work in tandem with plugin?

    • This topic was modified 8 months, 3 weeks ago by Rhand.
    • This topic was modified 8 months, 3 weeks ago by Rhand.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author RazyRx

    (@razyrx)

    Hello,

    It is better to use this code instead document ready

    if ( typeof(berocket_add_filter) == 'function' ) {
        //part of code to remove filters
    } else {
        jQuery(document).on('berocket_hooks_ready', function() {
            //part of code to remove filters
        });
    }

    What exactly issue do you have with “includes/compatibility/divi-theme-builder.php” file?

    Regards,
    Oleg

    Thread Starter Rhand

    (@rhand)

    Thanks for the feedback. Will look into these options.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can’t find variable: berocket_remove_filter’ is closed to new replies.