Why isn't my 'Buy it now' button working on my product page?

Topic summary

Issue: A custom Shopify page shows a “Buy it now” (dynamic checkout) button, but clicking it throws an error (screenshot referenced). The same button works on the standard product page.

Key causes identified:

  • Incorrect product identifier in the custom template. The helper says the fetched ID is wrong and the default variant ID is required for checkout to work.
  • The store is password-protected, which the helper states can trigger checkout errors during testing.

Attempts and guidance:

  • Initial Liquid loop/form with {{ form | payment_button }} renders the button but fails on click.
  • A later HTML form with a hidden “id” and {{ form | payment_button }} did not display the button.
  • The helper tested and reproduced the issue, proposing a workaround: add a Featured Product section, select the desired product, and hide all elements except the Buy Now button. They report this works on a test store and shared a reference link.

Status/outcome:

  • No final fix via custom code yet. The OP requested concrete code for the Featured Product approach. Discussion remains open pending specific implementation details.
Summarized with AI on January 9. AI used: gpt-5.

@Huptech-Web

Thank you for your kind attention.
I will send you the information by message!