New Shopify Certification now available: Liquid Storefronts for Theme Developers

Style Sold out products

Anonymous
Not applicable

Hello There ,

 

Is there any way to remove or hide  the quantity and buy buttons only in the sold-out products and bring the notify button a bit up.

 

 

 

 

 

 

Thank you!!

Replies 7 (7)
Dan-From-Ryviu
Shopify Partner
5679 1047 1073

Hi @Anonymous 

You can try to add this code at the bottom of your base.css file in Online store > Themes >Edit code to hide quantity and buy buttons 

 .product__info-container:has(.price--sold-out) .product-form__buttons { display: none !important; }

 

- Helpful? Like and Accept a solution. - Donate: Buy coffee - or Paypal me ❤️
- Ryviu - Product Reviews app, collect consumer photo reviews, import reviews from AliExpress, Amazon, Etsy, Shoppe and Walmart and CSV.
- Lookfy app: Create Image Lookbook, Photo Gallery with product hotspots
- Enjoy 3 months of Shopify for $1/month. Sign up now

Anonymous
Not applicable

Not working

 

Dan-From-Ryviu
Shopify Partner
5679 1047 1073

Hi @Anonymous 

Where did you add the code? Did you save file after adding code?

- Helpful? Like and Accept a solution. - Donate: Buy coffee - or Paypal me ❤️
- Ryviu - Product Reviews app, collect consumer photo reviews, import reviews from AliExpress, Amazon, Etsy, Shoppe and Walmart and CSV.
- Lookfy app: Create Image Lookbook, Photo Gallery with product hotspots
- Enjoy 3 months of Shopify for $1/month. Sign up now

Dan-From-Ryviu
Shopify Partner
5679 1047 1073

Please try to add this code to your Online store > Themes > Edit code > open theme.liquid file, add code below before </head> tag 

<style>
 .product__info-container:has(.price--sold-out) .product-form__buttons { display: none !important; }
</styl>

 

 

- Helpful? Like and Accept a solution. - Donate: Buy coffee - or Paypal me ❤️
- Ryviu - Product Reviews app, collect consumer photo reviews, import reviews from AliExpress, Amazon, Etsy, Shoppe and Walmart and CSV.
- Lookfy app: Create Image Lookbook, Photo Gallery with product hotspots
- Enjoy 3 months of Shopify for $1/month. Sign up now

DelightCart
Shopify Partner
1201 81 152

@Anonymous Can you please send me your store URL?

Delight Cart - It's time to turn your visitors into loyal shoppers! 

Delight Loyalty - Increase repeat sales quickly and build lifelong customers loyalty.
BSS-Commerce
Shopify Expert
2945 395 414

Hi @DelightCart ,

 

You need to edit the code on the theme. You can follow the steps below:

 

1. Go to Shopify admin -> Online store -> Edit code.

2. Find the base.css file and add the following code at the end of the file, then save the file:

.hidden_quantiy_sold_out,
.hidden_btn_payment_sold_out {
visibility: hidden !important;
position: absolute !important;
}

3. Find the theme.liquid file
+) Add the following code before the </head> tag: <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>

+) Find the last </script> tag in the file and add the following code before the </script> tag

if(window.location.pathname.includes('/products')) {
if( $('.price__badge-sold-out').css('display') !== 'none') {
$('.product-form__quantity').addClass('hidden_quantiy_sold_out');
$('.shopify-payment-button').addClass('hidden_btn_payment_sold_out');
}
}

+) Save the file

4. Check the results outside the font store

 

Hope it helps @DelightCart !

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

For B2B solutions and custom pricing, check out B2B Solution & Custom Pricing |
For adding product labels/badges, visit Product Labels by BSS

BSS Commerce - Shopify Apps & Store Development Service Provider

Hire a Shopify expert | Shopify Plus Store Development