How to Add Custom Styles to WPCodeBox ...
Discover how to add custom styles to the Experimental WPCodeBox UI in WordPress Admin...

WPCodeBox
410
Optimize your WooCommerce store by changing $0 prices to “Free” using this custom code snippet. Enhance user experience and clarify product pricing on your MyListing website with this simple and effective solution.
<?php
/**
* Author: MyListing Club
* Author URI: https://mylisting.club
*/
function my_wc_custom_get_price_html( $price, $product ) {
if ( $product->get_price() == 0 ) {
if ( $product->is_on_sale() && $product->get_regular_price() ) {
$regular_price = wc_get_price_to_display( $product, array( 'qty' => 1, 'price' => $product->get_regular_price() ) );
$price = wc_format_price_range( $regular_price, __( 'Free!', 'woocommerce' ) );
} else {
$price = '<span class="amount">' . __( 'FREE', 'woocommerce' ) . '</span>';
}
}
return $price;
}
add_filter( 'woocommerce_get_price_html', 'my_wc_custom_get_price_html', 10, 2 );

Move WPCodeBox menu to the top bar for easy access in WordPress.




