make PDP variant selection work without JS
All checks were successful
deploy / deploy (push) Successful in 1m3s

Variant options (colour, size) are now URL params handled via
handle_params instead of phx-click events. Swatches and size buttons
render as patch links in shop mode, so changing variants works as
plain navigation without JS. Quantity is now a number input that
submits with the form. Unavailable variants render as disabled spans.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jamey
2026-02-25 01:08:36 +00:00
parent a61adf4939
commit 23e95a3de6
6 changed files with 238 additions and 75 deletions

View File

@@ -452,6 +452,7 @@ defmodule BerrypodWeb.Admin.Theme.Index do
|> assign(:available_options, available_options)
|> assign(:display_price, display_price)
|> assign(:quantity, 1)
|> assign(:option_urls, %{})
~H"<BerrypodWeb.PageTemplates.pdp {assigns} />"
end