Have you looked at the following?
https://wordpress.stackexchange.com/a/104783/77202
From the answer above the following will always set the price to default to 0 when creating/updating a product
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' );
Again from the answer above you and the answer to your question, to always allow the product to be purchasable regardless of price existing:
add_filter('woocommerce_is_purchasable', '__return_TRUE');
Both of these pieces of code can be added to your functions.php file.
Credit to helgatheviking
Related Posts:
- How to remove an action within a class with extends
- wc_get_template_part( ‘content’, ‘product’ ) | Where is this file located?
- Create WooCommerce custom stock option that is non-purchasable
- Query multiple post type and categories
- Shipping restrictions with WooCommerce variable products
- WooCommerce – Flat rate shipping based on X quantity steps?
- woocommerce_before_calculate_totals in woocommerce 3.0
- Custom URL for each product variation – rewrite rules
- Where can I find a single item template
- Get Woocommerce Subscription Product
- Change “Shipping” text to “Delivery” everywhere I appears in woocommerce
- Customize WooCommerce orders displayed shipping
- creating product with variations using woocommerce REST API
- Adding extra one email address who receives email as admin – woocommerce
- Woocomerce language
- How to set default values in Woocommerce checkout? [closed]
- Display list of categories that contain products with a specific tag
- Payment methods are not displaying in Woocommerce
- How to update the WooCommerce cart Icon to show new products added with JavaScript
- Product admin page breaking with too many product variations [closed]
- How to configure Woocommerce Payment Methods programmatically?
- woocommerce_package_rates not fired everytime
- Add content to the last slide of each product
- Remove add to cart icon/view product button woocommerce
- Products Shortcode is Displaying Single Product Page Price for all Products [closed]
- Subscription on Checkout
- Woocommerce – display product in page but in list format with excerpt
- Expired session error (admin) when I try to make a call to WooCommerce api [closed]
- Hide decimal on hompage, category and product page
- Get order_id from the product_id in woocommece [closed]
- How to increase execution time out limit in WordPress dashboard?
- woocommerce – how to get product link by id
- woocommerce_register_post action not firing [closed]
- Woocommerce Email show HTML source code [closed]
- Add SKU in Product Title
- Search in 1) Post, 2) Products (woocommerce) and 3) Custom post type or Taxonomy type on a single page
- Woocommerce REST API – add filter to set maximum query per page for product brands [closed]
- display product’s category static slider name and image in loop wordpress
- Whitespace between product image and gallery on initial load of lightbox product page
- Why is my WordPress login credentials missing, but work with WooCommerce?
- WC Lightbox, Zoom and Slider not loading [closed]
- Send admin new order email to logged in user as well
- How to reverse/swap the order of “Sales price” and “Regular prcie” in woocommerce?
- Woocommerce Canceled Order Notification email to admin
- I want hide view more button if price is blank
- Woocommerce before and after shop loop not works
- WooCommerce Admin order – Only run action if user is loaded
- Creating child theme out of Coeur
- Hide sidebar and change layout Blog Page using is_page() function
- Change Out of Stock Error Message in WooCommerce Cart
- Archive product loop does not work with product filters
- I want a simple dropdown for locations in woocommerce
- Getting hundreds of spam orders in WooCommerce with failed stripe payment [closed]
- How to fetch woocommerce highest price and lowest price in custom template page?
- Please help me get rid of conflict with the JavaScript – I’m using WooCommerce with product blocks (Gutenb)
- Order Status without Email check. Only with Order-Number
- WooCommerce pagination: remove ‘page’ from url
- Coupon for product / woocommerce
- How can I show “sold out” instead of “out of stock” for some products with particular tags and categories [closed]
- wc_get_product_id_by_sku() returns 0 for products added programatically via update_post_meta
- Display “Add to basket” and “Read more” buttons in the products shop page with woocommerce
- How Can I fix Woocommerce Billing Address Field? [closed]
- Assign user role by text field in WordPress (Woocommerce) [closed]
- Getting WordPress fatal error when hitting WooCommerce API
- Adding Tracking Details for Advanced Shipment Tracking Plugin From Order Notes
- check shipping amount in woocommerce_after_checkout_validation?
- How to display woocommerce product details on wp page
- Update a list of product to featured if product have meta value (Mysql not wpquery)
- How to set up dynamic purchase pixel in Woocommerce?
- MySQL error or data corruption after database migration
- My products are showing “not in stock” and I don’t know why
- Woocommerce change the price of products in the database
- Is this code collecting user password?
- Select all products that have a custom field ‘is_new’ set to ‘Yes’
- Woocommerce – Shop can’t find products after domain name change
- “error_message”: “Sorry, you cannot list resources.” using WooCommerce API
- Removing Product from Woocommerce checkout page using Ajax
- add_post_meta on subcription renewal
- login or register then access woocommerce website
- Move woocommerce shop page image to left
- WooCommerce Tax Filter Not Working
- Replace product link with just product name on WooCommerce downloads page
- Woocommerce Product category base same as product base causes 404
- Categories and products in cart Woocommerce
- Update Custom Post Meta Even if Draft
- Clone and modify Woocommerce Products catalog
- Update order status based on condition
- Custom CSS Not working on Product page
- How to add ajax loading icon after click add to cart button on woocommerce
- Can’t display product categories on woocommerce getting Invalid taxonomy?
- Send form data to functions.php
- If YITH Wishlist page is set to the WooCommerce my-account endpoint, the endpoints stop working all together. Any solution?
- WooCommerce pay per photo upload [closed]
- Override woocommerce template from parent theme
- Create custom add to cart in WordPress
- WooCommerce – How to add a custom field to only a specific email template [closed]
- How to dublicate WC Product title to shortdescription field? [closed]
- Add Additional 3 buttons next to “Add to cart” button in woocommerce product page
- Woocommerce product and category in url [closed]
- Display product categories + child-categories on a single product page