Skip to content

fix(commerce-elastic-path): remove the product listing's dead sort (#502) - #508

Merged
field123 merged 3 commits into
masterfrom
fix/ep-remove-dead-product-list-sort-502
Aug 28, 2026
Merged

fix(commerce-elastic-path): remove the product listing's dead sort (#502)#508
field123 merged 3 commits into
masterfrom
fix/ep-remove-dead-product-list-sort-502

Conversation

@field123

Copy link
Copy Markdown
Collaborator

Closes #502.

The product listing had a Sort control that did nothing. Elastic Path's catalog
product endpoints take no sort parameter — the Sorting guide
lists the eight endpoints that accept one and no catalog endpoint is among them, and the
rendered API reference for /catalog/products and /catalog/nodes/{node_id}/relationships/products
documents only include, filter, page[limit] and page[offset]. An unsupported value is
ignored rather than rejected, so a sorted request returned HTTP 200 in the store's unchanged
order and nothing at runtime revealed that the control was dead.

The values being sent were not Elastic Path syntax either (price asc, createdAt desc).
getSortVariables was copied from another commerce provider, unused isCategory parameter
included; the same file still exists in the Shopify, Saleor, Swell and commercetools providers.

Since no mapping fix could work, this removes the control rather than repairing it:

  • the Sort prop (initialSort) and the setSort ref action on EPProductListProvider
  • the sort key on productGridData
  • the sort argument to ep.getProductList and ep.getProductPage
  • src/utils/get-sort-variables.ts

sort was the trailing parameter in both registered function specs, so no positional
argument shifts for Studio's generated calls.

For a sortable listing, EPCatalogSearchProvider with EPSearchSortBy sorts on the catalog
search index, which does support it. That separation is documented in COMPONENTS.md and
README.md alongside the reason the plain listing cannot.

Breaking

A project binding Sort or invoking setSort loses that binding. The registered function
arguments change too, so the hostless commerce-elastic-path bundle needs republishing or
designers keep seeing the old prop.

Opening an existing project in Studio shows a "Refresh code component props" modal listing
Removed: initialSort. It must be confirmed — until it is, the project bundle keeps orphaned
StateParam references and programmatic writes fail with "Bundle invariant failed".

Published as 0.5.0.

)

Elastic Path's catalog product endpoints take no `sort` parameter. The
Sorting guide lists the eight endpoints that accept one and no catalog
endpoint is among them; an unsupported value is ignored rather than
rejected, so a sorted request returned HTTP 200 in the store's unchanged
order and nothing surfaced the problem.

The values sent were not Elastic Path syntax either (`price asc`,
`createdAt desc`) — `getSortVariables` was copied from another commerce
provider, unused `isCategory` parameter included.

Removes the Sort prop, `setSort`, the `sort` key on `productGridData`,
the `sort` argument to `ep.getProductList`/`ep.getProductPage`, and the
helper. Breaking: a project binding Sort or invoking `setSort` loses that
binding, and the registered function arguments change, so the next
publish-hostless cuts a new hostless version.

For a sortable listing, EPCatalogSearchProvider with EPSearchSortBy sorts
on the catalog search index.
The EP fork integrity test requires plasmicpkgs-dev to pin each EP package
at its workspace version, and the version bump left this at 0.4.1.
`pnpm install --frozen-lockfile` rejects a manifest the lockfile does not
match, so the 0.5.0 pin needs the lockfile specifier alongside it.
@field123
field123 merged commit e73a39a into master Aug 28, 2026
9 checks passed
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.

Product listing Sort control does nothing — sort values are not Elastic Path syntax, and the store ignores sort either way

1 participant