Re: Sticky add to cart - Dawn Theme V10

Solved

How can I add a sticky cart button to Dawn Theme V10?

Sabrii2
Tourist
9 0 2

Hello! I want to have a sticky add to cart button (at the bottom) on my productpage. Can anyone help me! I have Dawn Theme V10

Accepted Solution (1)
namphan
Shopify Partner
1328 164 199

This is an accepted solution.

Hi @Sabrii2,

Please go to Actions > Edit code > main-product.liquid file and paste this at the bottom of the file:

<button
id = "ProductSubmitButton-Sticky"
type="submit"
name="add"
form="{{ 'product-form-' | append: section.id }}"
class="product-form__submit button button--full-width button--primary"
{% if product.selected_or_first_available_variant.available == false or quantity_rule_soldout %}
  disabled
{% endif %}
style="position: fixed;bottom: 0;left: 0;margin-bottom: 0;z-index: 999;"
>
	<span>
	  {%- if product.selected_or_first_available_variant.available == false or quantity_rule_soldout -%}
		{{ 'products.product.sold_out' | t }}
	  {%- else -%}
		{{ 'products.product.add_to_cart' | t }}
	  {%- endif -%}
	</span>
	<div class="loading-overlay__spinner hidden">
	  <svg
		aria-hidden="true"
		focusable="false"
		class="spinner"
		viewBox="0 0 66 66"
		xmlns="http://www.w3.org/2000/svg"
	  >
		<circle class="path" fill="none" stroke-width="6" cx="33" cy="33" r="30"></circle>
	  </svg>
	</div>
</button>
Coffee tips fuels my dedication.
Shopify Development Service
Need help with your store? namphan992@gmail.com

View solution in original post

Replies 19 (19)

namphan
Shopify Partner
1328 164 199

Hi @Sabrii2,

Please go to Customize > Products > Default product > Add block > Custom liquid and add code here:

Screenshot.png

Code:

<button
id = "ProductSubmitButton-Sticky"
type="submit"
name="add"
form="{{ 'product-form-' | append: section.id }}"
class="product-form__submit button button--full-width button--primary"
{% if product.selected_or_first_available_variant.available == false or quantity_rule_soldout %}
  disabled
{% endif %}
style="position: fixed;bottom: 0;left: 0;margin-bottom: 0;"
>
	<span>
	  {%- if product.selected_or_first_available_variant.available == false or quantity_rule_soldout -%}
		{{ 'products.product.sold_out' | t }}
	  {%- else -%}
		{{ 'products.product.add_to_cart' | t }}
	  {%- endif -%}
	</span>
	<div class="loading-overlay__spinner hidden">
	  <svg
		aria-hidden="true"
		focusable="false"
		class="spinner"
		viewBox="0 0 66 66"
		xmlns="http://www.w3.org/2000/svg"
	  >
		<circle class="path" fill="none" stroke-width="6" cx="33" cy="33" r="30"></circle>
	  </svg>
	</div>
</button>

Hope it helps!

Coffee tips fuels my dedication.
Shopify Development Service
Need help with your store? namphan992@gmail.com
Sabrii2
Tourist
9 0 2

Thanks Namphan! Unfortunately it is not working! The button is not clickable, it is also transparant. 

namphan
Shopify Partner
1328 164 199

Hi @Sabrii2,

Please send your site. I will check it.

Coffee tips fuels my dedication.
Shopify Development Service
Need help with your store? namphan992@gmail.com
Sabrii2
Tourist
9 0 2

Thank you! www.belloti.nl

namphan
Shopify Partner
1328 164 199

This is an accepted solution.

Hi @Sabrii2,

Please go to Actions > Edit code > main-product.liquid file and paste this at the bottom of the file:

