Skip Navigation

[Résolu] Split: Displaying sold text for out of stock products

This support ticket is created Il y a 2 années et 12 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par glennN Il y a 2 années et 12 mois.

Assisté par: Waqar.

Auteur
Publications
#2238739

Hi Waqar,

I'm also trying to add a label "SOLD" instead of showing the pricing for products that are sold out. I've attached a screenshot for reference.

Thank you,
Travis

#2238759

Hi,

To add the "Sold" text for the out of stock products, you can follow these steps:

1. In the content template used for the view, you can include the text, inside a special span tag with class "sold-text", just below the shortcode for the price ( [wpv-woo-product-price] ):


<span class="sold-text">Sold</span>

2. And in the view's CSS editor, you can include some custom CSS code, to show this text for the out of stock items only and add some styling to it:


span.sold-text {  
font-weight: bold;
text-transform: uppercase;
display: block;
border: 1px solid red;
text-align: center;
color: red;
margin-top: 5px;
}

.item.outofstock p.price span,
.item.instock span.sold-text {
display: none;
}

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#2239555

My issue is resolved now. Thank you!