[FIX] website_sale_aplicoop: Complete infinite scroll and search filter integration
Major fixes: - Fix JSON body parsing in load_products_ajax with type='http' route * Parse JSON from request.httprequest.get_data() instead of post params * Correctly read page, search, category from JSON request body - Fix search and category filter combination * Use intersection (&) instead of replacement to preserve both filters * Now respects search AND category simultaneously - Integrate realtime_search.js with infinite_scroll.js * Add resetWithFilters() method to reset scroll to page 1 with new filters * When search/category changes, reload products from server * Clear grid and load fresh results - Fix pagination reset logic * Set currentPage = 0 in resetWithFilters() so loadNextPage() increments to 1 * Prevents loading empty page 2 when resetting filters Results: ✅ Infinite scroll loads all pages correctly (1, 2, 3...) ✅ Search filters work across all products (not just loaded) ✅ Category filters work correctly ✅ Search AND category filters work together ✅ Page resets to 1 when filters change
This commit is contained in:
parent
5eb039ffe0
commit
40ce973bd6
4 changed files with 463 additions and 239 deletions
|
|
@ -586,6 +586,7 @@
|
|||
t-attf-data-category="{{ selected_category }}"
|
||||
t-attf-data-per-page="{{ per_page }}"
|
||||
t-attf-data-current-page="{{ current_page }}"
|
||||
t-attf-data-has-next="{{ 'true' if has_next else 'false' }}"
|
||||
class="d-none">
|
||||
</div>
|
||||
</t>
|
||||
|
|
@ -656,19 +657,19 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Scripts (in dependency order) -->
|
||||
<!-- Load i18n_manager first - fetches translations from server -->
|
||||
<script type="text/javascript" src="/website_sale_aplicoop/static/src/js/i18n_manager.js" />
|
||||
<!-- Keep legacy helpers for backwards compatibility -->
|
||||
<script type="text/javascript" src="/website_sale_aplicoop/static/src/js/i18n_helpers.js" />
|
||||
<!-- Main shop functionality (depends on i18nManager) -->
|
||||
<script type="text/javascript" src="/website_sale_aplicoop/static/src/js/website_sale.js" />
|
||||
<!-- UI enhancements -->
|
||||
<script type="text/javascript" src="/website_sale_aplicoop/static/src/js/checkout_labels.js" />
|
||||
<script type="text/javascript" src="/website_sale_aplicoop/static/src/js/home_delivery.js" />
|
||||
<script type="text/javascript" src="/website_sale_aplicoop/static/src/js/realtime_search.js" />
|
||||
<!-- Infinite scroll for lazy loading products -->
|
||||
<script type="text/javascript" src="/website_sale_aplicoop/static/src/js/infinite_scroll.js" />
|
||||
<!-- Scripts (in dependency order) -->
|
||||
<!-- Load i18n_manager first - fetches translations from server -->
|
||||
<script type="text/javascript" src="/website_sale_aplicoop/static/src/js/i18n_manager.js" />
|
||||
<!-- Keep legacy helpers for backwards compatibility -->
|
||||
<script type="text/javascript" src="/website_sale_aplicoop/static/src/js/i18n_helpers.js" />
|
||||
<!-- Main shop functionality (depends on i18nManager) -->
|
||||
<script type="text/javascript" src="/website_sale_aplicoop/static/src/js/website_sale.js" />
|
||||
<!-- UI enhancements -->
|
||||
<script type="text/javascript" src="/website_sale_aplicoop/static/src/js/checkout_labels.js" />
|
||||
<script type="text/javascript" src="/website_sale_aplicoop/static/src/js/home_delivery.js" />
|
||||
<script type="text/javascript" src="/website_sale_aplicoop/static/src/js/realtime_search.js" />
|
||||
<!-- Infinite scroll for lazy loading products -->
|
||||
<script type="text/javascript" src="/website_sale_aplicoop/static/src/js/infinite_scroll.js" />
|
||||
|
||||
<!-- Initialize tooltips using native title attribute -->
|
||||
<script type="text/javascript">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue