Skip to content

feat: pickup locations (spec pickup-locations) - #2924

Merged
glennjacobs merged 3 commits into
2.xfrom
feat/pickup-locations
Nov 24, 2026
Merged

glennjacobs merged 3 commits into
2.xfrom
feat/pickup-locations

Conversation

@glennjacobs

Copy link
Copy Markdown
Contributor

Why

Any location could be a pickup point, and nothing recorded which ones have a counter. Pickup customers fell back to the default location even when it was a warehouse. A store with no counter anywhere could still offer pickup and make items collection-only. This implements spec pickup-locations, slices 1 to 3, as one commit per slice.

What changed

  • Core: locations.accepts_pickup (default false), Location::acceptsPickup() and Location::defaultPickup(). FulfilmentMethod gains isAvailable(), and pickup is available only while a location accepts it, so supporting(), carts, line validation and the resolver stop offering it. The resolver and changeMethod() skip a location that stopped accepting pickup. setPickupLocation() and changeMethod() reject one that doesn't accept it. A collection-only item can't be added while pickup is unavailable. New installs, demo data, the v1 upgrade step and the alpha upgrade guide mark the default location as accepting pickup.
  • Shipping: the table-rate pickup method offers no option once its location stops accepting pickup, and its location selects list only locations that accept it.
  • Panel and Filament: a "Customers can collect from here" toggle on the location forms, a Pickup badge on the indexes, change-to-pickup selects filtered to pickup locations, and a warning on a variant that still names an unavailable method. Translations in 16 locales. The spec is marked implemented and moved to specs/completed.

Tradeoffs

  • The spec put the location check in Pickup::supports(). It lives in a new isAvailable() on the contract instead, which supporting() also requires. That lets the variant forms tell "unavailable right now" from "never fits this variant", so a collection-only variant keeps Pickup ticked with a warning instead of showing an empty checklist. It's a contract change: custom fulfilment methods add isAvailable(), as the alpha and v1 upgrade guides now say.
  • Both open questions are settled on the proposed behaviour, as the spec now records. With several pickup locations, the default comes first, then the rest by name. A collection-only item is refused at add-to-cart and stays in listings.
  • An unrestricted variant stays unrestricted while pickup is unavailable. Saving it with Shipping ticked stores null, so pickup comes back once a location accepts it.

Verification

  • Pest, each suite on its own: core 1584, admin 293, panel 1057, filament 99, shipping 185, stripe 120, search 51, upgrade 156, bundles 72, paypal 75, all passing. cross-db passes on MySQL (197) and PostgreSQL (196).
  • Panel vitest 427 passed, plus type-check. PHPStan reports no errors, and Pint passes.
  • Rendered in the panel: the location toggle, the index badge, and the warning on a collection-only variant once no location accepts pickup.

glennjacobs and others added 3 commits November 24, 2026 14:07
Implements slice 1 of spec pickup-locations.

- locations.accepts_pickup, folded into the baseline, with an acceptsPickup() scope and Location::defaultPickup().
- FulfilmentMethod gains isAvailable(). Pickup is available only while a location accepts pickup, and supporting() leaves unavailable methods out, so carts, line validation and the resolver stop offering pickup.
- The resolver and changeMethod() skip a location that stopped accepting pickup and fall back to defaultPickup(); setPickupLocation() and changeMethod() reject one that doesn't accept it.
- A collection-only item can't be added while no method it allows is available, and order creation rejects a line set to pickup with nowhere to collect it.
- New installs, demo data, the v1 upgrade step and the alpha upgrade guide mark the default location as accepting pickup.

Amp-Thread-ID: https://ampcode.com/threads/T-93f5bf5e-cf09-4d8c-b762-f078aeff3876
Co-authored-by: Amp <amp@ampcode.com>
Implements slice 2 of spec pickup-locations. The table-rate pickup method offers no option once its location stops accepting pickup, falls back to Location::defaultPickup() when it has none, and its panel and Filament location selects list and accept only locations that accept pickup.

Amp-Thread-ID: https://ampcode.com/threads/T-93f5bf5e-cf09-4d8c-b762-f078aeff3876
Co-authored-by: Amp <amp@ampcode.com>
… methods

Implements slice 3 of spec pickup-locations.

- The panel and Filament location forms get a "Customers can collect from here" toggle, and both location indexes show a Pickup badge.
- The change-to-pickup location selects on the panel and Filament fulfilment cards list only locations that accept pickup, starting at the order's pickup location while it still accepts pickup, else Location::defaultPickup().
- The variant forms leave an unavailable method out of the checklist. A variant that still names one keeps it ticked with a warning, and an unrestricted variant stays unrestricted, so pickup comes back once a location accepts it.
- Translations in all 16 locales; the carts reference shows how to list pickup locations, and the upgrade guide names isAvailable().
- The spec is marked implemented and moved to specs/completed, with its open questions settled on the proposed behaviour.

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-93f5bf5e-cf09-4d8c-b762-f078aeff3876
@github-project-automation github-project-automation Bot moved this to Todo in Roadmap Nov 24, 2026
@glennjacobs
glennjacobs merged commit b4c7e14 into 2.x Nov 24, 2026
34 checks passed
@glennjacobs
glennjacobs deleted the feat/pickup-locations branch November 24, 2026 14:33
@github-project-automation github-project-automation Bot moved this from Todo to Done in Roadmap Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant