Skip to content

Fix pagination for location list widgets - #3038

Open
the-sohan wants to merge 1 commit into
sovware:developmentfrom
the-sohan:fix/ticket-6986-taxonomy-pagination
Open

the-sohan wants to merge 1 commit into
sovware:developmentfrom
the-sohan:fix/ticket-6986-taxonomy-pagination

Conversation

@the-sohan

Copy link
Copy Markdown
Contributor

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Security fix
  • Improvement
  • New Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Text changes
  • Other... Please describe:

Description

The Listing Locations Elementor widget displayed pagination in list view, but clicking a page number did not replace the current locations. The list-view template did not expose the widget attributes required by the taxonomy pagination AJAX request and did not include the location wrapper targeted by the response handler.

This change adds the serialized taxonomy attributes to the list-view container and the expected taxonomy-location-wrapper class to the results row. The existing pagination script can now request the correct page and replace the rendered locations without reloading the page.

How to reproduce the issue or test the changes:

  1. Add the Listing Locations Elementor widget to a page, select List View, set Number of Locations to Show to 6, and ensure enough locations exist for multiple pages.
  2. Open the page and click page 2 in the location pagination.
  3. Verify that the next six locations replace the first six, page 2 becomes active, and subsequent/previous page controls continue to update the list without reloading the page.

Local verification:

  • php -l templates/taxonomies/locations-list.php
  • php tests/php/listing-taxonomy-subterms.php
  • git diff --check
  • Verified pages 1, 2, and 3 in Chrome on the local Elementor page; each page rendered the expected six locations, updated the active page, and produced no new console errors.

Notes:

  • PHPCS was unavailable in the worktree because Composer development dependencies were not installed.

Screenshots

Before

Location list pagination before the fix

Pagination was displayed, but selecting another page did not update the visible locations.

After

Location list pagination after the fix

Page 2 is active and the widget displays the next six locations after the local fix.

Any linked issues

Checklist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant