Title: Allows zero and negative pricing
Last modified: April 21, 2020

---

# Allows zero and negative pricing

 *  Resolved [yousuft](https://wordpress.org/support/users/yousuft/)
 * (@yousuft)
 * [6 years ago](https://wordpress.org/support/topic/allows-zero-and-negative-pricing/)
 * Hi,
 * Not sure if I’m doing something wrong in the settings but if I leave set the 
   plugin to “input” and then enter no value in the input field, the product is 
   added at 0.00 (Free).
 * If however I enter a negative value like -5 for Name your price then it subtracts
   that amount from the shopping cart.
 * Either are options I don;t want to give the user.
 * Is it possible to set the method to input but validate that a product can only
   be added to the cart if a minimum price of lets say 50.00 is typed into the input?
   There is no maximum, but I have to have a minimnum.
    Also no negative values 
   should be allowed on the input.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [WPClever](https://wordpress.org/support/users/wpclever/)
 * (@wpclever)
 * [6 years ago](https://wordpress.org/support/topic/allows-zero-and-negative-pricing/#post-12708584)
 * Hi [@yousuft](https://wordpress.org/support/users/yousuft/) ,
 * Thanks for reporting this. I’ll write a note to our developers so that they can
   check and fix this in the next update.
 * I’ll keep you posted when there is any news from our developers.
 * Best regards.
 *  Thread Starter [yousuft](https://wordpress.org/support/users/yousuft/)
 * (@yousuft)
 * [6 years ago](https://wordpress.org/support/topic/allows-zero-and-negative-pricing/#post-12709022)
 * I also found another bug:
 * If the status is set to enabled on the plugin’s setting page then all products
   in the store are set to “name your price” which may be dangerous for stores like
   mine 😉
 * Have a look at [https://whiteteastudios.com](https://whiteteastudios.com) if 
   you;re interested to see how I’ve structured my store.
 * Good luck with the plugin 🙂
 *  Plugin Author [WPClever](https://wordpress.org/support/users/wpclever/)
 * (@wpclever)
 * [6 years ago](https://wordpress.org/support/topic/allows-zero-and-negative-pricing/#post-12714152)
 * Hi,
    It’s not a bug, our plugin is designed that way. You can disable it in the
   Name Your Price tab of Product Data section in each individual product page. 
   Best regards.
 *  [rafaelup](https://wordpress.org/support/users/rafaelup/)
 * (@rafaelup)
 * [5 years, 11 months ago](https://wordpress.org/support/topic/allows-zero-and-negative-pricing/#post-12960859)
 * [@yousuft](https://wordpress.org/support/users/yousuft/)
    I just realized that
   the check for “not empty” is even super easy nowadays, just needed to edit wp-
   content/plugins/wpc-name-your-price/includes/wpc-woonp-core.php
 * adding **required** to line 154
    `size="4" required />`
 * hope this can be included in the next version [@wpclever](https://wordpress.org/support/users/wpclever/),
   I think it should fit to all use cases ?!
 * The “not negative” check can be accomplished by adding a minimum value in the
   product pricing, but I guess it would make sense to add this to the code. I would
   do it like this:
    `if (!is_numeric ( $woonp_min ) ) { $woonp_min = 0; }` in line
   109
 *  [rseone](https://wordpress.org/support/users/rseone/)
 * (@rseone)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/allows-zero-and-negative-pricing/#post-13172924)
 * Hi, I am experiencing this issue as well. Even with a minimum price if the user
   makes the input ’empty’ it allows the product to be purchased for nothing. This
   is a great plugin but this issue makes it dangerous to use. Is this going to 
   be fixed any time soon?
 * Thanks

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Allows zero and negative pricing’ is closed to new replies.

 * ![](https://ps.w.org/wpc-name-your-price/assets/icon-128x128.png?rev=2213373)
 * [WPC Name Your Price for WooCommerce](https://wordpress.org/plugins/wpc-name-your-price/)
 * [Support Threads](https://wordpress.org/support/plugin/wpc-name-your-price/)
 * [Active Topics](https://wordpress.org/support/plugin/wpc-name-your-price/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpc-name-your-price/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpc-name-your-price/reviews/)

 * 5 replies
 * 4 participants
 * Last reply from: [rseone](https://wordpress.org/support/users/rseone/)
 * Last activity: [5 years, 9 months ago](https://wordpress.org/support/topic/allows-zero-and-negative-pricing/#post-13172924)
 * Status: resolved