• Resolved Ihsan

    (@bravox2)


    Hello,

    I’m using Dokan lite, and the admin coupons don’t work.

    Reading previous support posts here, I found that if I add the following snippet to the functions file, it should work.

    add_filter( 'dokan_ensure_vendor_coupon', '__return_false' );

    However, there wasn’t a change.

    I tried installing code snippets as a secondary option. Added the same filter code there as well, but the admin coupons still didn’t work.

    If a coupon is applied by a customer, the customer sees/gets the message: “A coupon must be restricted with a vendor product”

    If I restrict the coupon to a specific product only (in the Usage Restrictions tab of the product), and then the customer applies the coupon, the message is “Coupon is not valid.”

    Finally, reading more support posts I came across a post that suggested commenting out the following line:

    add_filter( ‘woocommerce_coupon_is_valid’, array( $this, ‘ensure_vendor_coupon’ ), 10, 3 );

    in the following file:
    dokan-lite/includes/class-order-manager.php file

    But that file isn’t there.

    Help; I urgently need to get admin coupons working.

    Regards,
    Ihsan

    • This topic was modified 4 years, 5 months ago by Ihsan. Reason: Providing more clarity
Viewing 1 replies (of 1 total)
  • Thread Starter Ihsan

    (@bravox2)

    This is working.

    The code:

    add_filter( 'dokan_ensure_vendor_coupon', '__return_false' );

    does work.

    The reason why it didn’t work is because the ‘apostrophes’ that were used were a different font/character.

    I just copied the code as is from a WordPress support thread which was in the wrong font/character or something, which is why it didn’t work.

    Here’s the difference:

    add_filter(‘dokan_ensure_vendor_coupon’, ‘__return_false’ );
    vs
    add_filter('dokan_ensure_vendor_coupon', '__return_false' );

    The second line will work. The first won’t.

    • This reply was modified 4 years, 5 months ago by Ihsan.
    • This reply was modified 4 years, 5 months ago by Ihsan.
Viewing 1 replies (of 1 total)

The topic ‘Enabling admin coupons’ is closed to new replies.