Have your say in Community Polls: What was/is your greatest motivation to start your own business?

add to cart button issue

add to cart button issue

Zohaib__Hassan
Shopify Partner
1 0 1

how i can use add to cart in sutom section?

Reply 1 (1)

Eric-HAN
Shopify Partner
250 29 26

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 %}

 

- Helpful? Please hit Like and mark it as a solution
Want to modify or custom changes on store? Let me help.
- Feel free to Email Me    Buy Me A Coffee