fix add-to-cart button not submitting in shop mode
All checks were successful
deploy / deploy (push) Successful in 1m5s
All checks were successful
deploy / deploy (push) Successful in 1m5s
The button type condition checked @mode == :live but ThemeHook sets mode to :shop, so the button rendered as type="button" (doing nothing). Changed to @mode == :preview to match the existing phx-click pattern. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
0b0adba0fe
commit
c0427d6956
@ -1525,7 +1525,7 @@ defmodule BerrypodWeb.ShopComponents.Product do
|
||||
~H"""
|
||||
<div class="atc-wrap" data-sticky={to_string(@sticky)}>
|
||||
<button
|
||||
type={if @mode == :live, do: "submit", else: "button"}
|
||||
type={if @mode == :preview, do: "button", else: "submit"}
|
||||
phx-click={if @mode == :preview, do: open_cart_drawer_js()}
|
||||
disabled={@disabled}
|
||||
class="atc-btn"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user