WooCommerce Function of the Week: wc_get_customer_last_order

Categorized under:

, , ,
Photo of author
Written By Rodolfo Melogli

3 thoughts on “WooCommerce Function of the Week: wc_get_customer_last_order”

  1. Nice snippet. Thanks. However if someone gets holds of the coupon code and shares it with the friends, they would be able to use the code as well. We also need to prevent it at coupon level, so when user applies the coupon, we only allow it if the customer hasn’t placed any order for last 6 months. Not sure which filter for coupon can be used in combination with this here. Any ideas?

    • There’s a technical answer to that question I’m sure Rodolfo can answer, but it seems like a generally bad move to worry about blocking coupon abuse when you can simply limit the coupon settings to one per person and set a cap on how many will be accepted. Then keep an eye on what happens. If additional people (existing or new customers) place orders they wouldn’t have made without a coupon, is that a problem? In what actual business case would it be bad for a coupon to be used beyond its intended recipients? Those are leads and sales!

Comments are closed.

A2 Hosting
Omnisend
WordPress.com