• Resolved patchyart

    (@patchyart)


    Even when resizing the window to mobile on desktop the scroll to doesn’t work. This is true even in enhanced compatibility mode, really high AJAX scroll adjustment values. However it does weirdly work when in a normal full sized browser

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

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author annastaa

    (@annastaa)

    Hello Patchyart,

    Please check which software running on your site adds folders inside of the native annasta (and possibly other plugins?) paths! For example, there doesn’t exist a wp-content/plugins/annasta-woocommerce-product-filters(-premium)/code/src folder in the original plugin installation. These additional folders seem to contain scripts that interfere with the proper work of the jQuery scroll animation functions used by the filters, and most likely that is why you get the issue.

    Also, if possible, please update the filters to the latest version!

    Thread Starter patchyart

    (@patchyart)

    Hi, thank you for your reply!

    I’m not sure how to check what this software is or how to check, i will ask my hosting provider.

    On a seperate note is there a way to add a filter based on Shipping Class?

    Thanks

    • This reply was modified 1 year, 8 months ago by patchyart.
    Plugin Author annastaa

    (@annastaa)

    Patchyart, I hope your provider can help with the task of figuring out the source of that custom JS!

    As for your question about the shipping class filters, there actually exists a way to add this functionality, but you would need to use a few lines of custom PHP code. If you have a child theme, go to its functions.php and add the following snippet at the end:

    if( class_exists( 'A_W_F' ) ) {
      A_W_F::$excluded_taxonomies = array_diff( A_W_F::$excluded_taxonomies, array( 'product_shipping_class' ) );
    }

    After that you should start getting the Product shipping classes option in the Add filter select box as well as the Display on section of any preset.

    Thread Starter patchyart

    (@patchyart)

    Hi,

    I’ve been in contact with my hosting service and they are unsure where that would be coming from on their end. I have tried turning all other plugins off and changing themes but that /src file is still there.

    Any advice you have moving forward would be appreciated

    Thanks

    Plugin Author annastaa

    (@annastaa)

    Hello Patchyart,

    To tell you the truth, if I were you, I would like to know if something were intervening into the work of my site in such a manner! Could it perhaps be some theme option? though I don’t understand why a theme would serve its scripts from a 3d party folder..

    It’s easy to re-install the original plugin folder and get the src folders wiped off: you can either replace the wp-content/plugins/annasta-woocommerce-product-filters/ folder with the same version downloaded from the official WordPress page, or update the plugin to the next version from within the Plugins page of WP admin. This way the whole contents of the folder gets overwritten.

    Problem is, if something has put this code there, there is a chance that other parts of your site may depend on it, and you may start getting errors and functionality loss. You could try backing up the site, or just the annasta folder, and updating the filters, to see if the src folder disappears without problems. Revert the changes if you run into issues.

    Thread Starter patchyart

    (@patchyart)

    Hi,

    Looking into the annasta plugin /code folder, there is no /src folder that exists on the backend. So something else is creating this folder and erroneously putting into the annasta filter folder?

    Thread Starter patchyart

    (@patchyart)

    Even when turning off all plugins except woocommerce and annasta and changing to another theme, the /src folder is still created

    Plugin Author annastaa

    (@annastaa)

    Hello again Patchyart,

    I have checked it a bit further, and the src folder is after all irrelevant to your problem! Just like you say, it seems to be virtually created, and more specifically, it seems to be enabled by the range slider and JS-driven scrollbar components attached to the filters.

    While investigating the above, I have found the actual source for your AJAX scroll troubles. It is in fact a CSS issue with your theme that sets the absolute position to its body element in mobile views. If you still need to address this, below is the custom script that can be added in the annasta Filters > Plugin settings > Custom JavaScript box to adjust the page scroll of your mobile views:

    jQuery( document ).on( 'awf_after_ajax_products_update', function() {
      if( ( 'ajax_scroll' in awf_data ) && 'absolute' === jQuery( 'body' ).css( 'position' ) ) {
        jQuery( '#page' ).animate( { scrollTop: parseInt( awf_data.ajax_scroll, 10 ) }, 500, 'swing');
      }
    });

    I would like to stress that this script is the custom adjustment for your particular theme and its (possibly changing) options. You can further adjust the scroll position by replacing the parseInt( awf_data.ajax_scroll, 10 ) with any numeric value.

    Thread Starter patchyart

    (@patchyart)

    Hi, thank you that works perfectly! However, testing on chrome mobile shows that although the scroll adjustment works, nothing can be clicked after the next page of products loads. This is not the case on safari weirdly.

    Testing without the scroll adjustment script on chrome shows that this was a problem that was happening before without us noticing.

    Is this an issue you have come across before?

    Thank you for all your help,

    Leo

    Plugin Author annastaa

    (@annastaa)

    Hello Leo,

    I couldn’t reproduce the error on Chrome browser, neither on desktop, nor on mobile. When you say “nothing can be clicked after the next page of products loads” do you refer to the pagination, or any filter application?

    Could it be some kind of weird caching glitch, have you tried clearing the cache, or using an incognito tab?

    Plugin Author annastaa

    (@annastaa)

    Dear Leo,

    I will go ahead and close this inactive thread, please open a new one if you get any further questions about the work of the filters!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Scroll to AJAX results doesn’t work on mobile/smaller windows?’ is closed to new replies.