• Resolved masterile

    (@masterile)


    Hi, hope someone can help me.

    I have added some checkboxes to filter products in the shop widget side bar. Now when I am not logged in to wordpress the page keeps on loading when selecting a (random)checkbox. So it is not showing any products. Weird thing is that it is working fine when I am logged in to wordpress. Issue seems to be present with IE10, firefox and chrome. (not tested any others.) Any suggestions?

    Site:

    https://wordpress.org/plugins/woocommerce-ajax-filters/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter masterile

    (@masterile)

    Plugin Author RazyRx

    (@razyrx)

    Hi,

    On update the products plugin trying to get products from file wp-admin/admin-ajax.php, but can’t get access to this file, please check that you doesn’t block access to this file.

    Regards,
    Oleg

    Thread Starter masterile

    (@masterile)

    Hi Oleg,

    Thanks for the reply! unfortunately I have to little knowledge to say if I am blocking access. But i think you are right:


    if ( is_user_logged_in() ) {
    /**
    * Fires authenticated AJAX actions for logged-in users.
    *
    * The dynamic portion of the hook name, $_REQUEST['action'],
    * refers to the name of the AJAX action callback being fired.
    *
    * @since 2.1.0
    */
    do_action( ‘wp_ajax_’ . $_REQUEST[‘action’] );
    } else {
    /**
    * Fires non-authenticated AJAX actions for logged-out users.
    *
    * The dynamic portion of the hook name, $_REQUEST['action'],
    * refers to the name of the AJAX action callback being fired.
    *
    * @since 2.8.0
    */
    do_action( ‘wp_ajax_nopriv_’ . $_REQUEST[‘action’] );
    }
    // Default status
    die( ‘0’ );

    Is it just a matter of copy pasting the code from the logged-in code onto the logged-out code?

    Thread Starter masterile

    (@masterile)

    I have found the solution. You were right the ajax.php was being blocked.
    I used

    # Allow access to wp-admin/admin-ajax.php
    <Files admin-ajax.php>
    Order allow,deny
    Allow from all
    Satisfy any
    </Files>”

    To solve it. Can you tell me if this is safe to use like this?

    Plugin Author RazyRx

    (@razyrx)

    Hi,

    yes, this is safe, because by default this file is open for any access.

    Regards,
    Oleg

    Thread Starter masterile

    (@masterile)

    Thanks a lot, you are the man:)

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

The topic ‘checkbox not loading products.’ is closed to new replies.