Re: How to remove this button while scrolling?

Solved

How to remove this button while scrolling?

DaveyAlcatraz
Explorer
63 0 13

Hi everyone,

I am hoping someone can provide me with some insight, I would like to remove the add to cart button that appears while scrolling through the product page itself. I think even if everything were re-sized to fit it still looks ugly and tacky. URL to inspect here.

DaveyAlcatraz_0-1724292602354.png

 

Accepted Solution (1)

BSSCommerce-HDL
Shopify Partner
2304 847 1062

This is an accepted solution.

Hi @DaveyAlcatraz,

Step 1: Go to Shopify Admin -> Online Store ->Theme -> Edit code

Step 2: Search file theme.liquid

Step 3: Insert this code above </body> tag:

{% if template.name == 'product' %}
<script>
window.addEventListener("scroll", (event) => {
   if(window.scrollY > 600) {
   	let atc_active = document.querySelector('#add2cart-cta');
   	if(atc_active) {
	   atc_active.style.display = 'none';
   	}
   }
   else {
       let atc_active = document.querySelector('#add2cart-cta');
       atc_active.style.display = 'block';
   }
});
</script>
{% endif %}

Hope this can help you,

If our suggestions are useful, please let us know by giving it a like or marking it as a solution. Thank you 😍

Sale banner, pop ups: Customize your sale banner, pop-ups and create countdown bar to boost conversion rate.
Simicart: Transform your Shopify store into a stunning and fully functional mobile app with just a few simple steps.
Product Labels & Badges:
Get more sales with striking labels, badges, and banners from our 10,000+ available templates.

BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

View solution in original post

Replies 3 (3)

AnneLuo
Shopify Partner
949 176 202

You can try this code by following these steps:
Step 1: Go to the online store ->Theme ->Edit Code.
Step 2: Find the theme.liquid file and add the following code above the </head> tag

<style>
.button.fullwidth.is-primary{
   display: none !important;
}
</style>

Result:

AnneLuo_0-1724293134054.png


Hopefully it will help you. If yes then Please don't forget hit Like and Mark it as solution!

If this is helpful, please Like and Accept the solution.
Want to modify or custom changes on store? Let me help.
- Feel free to Email Me   

Buy Me A Coffee

BSSCommerce-HDL
Shopify Partner
2304 847 1062

This is an accepted solution.

Hi @DaveyAlcatraz,

Step 1: Go to Shopify Admin -> Online Store ->Theme -> Edit code

Step 2: Search file theme.liquid

Step 3: Insert this code above </body> tag:

{% if template.name == 'product' %}
<script>
window.addEventListener("scroll", (event) => {
   if(window.scrollY > 600) {
   	let atc_active = document.querySelector('#add2cart-cta');
   	if(atc_active) {
	   atc_active.style.display = 'none';
   	}
   }
   else {
       let atc_active = document.querySelector('#add2cart-cta');
       atc_active.style.display = 'block';
   }
});
</script>
{% endif %}

Hope this can help you,

If our suggestions are useful, please let us know by giving it a like or marking it as a solution. Thank you 😍

Sale banner, pop ups: Customize your sale banner, pop-ups and create countdown bar to boost conversion rate.
Simicart: Transform your Shopify store into a stunning and fully functional mobile app with just a few simple steps.
Product Labels & Badges:
Get more sales with striking labels, badges, and banners from our 10,000+ available templates.

BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

PageFly-Richard
Shopify Partner
4665 1069 1726

Hi @DaveyAlcatraz 

 

This is Richard from PageFly - Shopify Page Builder App

 

Please add this code to your theme.liquid above the </head> to get this solved

Step 1: Online Stores > Themes > More Actions > Edit code

Step 2: click on theme.liquid and paste the code above the </head>

<style>
##add2cart-cta {
display: none !important;
}
</style>

 

Hope this can help you solve the issue 

 

Best regards,

Richard | PageFly 

Please let me know if it works by giving it a Like or marking it as a solution!


➜ Optimize your Shopify store with PageFly Page Builder (Free plan available) 


All features are available from Free plan. Live Chat Support is available 24/7.