fbpx
Enjoy Year-End Sale: 50% Off All Plugins! Coupon Code: NewYear2025

Variation swatch on archive page doesn’t work with OceanWP infinite scroll

Hi,

I’m using Ocean WP wordpress theme and I would like to use infinite scroll pagination but when activated my user can’t use the color selector on archive page for products loaded by infinite scroll.

Could you help me to fix this please ? The swatch buttons to pick colors are working well on page load or using classic pagination but it seems like a script is necessary to make it work for product loaded by infinite scroll.

I think it could be a good update for the plugin as Ocean WP theme is used by many websites.

Thank you very much in advance for your help
Best regards

Tanvirul Haque

Hi Benjamin,

Thanks for reaching us.

We need an event from your infinite scroll plugin that should be triggered after new posts are loaded.

Just send this plugin to your infinite scroll plugin developer: https://wordpress.org/plugins/malinky-ajax-pagination/

And ask them to send trigger like following as the Malinky Ajax Pagination plugin provides.
document.addEventListener(‘malinkyLoadPostsComplete’, function(e) {
console.log(‘LoadPostsComplete’);
});

Like this filter plugin: https://woocommerce.com/products/product-filters/
jQuery(document).ready(function( $ ){
// Your code in here
jQuery(window).on(‘wcpf_update_products’, function () {
console.log(‘Hi’);
});
});

Thank You