• Hello,
    Thanks for nice plugin
    can you please help me to use javascript hook
    https://docs.berocket.com/plugin/woocommerce-ajax-products-filter#javascript-2
    I don’t know where I should put this code

    bapf_custom_smb_open_function = function(use_default, $this) {
        $this.find('.bapf_body').first().show();
        if( $this.find('.bapf_colaps_smb').length ) {
            $this.find('.bapf_colaps_smb').removeClass('fa-chevron-down').addClass('fa-chevron-up');
        }
        return false;
    }
    if ( typeof(berocket_add_filter) == 'function' ) {
        berocket_add_filter('colaps_smb_open_apply', bapf_custom_smb_open_function);
    } else {
        jQuery(document).on('berocket_hooks_ready', function() {
            berocket_add_filter('colaps_smb_open_apply', bapf_custom_smb_open_function);
        });
    }
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author RazyRx

    (@razyrx)

    Hello,

    It is JavaScript code and you need to add it to some JavaScript file that will be loaded on the page or add it inline on the page.

    Regards,
    Oleg

    Thread Starter Harry

    (@perfeshnal)

    thanks for your response
    before I make this topic I added this code on a js file and also inline but I don’t know why is not working and not effect on page.
    I see code also when check source on browser.
    please show me right way to add this code on my functions.php and you sure is works

    Thread Starter Harry

    (@perfeshnal)

    I’m waiting for your answer

    Plugin Author RazyRx

    (@razyrx)

    Hello,

    Code example provided in documentation doing same thing as default code in plugin.

    Regards,
    Oleg

    Thread Starter Harry

    (@perfeshnal)

    unfortunately your response not helping me my friend!
    I read plugin document before then came here and open a topic
    is not so hard for you if your JavaScript hook working perfectly tell me how I use it in my functions.php with a sample

    Plugin Author Dmytro Holovnia

    (@dholovnia)

    Hi,

    Please try to read provided answer more attentively.

    “Code example provided in documentation doing same thing as default code in plugin”. It means that adding this code will not change anything. You need to edit it somehow to see the difference. Did you change anything in the code example? fa-chevron-down or fa-chevron-up to something else? Or add some class that will make color red?

    Regards,
    Dima

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘JavaScript hooks on plugin’ is closed to new replies.