How to not display products with '1' stock - css

can someone help me? I need to not display products on woocommerce that have only 1 in stock. I wrote a css that does that but the problem is not solving.
.stock in-stock[data-disponibili="1 available"] {
display: none;
}
i also tried
p.stock.in-stock:contains("1 disponibili") {
display: none;
}
But with no result

It seems like WooCommerce has a native function that should solve your issue:
In your WordPress Dashboard, click on inventory on the dashboard on the left and enter relevant product details like stock-keeping unit (SKU), stock quantity, stock status – whether the quantity is in stock or out of stock, etc.
If you are getting out of inventory and want to delete the stock, you can manage it from the above dashboard. You can also update your stock from the same page.
Choose whether to enable stock management. If selected, you have this option:
Enter an Out of Stock Threshold – The value in this field will determine the point in which a product is out of stock (typically 0; in your case probably 1).
I found this on https://www.awardspace.com/wordpress-tutorials/how-to-hide-out-of-stock-products-in-woocommerce/.

Related

How do I stop a customer from seeing how much stock I have when they are adding product quantity to cart on Woocommerce?

When a customer would add a certain quantity to cart, and he selects more stock than we have, it says select a number below "x". Therefore allowing stock to be seen. Is there anyway to override this?
Tried yes. I don't want it to show up.

Is there a simple funtion to atomatically reduce stock levels when product is added to cart? - Woo

I need a solution that reduces the stock level and hide the product from others directly when the product is added to the cart. I have set stock amount to 1 and only allow one purchase of each product.
I´ve tried plugins like WooCommerce Cart Stock Reducer, it does the trick but doesnt hide the product instead it gives me a message that its out of stock.
Help anyone?
From the left side panel in your admin, go to WooCommerce->Settings->Products->Inventory
then check the Hide out of stock items from the catalog option.
You should be good.

WooCommerce - Deleting the upper price on the product page with variations

I would need to delete the price above the variations, under the product title, but ONLY in the product page, not on the main store page. I was not able to accomplish this. Is this possible with custom code?
Many thanks.
Use css to hide price from product details page.
.type-product p.price {
display: none;
}

Woocommerce hide out of stock products whole the site. Should hide if its variant is out of stock

I have seen so many links on stakeoverflow that are using some code to hide out of stock product. But its not working for me. I want to hide out of stock products from whole the site.
No matter the product is simple or variable, it should hide the product from whole site. In case of variable product if any of its attribute have 'Out of stock' state then it should hide that product.
WooCommerce has an option for that at:
Dashboard > WooCommerce > Settings > Products tab > Inventory page > Out Of Stock Visibility: Hide out of stock items from the catalog

Hide Subscription Price & Details WooCommerce for Free Sample

A customer would like to offer a free trial of her subscription services. For some reason WooCommerce details the full price of the subscription next to the Free Sample item within the cart. We'd like the price next to this specific item not be shown in the cart.
I thought it'd be easiest to just edit the CSS to not display the price. So far the code I have below will remove all prices from cart and checkout. I'd like only to remove the price from a specific product. How can I edit this to target the one product?
.shop_table thead, .shop_table .amount {display:none; }
You can edit the .CSS code manually or you can simply download this plugin: https://wordpress.org/plugins/woocommerce-custom-price-label/installation/
and install it on your WordPress site. Don't be worried, the free version will work. Simply go to the product you wish to make this change to and you'll see "custom price labels", check enable under "instead of the price" and then update the product.
Hope this helps!
-Zuuchq

Resources