# How to make a Sticky Add-To-Cart button with Builder for a Shopify site

**URL:** <https://forum.builder.io/t/how-to-make-a-sticky-add-to-cart-button-with-builder-for-a-shopify-site/1078>\
**Category:** Visual Editor Help\
**Tags:** shopify\
**Created:** [September 29, 2021, 8:19pm UTC](https://forum.builder.io/t/how-to-make-a-sticky-add-to-cart-button-with-builder-for-a-shopify-site/1078 "2021-09-29T20:19:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anagh](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@anagh](https://forum.builder.io/u/anagh)\
**Post date:** [September 29, 2021, 8:19pm UTC](https://forum.builder.io/t/how-to-make-a-sticky-add-to-cart-button-with-builder-for-a-shopify-site/1078/1 "2021-09-29T20:19:57Z")

</div>

Here are some references, want to keep it sweet and simple but functional that can be done within the editor with some additional code.

References

-[https://ritual.com/products/essential-multivitamin-for-teen-boys](https://ritual.com/products/essential-multivitamin-for-teen-boys)  
-[Laundry Strips - 32 Loads – Washland](https://washland.co/products/laundry-strips?variant=40723816612005)

Thanks in advance :))

---

<div class="post-metadata">

**Author:** ![maddy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/maddy/32/11_2.png) [@maddy](https://forum.builder.io/u/maddy)\
**Post date:** [September 29, 2021, 8:55pm UTC](https://forum.builder.io/t/how-to-make-a-sticky-add-to-cart-button-with-builder-for-a-shopify-site/1078/2 "2021-09-29T20:55:42Z")

</div>

Hi @anagh,

The two examples you provided are very similar to the example we have [here](https://forum.builder.io/t/how-do-you-fade-in-out-a-navbar-when-scrolling/51) (if you want the add to cart button section to show/hide on scroll). You can customize the code in that example to fit your needs.

To make the button sticky you can:

- Select the add to cart button
- Scroll down to the CSS properties section in the styles tab
- Apply these styles: position: sticky, top: 0, and z-index: 10.

This will make the button stick to the top of the page like this.

![Sep-29-2021 16-46-27](https://us1.discourse-cdn.com/flex020/uploads/builder/original/1X/c91344e6a4a0d95c020a78d7f9906404e2593398.gif)

If you want the add to cart button to stick to the bottom instead, you can:

- Select the add to cart button and give it position: fixed in the layout section of the styles tab
- While in the layout section, give the button a bottom, left, and right value of 0.
- Give the button a z-index value if needed so it sits on top of your page content.

I created a fiddle example of both [here](https://builder.io/fiddle/ec6db62693cb424192f242fa3caf6f19).

---

<div class="post-metadata">

**Author:** ![anagh](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@anagh](https://forum.builder.io/u/anagh)\
**Post date:** [October 2, 2021, 2:08pm UTC](https://forum.builder.io/t/how-to-make-a-sticky-add-to-cart-button-with-builder-for-a-shopify-site/1078/3 "2021-10-02T14:08:37Z")

</div>

Hi, thanks for the valuable insight and fiddle.

Curious, can I add make it specific to PDP’s and will the add to cart button along with variants as an option work on this Element (Sticky ATC) ?

---

<div class="post-metadata">

**Author:** ![maddy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/maddy/32/11_2.png) [@maddy](https://forum.builder.io/u/maddy)\
**Post date:** [October 4, 2021, 2:15pm UTC](https://forum.builder.io/t/how-to-make-a-sticky-add-to-cart-button-with-builder-for-a-shopify-site/1078/4 "2021-10-04T14:15:05Z")

</div>

You can definitely make this specific to product pages, if you want to add this section to your existing product pages, you can add a [custom section](https://www.builder.io/c/docs/custom-dropzones). You can also build out a new product page in Builder that includes this section. The add-to-cart button and variants will work as long as these elements are wrapped in a product box block.
