• Resolved matthewalynd

    (@matthewalynd)


    I’m using the YMM Search plugin, and I’m running into an Ajax error when I try to filter products on the shop page. I have one product set up with restrictions to test this out, and the dropdown for Make shows Honda, but when you select Honda it gives a 403 error in the console:

    jquery.min.js?ver=3.7.1:2   
    GET https://mikescustommachining.com/wp-content/plugins/ymm-search/ymm_ajax.php?action=ymm_selector_fetch&cId=0&values%5B%5D=Honda 403 (Forbidden)

    What could be causing this? Is there a common setting in the hosting server that could cause this?

    The page I need help with: [log in to see the link]

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

    (@greenwebdesignone)

    I have same issue ??

    Plugin Author Pektsekye

    (@pektsekye)

    Hello,

    There is a setting in the .htaccess file or a security wordpress plugin that
    blocks access to custom .php files.

    Try to replace this line:

    
       return Pektsekye_YMM()->getPluginUrl() . 'ymm_ajax.php';
    

    with:

    
       return '';
    

    in the file:
    wp-content/plugins/ymm-search/Block/Selector.php

    This way it will use the core wordpress ajax functions.
    But it may be slow, as each time it will need to load multiple wordpress files.

    Stanislav

    Thread Starter matthewalynd

    (@matthewalynd)

    Thank you! My site hosting is pretty fast, so removing the ymm ajax did the trick, it’s nice and speedy.

    Followup question: Can I make the search show the shop page when there’s only 1 filter result? Currently it goes directly to that product, but I think it’s a smoother user experience to still show the archive with the 1 result.

    Plugin Author Pektsekye

    (@pektsekye)

    Hello,

    > make the search show the shop page when there’s only 1 filter result?

    Try to add the line:

    
    add_filter('woocommerce_redirect_single_search_result', '__return_false');
    

    at the end of the file:
    wp-content/plugins/ymm-search/ymm-search.php

    Stanislav

    Thread Starter matthewalynd

    (@matthewalynd)

    That did it! Thank you very much, your support is legendary.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘403 Forbidden Error on Ajax’ is closed to new replies.