All things Shopify and commerce
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!!
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
Not working
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
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
@Anonymous Can you please send me your store URL?
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
User | RANK |
---|---|
40 | |
37 | |
24 | |
22 | |
15 |
Transform this holiday season into a shopping spree. Plus, learn how to effortlessly open ...
By Jasonh Dec 8, 2023Make the shift from discounts to donations, and witness your business not only thrive fina...
By Holly Dec 4, 2023On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023