• Resolved misterbirra

    (@misterbirra)


    I run a store and I need to handle two types of coupons:

    • “Public” coupons: every visitor can use them. These coupons are publicly disclosed via our social networks. Easy thing.
    • “Admin” coupons: I need to create a type of coupon such that it cannot be used by simple visitors, so the frontend shall return “This coupon does not exist”. Instead, it can be used by me when creating an Order from the admin panel.

    I tried to create a coupon and set it to “Privately Published”, but when I try to use it from admin panel, it still returns “This coupon does not exist”. So it actually cannot be used anywhere.

    Is there another way to do it? Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Jonayed (woo-hc)

    (@jonayedhosen)

    Hi @misterbirra ,

    Thank you for reaching out!

    I understand you’re looking to create two types of coupons in your WooCommerce store: public coupons and admin-only coupons, based on user roles like Administrator. By default, WooCommerce doesn’t offer this functionality in its core settings. Implementing this feature will require either a plugin or custom code.

    In that case, you can use the Coupon Restrictions for WooCommerce plugin. This plugin allows you to restrict coupon usage based on user roles, including guests. You can specify which roles are allowed or excluded from using a coupon, making it a convenient solution for your requirements.

    WooCommerce offers a 30-day refund policy, so you can test the extensions and make sure they meet your needs. If you have any questions before purchasing, you can reach out to us at WooCommerce.com → My Account → Support (you’ll just need to create an account if you don’t already have one).

    However, If you prefer not to use a plugin, you can achieve similar functionality by adding custom code. This involves:

    • Adding a custom field to the coupon settings to specify allowed user roles.
    • Modifying the coupon validation process to check the user’s role before applying the coupon.

    This tutorial provides a helpful guide and code snippet for restricting WooCommerce coupons based on user roles: Restrict WooCommerce Coupons Based on User Roles

    I tried to create a coupon and set it to “Privately Published,” but when I try to use it from the admin panel, it still returns “This coupon does not exist.”

    This happens because Privately Published coupons are not accessible on either the frontend or backend. As a result, you’ll encounter the This coupon does not exist error even when attempting to use it in the admin panel.

    I hope this helps clarify things!

    Saif

    (@babylon1999)

    Hello @misterbirra,

    “Admin” coupons: I need to create a type of coupon such that it cannot be used by simple visitors, so the frontend shall return “This coupon does not exist”. Instead, it can be used by me when creating an Order from the admin panel.

    Try limiting the coupon to email address of the admin you want to assign it to from Usage restriction -> Allowed emails.

    Cheers!

    Plugin Support Reynier (a11n)

    (@reynierc)

    Hi @babylon1999

    Ah! Thank you for sharing that workaround! Although it isn’t restricting coupons for a specific role, this makes the coupon usable only for orders with the admin’s email (separated by comma’s for multiple emails), functioning as a possible workaround to the main concern. Regular visitors won’t be able to use these coupons as their emails won’t match the restriction.

    Just to add a guide for configuring coupon restrictions can be found here.

    Curious to know if this would work as a solution for @misterbirra

    Thread Starter misterbirra

    (@misterbirra)

    That’s great, it worked!

    Thanks

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