• Resolved w3arts

    (@w3arts)


    Hello,

    thanks for you create plugin.

    We generated 10 coupon code in WooCommerce and want to show a valid random code on a post page, so each visitor see another code. It this possible?

    [coupon_enumerate code="*" type="percent"]
    [coupon_discount element_tag="div" prefix="code"]
    [/coupon_enumerate]

    Shows all the time all available codes.

    Thank you so much

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Kento

    (@proaktion)

    Hi,

    Thanks for asking!

    At current, this is not possible as you will either have to specify existing coupon codes explicitly or, as you have outlined in the example, use the * wildcard to iterate over all.

    But … if it supported a rand value for the order attribute and an additional limit attribute, then that would be possible. With that, we could do something like:

    [coupon_enumerate code="*" order="rand" "limit="1" type="percent"]
    ...
    [/coupon_enumerate]

    The above is not possible in the current latest version (1.6.2) but let me check if it’s easy to implement and we’ll issue an update.

    Cheers

    • This reply was modified 6 years, 3 months ago by Kento. Reason: fixed shortcode example
    Plugin Contributor Kento

    (@proaktion)

    Added support for this (randomized) in version 1.7.0 with the shortcode [coupon_enumeration] – example:

    [coupon_enumerate code="*" orderby="rand" number="3"]
    [coupon_show show="code,description,discount"]
    [/coupon_enumerate]
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Random code’ is closed to new replies.