How to add a checkbox in cart page to let customers add additional items to cart?

Noctis
Tourist
30 0 0

checkbox.png

 

The picture above is an online store that uses shopify pipeline theme.

They provide a checkbox for an additional item. When the checkbox is ticked, a new item will be added to the cart.

I would like to do this to my store too. Anyone has any idea how to do it?

I'm using debut theme. Thx.

Replies 2 (2)

Developer-G
Shopify Partner
3033 593 846

Hello @Noctis ,

Yes it's possible but need a deep dive in code. If you are aware of liquid the this snippet will helps you.

 

<div class="product-gift-row single_selection">
{% assign first_product = 'your-product-handle' %}
  <span id="Gift_product_title" style="display:none;">{{ product.title }}</span>
  <div class="product-block layout-align-above flex column max-cols2 min-cols-2">
    <div class="product-block__inner">
      <div class="image image--shape-1 image--with-secondary">
        <div class="inner">
          
            <div class="img_cont">

                  <img class="rimage__image fade-in  lazyloaded" src="{{ all_products[first_product].featured_image.src | img_url: '150x' }}" />

            </div>
         
        </div>
      </div><div class="product-block__weight"></div>

      <div class="product-form">
        <a class="btn custm_btn_gift gray_butn" href="javascript&colon;void(0);">
          <input type="checkbox" name="gift_product_first" value="{{ all_products[first_product].variants.first.id}}" />
          {{ all_products[first_product].title }}
        </a>
      </div>   
    </div>
  </div>  
  
</div>

 

You can modify it a/to your need.
Additional thing which you have to do it on checkbox 'checked' add it to cart and on un-check remove it from cart.

btw if you are not aware of liquid code then I think you have to go with an app. You can find app here.

Thanks

- If helpful then please Like and Accept Solution.
- Want to modify or custom changes or bug fix on store Hire me.
- Email: guleriathakur43@gmail.com - Skype: navrocks1 ,
- Try GEMPAGES a great page builder
-Advance Search Filter
Aduelle
Shopify Partner
2 0 0

Hey Guleria, How do i use the app for it as an alternative i can find the section in the theme liquid. Pls help