• I have a site that is currently using WooCommerce Version 2.0.14. The client is wanting to add a coupon that can only be used by a customer once but this version of the plugin does not have this option. Is there any custom code I can throw into the plugin to get this to work?

    The unfortunate thing is that after testing on a virtual machine, updating WordPress breaks the site and I can’t update the plugin because the newest version requires WP 3.8 or higher.

    Any thoughts or suggestions?

    https://wordpress.org/plugins/woocommerce/

Viewing 1 replies (of 1 total)
  • Take a look at the “check_customer_coupons” function that already exists in this version of Woocommerce. You can add a new hook in the class-wc-cart.php init() function to catch this similar scenario, for example:

    add_action('woocommerce_after_checkout_validation', array( $this, 'sfp_check_customer_coupon_usage' ), 1 );

    In the method you create for this task, you’ll want to check the wp_postmeta table for coupon usage based on coupon name and the billing email (meta keys _billing_email and coupons) based on a shared post_id.

Viewing 1 replies (of 1 total)
  • The topic ‘Coupon Usage Limit Per Person’ is closed to new replies.