Jump to content

Adding code to remove add to cart button on store page

Recommended Posts

Site URL: https://www.honeycuttboutique.com/

Hi. im trying to add the code

<style> .product-price, .product-quantity-input, .sqs-add-to-cart-button-wrapper { display: none; } </style>

to page>settings>advanced>page header injection  (to remove the add to cart button on that whole page)

but its not working for me. One of the style tags is highlighted and im not sure how to fix it. What should i do? I have version 7.1

IMG_7182.jpg

Edited by kikiashley
Link to comment
  • Replies 5
  • Views 575
  • Created
  • Last Reply

Top Posters In This Topic

The style tag being hi-lighted does not indicate an error. It's just something the code editor does.

Nothing grabs my eye as far as an error goes.

Post your site-wide password so we can take a look at your issue.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment

I did notice something funky going on with the code.

From what I can tell it looks something like the following.

1932677093_ScreenShot2021-05-13at5_02_30PM.thumb.png.4ebd830097e9caf4c9841e490510c736.png

A script tag is inside a style tag which is not proper syntax.

You want your code to look something more like the following.

<style>

  .ProductItem-details .ProductItem-product-price,
  .ProductItem-details .product-quantity-input,
  .ProductItem-details .sqs-add-to-cart-button-wrapper {
  
     display : none;
    
    }
    
  </style>

<script id="mcjs">

  !function(c,h,i,m,p){m=c.createElement(h),p=c.getElementsByTagName(h)[0],m.async=1,m.src=i,p.parentNode.insertBefore(m,p)}(document,"script","https://chimpstatic.com/mcjs-connected/js/users/8089d0e220df25a2e2de0b474/844f28fae6853a5498285d49d.js");
  
  </script>

You'll see I tweaked the CSS.

Let us know how it goes.

Edited by creedon

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment

OMG YOURE A LIFE SAVER!!!!  I've been stressing about this for days!🙃

THANK YOU SO MUCH!!!

IMG_7183.jpg

Edited by kikiashley
Link to comment
  • 1 year later...

Hi, 
i'd like to do something similar - e.g. remove the price and add to cart button - BUT only to 1 product (& keep the price, inventory, add to cart ecommerce on all the other) e.g. they can but courses, but one is a corporate offer & they need to enquire to get a quote. 
When I used this code it removed the price & cart button from all of my site.
Can you help? advise?
Thanks in advance
Sarah

Link to comment
On 8/8/2022 at 11:54 PM, sarahJoy2019 said:

Hi, 
i'd like to do something similar - e.g. remove the price and add to cart button - BUT only to 1 product (& keep the price, inventory, add to cart ecommerce on all the other) e.g. they can but courses, but one is a corporate offer & they need to enquire to get a quote. 
When I used this code it removed the price & cart button from all of my site.
Can you help? advise?
Thanks in advance
Sarah

Edit that product > Additional Info > Add a Code Block > Use this code

<style>
  /* Remove add to cart */
  div.sqs-add-to-cart-button-wrapper, .product-price {
    display: none !important;
}
</style>
  

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.