I am using woocommerce at work for equipment requests, therefore all products I will create will need to be £0. Is it possible to set a default value of 0 for the regular price field on the add product form?
Thanks
Jack
I am using woocommerce at work for equipment requests, therefore all products I will create will need to be £0. Is it possible to set a default value of 0 for the regular price field on the add product form?
Thanks
Jack
Comments are closed.
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.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:
To totally remove the “sale” flash, simply unhook it from its action hook:
I found the solution for this problem, this function sets the product regular price and sale price to 0 after updating the product:
The line of code below make new product purchasable, you can use this code for new products: