Title: Customer Based Limit
Last modified: October 14, 2020

---

# Customer Based Limit

 *  Resolved [mobileit](https://wordpress.org/support/users/mobileit/)
 * (@mobileit)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/customer-based-limit/)
 * This Addon looks like it could work perfectly for us with a couple of modifications..
 * We would like to limit purchases to **1 item per customer in a 28 Day or 1 month
   period** (Whichever is easier to accomplish).
 * This would give everyone a fair chance at a good deal (This is for an internal
   portal)
 * ————————————————————–
 * Ultimately we’d love to limit the purchases to 1 Item per 28 days if this product
   is from “Supplier A” and have no limits on any products that come from “Supplier
   B”. but this is getting a bit more in depth.
    -  This topic was modified 5 years, 8 months ago by [mobileit](https://wordpress.org/support/users/mobileit/).

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [Steve Grunwell](https://wordpress.org/support/users/stevegrunwell/)
 * (@stevegrunwell)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/customer-based-limit/#post-13573548)
 * If you’re trying to limit the number of orders per user (as opposed to the total
   number of orders on the store), the approach would need to be a little different:
   instead of saying “okay, how many orders have we received in this interval?”,
   you’ll probably want to focus on “has this user made an order in the current 
   interval?”.
 * To accomplish this, you might consider hooking into the “woocommerce_is_purchasable”
   filter and conditionally filter the response based on the current user (especially
   since it sounds like everyone accessing the store will be logged in), only returning
   TRUE if both of the following conditions are met:
 * 1. Is the user logged in?
    2. Has the currently logged-in user made a [qualifying]
   purchase in the last X days?
 * You can query orders via [the `WC_Order_Query` class](https://github.com/woocommerce/woocommerce/wiki/wc_get_orders-and-WC_Order_Query#customer),
   setting date and customer constraints.
 * Best of luck!

Viewing 1 replies (of 1 total)

The topic ‘Customer Based Limit’ is closed to new replies.

 * ![](https://ps.w.org/limit-orders/assets/icon.svg?rev=2817939)
 * [Limit Orders for WooCommerce](https://wordpress.org/plugins/limit-orders/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/limit-orders/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/limit-orders/)
 * [Active Topics](https://wordpress.org/support/plugin/limit-orders/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/limit-orders/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/limit-orders/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Steve Grunwell](https://wordpress.org/support/users/stevegrunwell/)
 * Last activity: [5 years, 7 months ago](https://wordpress.org/support/topic/customer-based-limit/#post-13573548)
 * Status: resolved