Change "Add to cart" button text on archives for out of stock products in WooCommerce with PHP

add_action( 'woocommerce_product_add_to_cart_text', 'wpcb_add_to_cart_text_on_loop_out_of_stock_products', PHP_INT_MAX, 2 );
if ( ! function_exists( 'wpcb_add_to_cart_text_on_loop_out_of_stock_products' ) ) {
    /**
     * wpcb_add_to_cart_text_on_loop_out_of_stock_products.
     */
    function wpcb_add_to_cart_text_on_loop_out_of_stock_products( $text, $product ) {
        return ( ! $product->is_in_stock() ? 'Out of stock' : $text );
    }
}

Move WooCommerce shipping method to the end of the list on frontend with PHP

add_filter( 'woocommerce_package_rates' , 'wpcb_move_wc_shipping_method_to_the_end', PHP_INT_MAX, 2 );
if ( ! function_exists( 'wpcb_move_wc_shipping_method_to_the_end' ) ) {
    /**
     * wpcb_move_wc_shipping_method_to_the_end.
     * 
     * @see https://wpcodebook.com/snippets/move-woocommerce-shipping-method-to-the-end-of-the-list-on-frontend-with-php/
     */
    function wpcb_move_wc_shipping_method_to_the_end( $rates, $package ) {
        if ( ! $rates ) {
            return $rates;
        }
        $shipping_method_id_to_move = 'flat_rate'; // Important: change this to your method's ID
        if ( isset( $rates[ $shipping_method_id_to_move ] ) ) {
            $saved_rate = $rates[ $shipping_method_id_to_move ];
            unset( $rates[ $shipping_method_id_to_move ] );
            $rates[ $shipping_method_id_to_move ] = $saved_rate;
        }
        return $rates;
    }
}

Add short product description on product archives in WooCommerce

add_action( 'woocommerce_after_shop_loop_item', 'wpcb_show_product_short_description_on_loop' );
if ( ! function_exists( 'wpcb_show_product_short_description_on_loop' ) ) {
	/**
	 * wpcb_show_product_short_description_on_loop.
	 */
	function wpcb_show_product_short_description_on_loop() {
		$product = wc_get_product();
		echo '<p>' . $product->get_short_description() . '</p>';
		// or if you want new lines to be converted: echo wpautop( $product->get_short_description() );
	}
}

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;
	}
}