feat(routing): give products and categories their own addresses #50

Merged
csaeum merged 1 commit from feature/shop-routing into main 2026-09-15 17:02:26 +00:00
Owner

A shop address is a marker segment plus the slug from Sylius, always at the root of the webspace: /p/winter-cap, /k/t-shirts/men. A product therefore has exactly one address, no matter how many categories carry it, and editorial pages keep their own slug (/impressum).

  • own RouteCollectionForRequestLoader at priority 10, so editorial pages can never be shadowed by a shop address
  • the marker only counts as the first segment, which keeps an ordinary 404 free of database and shop requests
  • delivered addresses are remembered in Sulu's route table, which turns a changed slug into a permanent redirect without any sync run
  • the registrar clears its own earlier redirect first: taking a slug back otherwise collides with the unique index and leaves a circular redirect
  • twig functions wsc_sylius_product_url() and wsc_sylius_taxon_url()

Verified against the running environment: /p/… and /k/… answer with 200, editorial pages are untouched, a slug change in the shop redirects permanently to the new address, and a 404 without a marker costs no shop request at all. 159 tests, 439 assertions green, including the smoke tests against the live shop.

closes #16

🤖 Generated with Claude Code

A shop address is a marker segment plus the slug from Sylius, always at the root of the webspace: `/p/winter-cap`, `/k/t-shirts/men`. A product therefore has exactly one address, no matter how many categories carry it, and editorial pages keep their own slug (`/impressum`). - own `RouteCollectionForRequestLoader` at priority 10, so editorial pages can never be shadowed by a shop address - the marker only counts as the first segment, which keeps an ordinary 404 free of database and shop requests - delivered addresses are remembered in Sulu's route table, which turns a changed slug into a permanent redirect without any sync run - the registrar clears its own earlier redirect first: taking a slug back otherwise collides with the unique index and leaves a circular redirect - twig functions `wsc_sylius_product_url()` and `wsc_sylius_taxon_url()` Verified against the running environment: `/p/…` and `/k/…` answer with 200, editorial pages are untouched, a slug change in the shop redirects permanently to the new address, and a 404 without a marker costs no shop request at all. 159 tests, 439 assertions green, including the smoke tests against the live shop. closes #16 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(routing): give products and categories their own addresses
All checks were successful
CI / cs-check (push) Successful in 21s
CI / phpstan (push) Successful in 35s
CI / phpunit (push) Successful in 37s
CI / build-release (push) Has been skipped
3805c9baea
A shop address is a marker segment plus the slug from Sylius, always at
the root of the webspace: /p/winter-cap, /k/t-shirts/men. A product
therefore has exactly one address, no matter how many categories carry
it, and editorial pages keep their own slug (/impressum).

- own RouteCollectionForRequestLoader at priority 10, so editorial pages
  can never be shadowed by a shop address
- the marker only counts as the first segment, which keeps an ordinary
  404 free of database and shop requests
- delivered addresses are remembered in Sulu's route table, which turns a
  changed slug into a permanent redirect without any sync run
- the registrar clears its own earlier redirect first: taking a slug back
  otherwise collides with the unique index and leaves a circular redirect
- twig functions wsc_sylius_product_url() and wsc_sylius_taxon_url()

closes #16

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
csaeum merged commit ce0bba07a3 into main 2026-09-15 17:02:26 +00:00
csaeum deleted branch feature/shop-routing 2026-09-15 17:02:26 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Sulu-Bundles/wsc_sulubundle_syliusheadless!50
No description provided.