Advertisement
Igor150195

Загрузка товаров до хеша

Jan 30th, 2024
642
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. getPrevProducts: function() {
  2.             if ($('.main_page .ajax-folders-wrapper').length) {
  3.                 let hashId;
  4.                
  5.                 if (document.location.hash) {
  6.                     hashId = document.location.hash.replace(/\D/g, '');
  7.                 }
  8.  
  9.                 let index = $('.site-ajax-folders__item[data-folder-id="' +hashId+ '"]').index();
  10.                 let counter = 0;
  11.  
  12.  
  13.                 $('.site-ajax-folders__item').each(function(){
  14.                     let folder_id = $(this).data('folder-id');
  15.                    
  16.                     if (counter <= index) {
  17.                         counter++;
  18.                        
  19.                         $('[data-folder-id="'+ folder_id +'"]').removeClass('gr_lazy_load_block');
  20.                         shop2_gr.methods.getProductFolder($('[data-folder-id="'+ folder_id +'"]'), folder_id);
  21.                     }
  22.                 });
  23.             }
  24.         },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement