Repository navigation
Shopify help button submits Add to cart? Set the button type #36
vistabylara-dev
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
قد يرسل زر المساعدة نموذج الشراء بالخطأ إذا لم يُحدَّد نوعه.
Free Shopify code series · 33/50 · Reviewed 24 October 2026
The problem
A non-submit button inside a form can submit that form when its type is omitted. Explicitly mark UI-only buttons as type=button.
Placement and precautions
Duplicate the theme and work in its unpublished preview. Save the original files and change one component at a time.
Apply type=button to the existing help or size-guide button inside the product form. Preserve the attributes and listeners that open your guide. The example label needs the locale object below.
Bounded Liquid example — not a replacement for an entire theme file:
Translation keys: Merge this object into the root of the existing locales/en.default.json, keeping all other keys and valid commas. Add corresponding translations to every active language file. Replace generic example wording with accurate store content. Do not replace the entire locale file.
{ "vbl_33": { "label": "Size guide" } }Check in preview
Click the helper and confirm no cart request or form submission occurs. Confirm the real Add to cart button still submits. Test keyboard activation and existing dialog focus/close behavior.
Limits to understand
This fragment does not implement a dialog. A listener that explicitly submits a form can still cause the problem. Do not change the actual purchase button to type=button without its intended handler.
Validation: This code and locale JSON passed Shopify's validation tool. This is static validation, not proof of rendering, accessibility, theme compatibility, indexing or improved sales. No live merchant store was changed or purchase performed.
Rollback
Restore the saved markup and styles if anything regresses. Remove any new calls before deleting their referenced files. Remove only unused locale keys introduced for this example. Keep the previous working theme available until the full affected journey has been checked.
Need this fixed in your store?
Send Dr Lara your store URL, theme name, affected page and what changed before the issue started. Start with free guidance and a free initial consultation. If you want implementation, we agree the scope and fee separately before work starts.
Explore Shopify repairs and development with Vista by Lara
WhatsApp Dr Lara about guide 33 or call +971 50 799 4292.
Free guidance. No commitment. Practical implementation is separately scoped.
Join the discussion
What result do you see, and what should happen instead? Share a short sanitized example. Remove passwords, tokens, customer details and private admin URLs.
Official references
Dr Lara · Vista by Lara · Dubai, UAE
All reactions