Woocommerce -How to set product regular price default

You could run a check on the save_post hook, but WooCommerce already has a hook for processing meta where the post type and security checks have already been done. So using their hook, you just check for a null string on the regular price and set it to 0.

function wpa104760_default_price( $post_id, $post ) {

    if ( isset( $_POST['_regular_price'] ) && trim( $_POST['_regular_price'] ) == '' ) {
        update_post_meta( $post_id, '_regular_price', '0' );
    }

}
add_action( 'woocommerce_process_product_meta', 'wpa104760_default_price' );

Not sure what you are trying to do with WooCommerce, but I had a client use
http://a3rev.com/shop/woocommerce-quotes-and-orders/ to switch from a normal price/cart store to a “request for quote” catalog.

Edit: While the above will save a 0 as the price any time a product is created/updated, the following will always allow a product to be purchasable regardless of the price:

add_filter('woocommerce_is_purchasable', '__return_TRUE'); 

To totally remove the “sale” flash, simply unhook it from its action hook:

function woocommerce_remove_stuff(){
  remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_sale_flash', 10 );
}
add_action('woocommerce_before_single_product', 'woocommerce_remove_stuff');

Leave a Comment