Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #15924

    I would like to know how to create a hidden coupon that the user does not see.

    We need the coupon field filled in regardless of whether a coupon is used or not so that when we export orders the coupon field has data in it.

    I would like to automatically apply a hidden coupon that fills the normal coupon field when we pull orders from the website, but if the customer actually has a valid coupon it should take precedence. Is there a way to do this with this plugin?

    John Smith uses a coupon, 1 Rubber Ducky, coupon 10% off.
    Bill Dough does not use coupon, 1 Rubber Snake, Hidden coupon 0% off.


    Out of the box this isn’t possible. It’s possible to add a ‘nameless’ 0% auto coupon by using a small php snippet I can send you. I wonder if it’s a good solution though… why is a coupon required? Maybe there’s a better way.


    Hi thanks for replying!

    When no coupon is used, the field for it does not show up when we export the order.
    If there is no coupon field our internal database freaks out. (we use a third party database solution and have no way of manipulating the innards of it)

    We use your plugin on several of our sites, and was just wondering if we were able to do that.




    Normally our plugin will not apply an automatic coupon if it has 0% discount, bu when you use this snippet in your child theme:

    add_filter( 'wjecf_coupon_has_a_value', 
      function( $has_a_value, $coupon) { 
        if ( strcasecmp( 'YOUR_ZERO_PERCENT_COUPON_CODE', $coupon->get_code() ) == 0 ) {
          $has_a_value = true;
        return $has_a_value;
      }, 10, 2);

    it will. So create a 0% automatic coupon with the same code as in the snippet and it might just work…

    (Snippet has not been tested)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.