• Resolved beamkiller

    (@beamkiller)


    Hi,

    I want to write a plugin or a snippet to functions.php to limit the coupon use on our webpage.

    The case:
    The coupons will grant 2% discount for cart items except items which have a _sale_price set up or one of the custom fields is set to T.

    Is there a hook for such a scenario?

    Thanks Mike.
    Regards,
    Peter.

    https://ww.wp.xz.cn/plugins/woocommerce/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Mike Jolley

    (@mikejolley)

    There is a coupon validity hook, but you could just use a Product % coupon, exclude from sale items checkbox, and exclude some categories of products rather than using meta.

    Thread Starter beamkiller

    (@beamkiller)

    Unfortunately i need to check a field on product page. If it has content do not apply the 2% discount for that item.

    Custom TAB Content

    Can you share the coupon validity hook with me?

    Thanks :).

    Plugin Contributor Mike Jolley

    (@mikejolley)

    You can still add it to a category too.

    woocommerce_coupon_is_valid

    Thread Starter beamkiller

    (@beamkiller)

    We have 3500 products, it will take to much time to check them one-by-one :). Thanks for the hook I will check it.

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

The topic ‘Limit coupon use’ is closed to new replies.