linkin11 Posted December 15, 2023 Share Posted December 15, 2023 (edited) How can i hide the price when stock is 0 and not disabled? The page is the product page. I already looked in the product.tpl, but i cannot see where to add this. I use version 8.1.2 of PS. Can someone please help me to hide this? Thank you very much Edited December 20, 2023 by Queenfan.nl solved (see edit history) Link to comment Share on other sites More sharing options...
PrestaServicePro Posted December 15, 2023 Share Posted December 15, 2023 Did you try using CSS? Just add the following CSS code to your theme's custom.css file: .product-price, .product-availability .availability-out-of-stock { display: none; } This will hide both the price and the "Out of Stock" message. 1 Link to comment Share on other sites More sharing options...
linkin11 Posted December 15, 2023 Author Share Posted December 15, 2023 Thanks, but this will remove all prices, even the stock is 1 or more. Link to comment Share on other sites More sharing options...
PrestaServicePro Posted December 15, 2023 Share Posted December 15, 2023 could you please let me know the product ID of one item that you'd like the price hidden for when it's out of stock? This will help me to test the code for hiding the price on out-of-stock products. 1 Link to comment Share on other sites More sharing options...
linkin11 Posted December 15, 2023 Author Share Posted December 15, 2023 https://queenfan.nl/unofficial/7674-7-vinyl-queen-press-conferences-uk-uncut-picture-disc.html It will hidden the price, but also at the products who are enabled and have enough stock. Link to comment Share on other sites More sharing options...
PrestaServicePro Posted December 15, 2023 Share Posted December 15, 2023 try this: .product-prices span.product-unavailable + div { display: none; } after adding the code, clear the cache and check the result. 1 Link to comment Share on other sites More sharing options...
linkin11 Posted December 15, 2023 Author Share Posted December 15, 2023 It works Is it also possible to remove the product quantity button as well? Really thankfull already Link to comment Share on other sites More sharing options...
PrestaServicePro Posted December 16, 2023 Share Posted December 16, 2023 Glad it worked. try this: .product_p_price_container:has(span.product-unavailable)+div.product-add-to-cart .qty{ display:none; } 1 Link to comment Share on other sites More sharing options...
linkin11 Posted December 16, 2023 Author Share Posted December 16, 2023 Really amazing, many thanks for everything, It works Solved Link to comment Share on other sites More sharing options...
PrestaServicePro Posted December 16, 2023 Share Posted December 16, 2023 We're so glad we could help you out! You can edit the topic title to "Solved: [Original title]" to indicate the problem was resolved clearly. Happy sales! 1 Link to comment Share on other sites More sharing options...
linkin11 Posted December 19, 2023 Author Share Posted December 19, 2023 I see the prices are still visibele at the search result and in the products page, see screens. search result: https://queenfan.nl/module/iqitsearch/searchiqit?s=duck+s And in the search field when typing. Product page: https://queenfan.nl/421-all-bootlegs I know you cracks can solve this also for me, many thanks. Link to comment Share on other sites More sharing options...
Nickz Posted December 19, 2023 Share Posted December 19, 2023 If the customer cannot buy a product you should be good. It is not that bad to have a pricetag on a product which you have had in your shop. Link to comment Share on other sites More sharing options...
linkin11 Posted December 19, 2023 Author Share Posted December 19, 2023 I know nick, but it's for me in this businesses important that all prices are invisible when product has been sold. So prestaservicepro, can you help me once more? Link to comment Share on other sites More sharing options...
PrestaServicePro Posted December 20, 2023 Share Posted December 20, 2023 try this: .thumbnail-container:has(span.product-unavailable)+.product-description .product-price-and-shipping{ display:none; } 1 Link to comment Share on other sites More sharing options...
linkin11 Posted December 20, 2023 Author Share Posted December 20, 2023 7 hours ago, PrestaServicePro said: try this: .thumbnail-container:has(span.product-unavailable)+.product-description .product-price-and-shipping{ display:none; } Many thanks, that works. Link to comment Share on other sites More sharing options...
PrestaServicePro Posted December 20, 2023 Share Posted December 20, 2023 1 hour ago, Queenfan.nl said: Many thanks, that works. Glad it worked! Happy sales! Link to comment Share on other sites More sharing options...
pegasus6464 Posted March 12, 2024 Share Posted March 12, 2024 How are you? I have tried all the codes in my custom css but I can't hide the price when the product is SOLD. Is it because of the theme I use? I can hide the price on the category or search page, and on the product page, when it is sold? The web is: https://www.historiapostal.net/busqueda?controller=search&s=barlovento First product is sold but appears 500" THANKS Link to comment Share on other sites More sharing options...
Andrei H Posted March 13, 2024 Share Posted March 13, 2024 Hi @pegasus6464, Yes, the theme has a structure that's a little bit different, that's why these CSS selectors don't match your out of stock products. You can try the following, as it should work for you: .thumbnail-container:has(li.out_of_stock) > .product-desc-wrap .product-price-and-shipping { display: none } Link to comment Share on other sites More sharing options...
pegasus6464 Posted March 13, 2024 Share Posted March 13, 2024 Thanks! it runs oK! Thanks a lot from spain 1 Link to comment Share on other sites More sharing options...
pegasus6464 Posted April 1, 2024 Share Posted April 1, 2024 I see that the price continues to appear on the product page, it only disappears from the search and category page ---- PRODUCT PAGE (price is visible) https://www.historiapostal.net/historia-postal-franqueada-1850-1900/552-1861-9-oct-madrid-a-chamberí-4-cuartos-amarillo-mat-rc1-en-negro-de-madrid-la-carta-se-manda-justo-cuando-se-realiza-el-proyecto.html -------- CATEGORY OR SEARCH PAGE: https://www.historiapostal.net/busqueda?controller=search&s=1861+(9+OCT)+MADRID+ ------ Is it also possible to hide the price on the individual product page when stock is zero? Thank you JOAQUIN FROM SPAIN Link to comment Share on other sites More sharing options...
Andrei H Posted April 1, 2024 Share Posted April 1, 2024 Hi @pegasus6464, Sorry, did not look into that as well. Yes, it should be possible. The following should do the work: .product-container:has(li.out_of_stock) > .product-info-section .product-prices { display: none } Link to comment Share on other sites More sharing options...
pegasus6464 Posted April 1, 2024 Share Posted April 1, 2024 works! What a joy, thank you very much!! I am very happy thanks for the help 1 Link to comment Share on other sites More sharing options...
dvd2org Posted April 30, 2024 Share Posted April 30, 2024 hi guys how can i hide price in serp? i m using panda theme Link to comment Share on other sites More sharing options...
Nickz Posted April 30, 2024 Share Posted April 30, 2024 1 hour ago, dvd2org said: hi guys how can i hide price in serp? i m using panda theme Schema org adjust, most likely done by the schema org configuration, except when using a module. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now