- This topic has 12 replies, 3 voices, and was last updated 3 years, 3 months ago by
Fernando.
-
AuthorPosts
-
March 11, 2023 at 9:37 am #2564199
Willya
Hi, I want to remove the sale badge on products that are out of stock. Is this possible?
March 11, 2023 at 12:28 pm #2564303Leo
StaffCustomer SupportHi there,
Give this CSS a shot:
.woocommerce.post-type-archive .products li.outofstock .onsale, .single-product .product.outofstock .onsale { display: none; }Learn how to add CSS: https://docs.generatepress.com/article/adding-css/
March 11, 2023 at 4:04 pm #2564429Willya
Thank you, Leo! It worked.
I forgot, how about if I want to hide it on the product page as well?
March 11, 2023 at 4:53 pm #2564448Leo
StaffCustomer SupportMarch 11, 2023 at 5:19 pm #2564471Willya
Thank you Leo. It worked!
March 12, 2023 at 1:05 am #2564616Willya
Hi Leo,
I just realized that the sale badge appears on related products and may also appear on upsell products. Can it also be removed?
Updated: I can do it with the help of chatGPT, haha
.woocommerce .related .product.outofstock .onsale, .woocommerce .upsells .product.outofstock .onsale { display: none; }March 12, 2023 at 10:32 am #2565110Leo
StaffCustomer SupportGlad to hear 🙂
March 13, 2023 at 9:41 pm #2566730Willya
Hi Leo,
I have applied a load more button to my category archive page, but after doing so, the sale badge reappeared and I don’t know which CSS class to use to hide it again.
March 13, 2023 at 10:02 pm #2566743Fernando Customer Support
Hi Willya,
Can you name a specific products that’s out of stock which has the sale badge?
March 13, 2023 at 11:32 pm #2566794Willya
For example, this product (link provided in private).
Alternatively, you can click on the “Load More” button located on the product category page (link also provided in private) to view products that are sold out (I have decided to implement a function where out of stock products appear at the end, which is why you have to click the “Load More” button first to see the out of stock products.)
March 13, 2023 at 11:48 pm #2566809Fernando Customer Support
Try this instead:
.woocommerce .product.outofstock .onsale, .woocommerce .product.outofstock .onsale { display: none !important; }March 14, 2023 at 3:11 am #2567011Willya
Thank you Fernando! That did the trick.
March 14, 2023 at 4:57 pm #2567893Fernando Customer Support
You’re welcome, Willya!
-
AuthorPosts
- You must be logged in to reply to this topic.