I need to add some words on under out of stock products only not in in stock products in shopify dawn theme. Can you please help me on it. My shopify store link is this https://primolfw.myshopify.com/.
Topic summary
A Shopify store owner using the Dawn theme wants to display custom text exclusively on out-of-stock products, not on in-stock items.
Solution Provided:
- Navigate to Shopify admin â Online Store â Themes â Actions â Edit code
- Locate the CSS file (typically âbase.cssâ in the Assets folder)
- Add CSS code targeting
.price.price--large.sold-out::afterwith custom content - The code uses
::afterpseudo-element to append text below out-of-stock product prices
Follow-up Request:
The original poster accepted the CSS solution but then requested additional help adding a button (anchor tag) in the same location. The conversation appears ongoing as they seek guidance on implementing this button functionality alongside the custom text.
Hi @Mohsin_Khan
You can do so by following the instructions below.
NOTE: Change the âYour textâ in the code to the text you want.
- From your Shopify admin dashboard, click on âOnline Storeâ and then âThemesâ.
- Find the theme that you want to edit and click on âActionsâ and then âEdit codeâ.
- In the âAssetsâ folder, click on âbase.cssâ file, depending on which file your theme uses to store its CSS styles. At the bottom of the file, add the following CSS code:
.price.price--large.price--sold-out:after {
content: "Your text";
padding: 1rem;
}
Please donât forget to Like and Mark Solution to the post that helped you. Thanks!
I love your solution, thank you for your reply, But I forgot to mention that I also need to add button there, can you show me how to do that?
Thank you for your response, But I forget to mention that I also need to add button(anchor tag) there, can you show me how to do that?