How to add Woocomerce Products to Cart even price is zero!

Both of these pieces of code can be added to your functions.php file.

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’ );
add_filter(‘woocommerce_is_purchasable’, ‘__return_TRUE’);

Adsense Automatically Ad Code

Related Posts