Jump to content

Hide Price On Sold Items On Product Page

Go to solution Solved by paul2009,

Recommended Posts

Hi there,

The code to hide prices once an item has sold no longer works for me since the update in August. I’ve tried all of the codes listed above and it hides the price on the shop scrolling page but not when you click on the individual item. I’d like to find a code to hide both please is this possible? Images attached. Thanks so much 

www.cordialvintage.com 

7A2A2FDF-9F2D-4A20-B5BA-F51FD54D9E79.png

7E13A3B1-CE0A-435D-8D94-E67B3CC82285.png

Edited by Kgpanda
Link to comment
On 11/16/2022 at 10:33 PM, Kgpanda said:

Hi there,

The code to hide prices once an item has sold no longer works for me since the update in August. I’ve tried all of the codes listed above and it hides the price on the shop scrolling page but not when you click on the individual item. I’d like to find a code to hide both please is this possible? Images attached. Thanks so much 

www.cordialvintage.com 

7A2A2FDF-9F2D-4A20-B5BA-F51FD54D9E79.png

7E13A3B1-CE0A-435D-8D94-E67B3CC82285.png

Add to Design > Custom CSS

/* hide sold out price */
.sold-out .product-price {
	display: none !important;
}

 

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
  • 2 weeks later...
On 12/8/2022 at 1:25 AM, YvonneKL said:

Hi @tuanphan, I used the code below to successfully hide prices of sold items on the shop page, but the product page still shows the price. Is there another code to use? I am using Galapagos template, Squarespace 7.0. Thank you!

/* hide sold out price */
.sold-out .product-price {
	display: none !important;
}

Hi,

Can you share link to a product page? We can check easier

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
  • 2 months later...
38 minutes ago, catherinegodinart said:

I have tried all of the suggestions above, with no luck.

Please provide us with a working link to your page so that we can take a look.

About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥.
Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. 
Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional.

Link to comment
On 3/10/2023 at 5:12 AM, josepablourena said:

Hello, i would like to hide the price and the 'Add to Cart' button on all my product pages. Is there a simple way to do it?

Add to Design > Custom CSS

.grid-prices, .product-price {
	display: none !important;
}
div.sqs-add-to-cart-button-wrapper {
    display: none !important;
}

 

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
  • 4 months later...
On 8/3/2023 at 12:53 PM, tomcoxart said:

I've attempted putting all of the above codes in to my website header for my online shop, but none of them seem to work. 

The solution above is CSS so should be added to the Custom CSS panel, not the header injection that you mentioned.

When I add the CSS from my accepted answer to your site in the browser, it works fine for me.

Edited by paul2009

About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥.
Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. 
Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional.

Link to comment

Ah, I just went to Open AI and it it gave me a code that worked 🙂 Slightly blown away!

<script> function hidePriceForSoldOutProducts() { const products = document.querySelectorAll(".product"); products.forEach((product) => { const soldOutElement = product.querySelector(".product-mark.sold-out"); if (soldOutElement) { const priceElement = product.querySelector(".product-price"); if (priceElement) { priceElement.style.display = "none"; } } }); } // Call the function once the page has loaded to hide the price if products are sold out. window.addEventListener("load", hidePriceForSoldOutProducts); </script>

Link to comment
  • 1 month later...
On 9/22/2023 at 6:28 AM, Jackie123 said:

I still can't get this to work...

 

https://www.janwierart.com/shop-20

Add to Last Line in Code Injection > Footer

<script>
  $(function() {    
    $('.sold-out').parents('.summary-item').addClass('summary-sold-out');

  });
</script>
<style>
  .summary-sold-out .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
  • 3 weeks later...

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.