WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Mandatory Coupon Code (9 posts)

  1. NKJWP
    Member
    Posted 1 year ago #

    Is there a way to make the Coupon Code a mandatory field in the shopping cart? I want my users to use the codes that are provided to them and not proceed to the checkout page before they enter the code.

    http://wordpress.org/extend/plugins/woocommerce/

  2. mikejolley
    Member
    Plugin Author

    Posted 1 year ago #

    This is not built in. To do this, you'd need a function hooked into the 'woocommerce_check_cart_items'. From there you can check $woocommerce->cart for a coupon, and add an error ($woocommerce->add_error()) if needed. This will prevent checkout.

  3. NKJWP
    Member
    Posted 1 year ago #

    LOL...That just blew my mind. I saw the tutorial on hooks, but it's a little above my pay grade. I am sure for a more advanced developer, it may be simple. Thanks!

  4. rahyrs
    Member
    Posted 6 months ago #

    @ NKJWP
    have you been succeeded with this?

    @mikejolley
    Can you please give the step-by-step direction?
    thank you

  5. NKJWP
    Member
    Posted 6 months ago #

    Yes...is there way to do a private message here.

  6. rahyrs
    Member
    Posted 6 months ago #

    I dont know about private message. But you can email me at yuliantoro[at]yahoo[dot]com

  7. rahyrs
    Member
    Posted 6 months ago #

    @NKJWP
    can you please share on how you accomplish this mandatory coupon?
    thanks

  8. rahyrs
    Member
    Posted 6 months ago #

    @mikejolley
    Can you please give the step-by-step direction?
    thank you

  9. rahyrs
    Member
    Posted 3 months ago #

    @NKJWP

    Hi, can you please share how you solve this? As this becomes the life or death of my site :-) I only receive payment offline and rely on the code for the customer to get into the product. If the code is not mandatory, then they can by pass the "payment".
    Thanks in advance

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.