add to cart button issue

Topic summary

Issue: A user needs help implementing an add-to-cart button in a custom section.

Solution Provided:

  • Most Shopify themes include a built-in buy-buttons section that can be reused
  • Recommended approach: Use Liquid’s render tag to include the buy-buttons functionality

Code snippet shared:

{% render 'buy-buttons', 
  block: block, 
  product: product, 
  product_form_id: product_form_id, 
  section_id: section.id, 
  show_pickup_availability: true %}

Key parameters:

  • product: Product object
  • block: Block object
  • product_form_id: Form identifier
  • section_id: Section identifier
  • show_pickup_availability: Boolean for pickup options display

Status: Solution provided, awaiting confirmation if it resolves the issue.

Summarized with AI on November 3. AI used: claude-sonnet-4-5-20250929.

how i can use add to cart in sutom section?

1 Like

every theme generally got buy-buttons section . so you could use liquid to add you function directly by using blow code

render ‘buy-buttons’, block: block, product: product, product_form_id: product_form_id, section_id: section.id, show_pickup_availability: true
here is the instruction of the buy-buttons section

{% comment %}
Renders product buy-buttons.
Accepts:
- product: {Object} product object.
- block: {Object} passing the block information.
- product_form_id: {String} product form id.
- section_id: {String} id of section to which this snippet belongs.
- show_pickup_availability: {Boolean} for the pickup availability. If true the pickup availability is rendered, false - not rendered (optional).

Usage:
{% render 'buy-buttons', block: block, product: product, product_form_id: product_form_id, section_id: section.id, show_pickup_availability: true %}
{% endcomment %}