• Resolved ?pela

    (@cikorka)


    Hello :). Thank you for a great plugin! I am wondering whether it is possible to use coupon categories in the shortcodes to only show coupons from one coupon category?

    I thank you very much for your reply.

    Kind regards.
    Spela

Viewing 1 replies (of 1 total)
  • Plugin Author itthinx

    (@itthinx)

    Hi, thanks for your kind comment on the plugin!

    As WooCommerce coupons do not have a standard coupon category taxonomy, you might be able to categorize coupons using an extension, or by extending WooCommerce adding your own.

    However, this would not be supported by the extension’s shortcodes, as they don’t have a category parameter that you could use.

    What you could do, is to use the shortcodes that the extension provides as the basis for customized versions that do understand a “category” parameter. You could implement that as an extended version for those shortcodes that you need.

    For example, you could create a new class that extends WooCommerce_Coupon_Shortcodes_WC_Discounts and implements some of the methods with the added parameter and add new shortcodes that use those methods. For example, you could add a shortcode “coupon_is_active_by_category” which could use a new method added in your class based off the coupon_is_active() method of the parent.

    Your implementation would have to accept the “category” shortcode parameter and handle it accordingly.

Viewing 1 replies (of 1 total)
  • The topic ‘Filter coupons by coupon category’ is closed to new replies.