In this woocommerce tutorial for beginners you will learn how to display sold out badge on shop & archive pages using custom php snippet if you dont have out of stock badge in products in wordpress website.
You can add your custom text instead of sold out in code.
* Find Code in Top Pinned Comment Section.
* Add this CSS:
.soldout {
z-index: 999999;
padding: 3px 8px;
text-align: center;
background: #dc0e0e;
border: 1px solid white;
color: white;
font-weight: bold;
position: absolute;
top: 6px;
right: 6px;
font-size: 16px;
}
#woocommerce #soldout #outofstock #products #badge #wordpress #wordpresstutorial #webtaskwithhassan #hassangilani