Title: Enabling admin coupons
Last modified: October 20, 2021

---

# Enabling admin coupons

 *  Resolved [Ihsan](https://wordpress.org/support/users/bravox2/)
 * (@bravox2)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/enabling-admin-coupons/)
 * 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, 7 months ago by [Ihsan](https://wordpress.org/support/users/bravox2/).
      Reason: Providing more clarity

Viewing 1 replies (of 1 total)

 *  Thread Starter [Ihsan](https://wordpress.org/support/users/bravox2/)
 * (@bravox2)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/enabling-admin-coupons/#post-14987231)
 * 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, 7 months ago by [Ihsan](https://wordpress.org/support/users/bravox2/).
    -  This reply was modified 4 years, 7 months ago by [Ihsan](https://wordpress.org/support/users/bravox2/).

Viewing 1 replies (of 1 total)

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

 * ![](https://ps.w.org/dokan-lite/assets/icon-256x256.gif?rev=3239229)
 * [Dokan: AI Powered WooCommerce Multivendor Marketplace Solution – Build Your Own Amazon, eBay, Etsy](https://wordpress.org/plugins/dokan-lite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/dokan-lite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/dokan-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/dokan-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/dokan-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/dokan-lite/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [Ihsan](https://wordpress.org/support/users/bravox2/)
 * Last activity: [4 years, 7 months ago](https://wordpress.org/support/topic/enabling-admin-coupons/#post-14987231)
 * Status: resolved