Enable decimal product quantities in WooCommerce

add_action( 'init', 'wpcb_float_stock_amount', PHP_INT_MAX );
if ( ! function_exists( 'wpcb_float_stock_amount' ) ) {
	/**
	 * wpcb_float_stock_amount.
	 */
	function wpcb_float_stock_amount() {
		remove_filter( 'woocommerce_stock_amount', 'intval' );
		add_filter(    'woocommerce_stock_amount', 'floatval' );
	}
}
add_filter( 'woocommerce_quantity_input_step', 'wpcb_set_quantity_input_step', PHP_INT_MAX, 2 );
if ( ! function_exists( 'wpcb_set_quantity_input_step' ) ) {
	/**
	 * wpcb_set_quantity_input_step.
	 */
	function wpcb_set_quantity_input_step( $qty, $product ) {
		return 0.01;
	}
}

Enable product revisions in WooCommerce

add_filter( 'woocommerce_register_post_type_product', 'wpcb_enable_product_revisions', PHP_INT_MAX );
if ( ! function_exists( 'wpcb_enable_product_revisions' ) ) {
	/**
	 * wpcb_enable_product_revisions.
	 *
	 * @see https://wpcodebook.com/snippets/enable-product-revisions-in-woocommerce/
	 */
	function wpcb_enable_product_revisions( $args ) {
		$args['supports'][] = 'revisions';
		return $args;
	}
}

Set product SKU by product ID in WooCommerce

add_filter( 'woocommerce_product_get_sku', 'wpcb_set_product_sku', PHP_INT_MAX, 2 );
if ( ! function_exists( 'wpcb_set_product_sku' ) ) {
	/**
	 * wpcb_set_product_sku.
	 * 
	 * @see https://wpcodebook.com/snippets/set-product-sku-by-product-id-in-woocommerce
	 */
	function wpcb_set_product_sku( $sku, $product ) {
		return $product->get_id();
		// more complex example, which includes adding up to six leading zeros and setting custom prefix in SKU, would be:
		// return sprintf( 'MY_PREFIX-%06s', $product->get_id() );
	}
}

Hide price for sold out products in WooCommerce

add_filter( 'woocommerce_get_price_html', 'wpcb_hide_price_on_sold_out', PHP_INT_MAX, 2 );
if ( ! function_exists( 'wpcb_hide_price_on_sold_out' ) ) {
	/**
	 * wpcb_hide_price_on_sold_out.
	 *
	 * @see https://wpcodebook.com/snippets/hide-price-for-sold-out-products-in-woocommerce/
	 */
	function wpcb_hide_price_on_sold_out( $price_html, $product ) {
		return ( ! $product->is_in_stock() ? '' : $price_html );
	}
}