Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Leaderboard

Popular Content

Showing content with the highest reputation on 10/30/2025 in Blog Entries

  1. в свежих версиях шаблонов функция бесконечной прокрутки в категориях уже есть на старых версиях такой функции нет обновление темы на работающем магазине может быть рискованным тк есть шанс, что что-то пойдет не так этот скрипт можно добавить в кастомные скрипты вашей темы (последний пункт меню в настройках темы) так вы безопасно получите функционал бесконечной ленты товаров кстати, мой скрипт использует таймаут в секундах это снижает нагрузку на сервер и при этом позволяет пользователю спокойно прокрутить страницу до футера $(document).ready(function() { let isLoading = false; let loadMoreTimeout = 5000; let lastLoad = 0; function isInViewport(el) { const rect = el.get(0).getBoundingClientRect(); return ( rect.top >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) ); } function checkAndClick() { const now = Date.now(); if (now - lastLoad < loadMoreTimeout) return; const $btn = $('.oct-load-more-button:visible'); if ($btn.length && !isLoading && isInViewport($btn)) { isLoading = true; $btn.trigger('click'); $(document).one('ajaxStop', function() { isLoading = false; lastLoad = now; }); } } $(window).on('scroll resize', function() { checkAndClick(); }); });
    1 point
Guest
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.