<button
id = "ProductSubmitButton-Sticky"
type="submit"
name="add"
form="{{ 'product-form-' | append: section.id }}"
class="product-form__submit button button--full-width button--primary"
{% if product.selected_or_first_available_variant.available == false or quantity_rule_soldout %}
  disabled
{% endif %}
style="position: fixed;bottom: 0;left: 0;margin-bottom: 0;z-index: 999;"
>
	<span>
	  {%- if product.selected_or_first_available_variant.available == false or quantity_rule_soldout -%}
		{{ 'products.product.sold_out' | t }}
	  {%- else -%}
		{{ 'products.product.add_to_cart' | t }}
	  {%- endif -%}
	</span>
	<div class="loading-overlay__spinner hidden">
	  <svg
		aria-hidden="true"
		focusable="false"
		class="spinner"
		viewBox="0 0 66 66"
		xmlns="http://www.w3.org/2000/svg"
	  >
		<circle class="path" fill="none" stroke-width="6" cx="33" cy="33" r="30"></circle>
	  </svg>
	</div>
</button>
Coffee tips fuels my dedication.
Shopify Development Service
Need help with your store? namphan992@gmail.com
Sabrii2
Tourist
9 0 2

Thank you! Not transparant anymore! But still not clickable. 

namphan
Shopify Partner
1328 164 199

Hi @Sabrii2,

Can you re-add it and send me the preview link? I will check it again

Coffee tips fuels my dedication.
Shopify Development Service
Need help with your store? namphan992@gmail.com
Sabrii2
Tourist
9 0 2

Dear Namphan, 
It works! Thank you very much! Can i adjust the moment that the button sticks. For example after scrolling down when the add to cart button is not more in sight?

Greetss

namphan
Shopify Partner
1328 164 199

Hi @Sabrii2,

This will take many steps and debug, so it is difficult for me to guide you in detail.

Hope it is clear to you.

 

Coffee tips fuels my dedication.
Shopify Development Service
Need help with your store? namphan992@gmail.com
AsiyaM
Tourist
5 0 1

Hi, this is really helpful, thank you! I want to change the color of the button and add a black border, if possible. Would you kindly let me know how I can do that? Could I add some more code here to configure the color? Thanks in advance!

namphan
Shopify Partner
1328 164 199

Hi @AsiyaM,

Can you send me the site link? I will check it in detail

Coffee tips fuels my dedication.
Shopify Development Service
Need help with your store? namphan992@gmail.com
AsiyaM
Tourist
5 0 1

Sure! It's Crescentt.com

namphan
Shopify Partner
1328 164 199

Hi @AsiyaM,

I don't find the code you added and the sticky button, can you add it and send me the preview link?

Coffee tips fuels my dedication.
Shopify Development Service
Need help with your store? namphan992@gmail.com
Gil-Momo
Excursionist
30 0 4

This worked perfectly for my shop, Dawn v11.0

namphan
Shopify Partner
1328 164 199

Hi @Gil-Momo,

If you have any questions, you can contact me. Happy to help you

Coffee tips fuels my dedication.
Shopify Development Service
Need help with your store? namphan992@gmail.com
Gil-Momo
Excursionist
30 0 4

Hi,

How can I change the colour of the button? I used your code and the button is currently in black. could you tell me how to change it color?

Thanks,

Gil

dmwwebartisan
Shopify Partner
12321 2552 3729

@Sabrii2 

Please check the following video

If helpful then please Like and Accept Solution | Email: dmw.webartisan@gmail.com |  Instagram: @dmw.webartisan
Check here PageFly App to customize your pages | #1 Product Filter & Search app on Shopify | The most powerful Shopify page builder app

Ugurcan
Shopify Partner
348 7 34

@namphan We recently released a sticky cart app with a free plan. It works with all themes including Dawn, check it out: https://apps.shopify.com/pasilobus-sticky-cart


Pasilobus | eCommerce Experts, Shopify Apps & Development since 2015 -- www.pasilobus.com

MRamzan
Shopify Partner
275 3 34

You can add sticky add to cart:

 

Hire Me:

WhatsApp: +91-9145985880
Email: mohdramzaan112@gmail.com
Skype: mohdramzaan112