Wordpress Category Hiding Code
This code snippet can be used as a skeleton which can be improved more with some extra code and conditions as per the different scenarios. E.g you can hide some product categories for guest users or you can hide the categories based on the role of the user. Hiding prices in specific categories. With this version of the code snippet you can target specific categories to hide the prices for. You can either modify the set categories to the slug of ID of the category. If wanted you can also combine the snippets to only hide the prices in specific categories for a guest user; Hiding prices for specific.
Myspace Hiding Code Generator
Here’s an Ask SkyVerge question from Marley:Is there a way for me to hide SKUs in WooCocommerce from the single product template without overriding it? I’m currently overriding the single product meta template and deleting the SKU from being adding, but I’d rather do this via a code snippet so I’m not overriding that template if it can be done.We covered this previously in our, but I think it’s a bit buried and deserved a dedicated post.There are a couple of ways we can disable SKUs on the product page: we can remove them from the shop completely, or we can only remove them from the product page.SKUs are set with the general product data while creating or editing a product.
SKUs on Product PageIf they’re not set, the SKU will just display as SKU: n/a.This may not be desirable, and most themes leave this information here as-is. WooCommerce doesn’t have a setting to change this, but you can do so via a code snippet.
Wordpress Category Hiding Codes
Myspace Hiding Code
Remove WooCommerce SKUs CompletelyIf you don’t need to use SKUs at all in your shop, you can disable them completely by using this code snippet in your custom site plugin or theme’s functions.php:addfilter( 'wcproductskuenabled', 'returnfalse' );The SKU will no longer be added to the product page display when disabled.