Support » Plugin: Coupon Bulker » Wishlist

  • Resolved sevans917

    (@sevans917)


    Hi, this is a handy plugin! Some improvements I’d like to see:

    • setting to control the digit length of the generated codes (excluding prefix)
    • setting to restrict use of specific characters, such as I,1,O,0
    • keep the generating screen within the admin, or as a modal
    • output codes as all caps in CSV download

    Can you share a PHP snippet to alter the digit length, until a setting is integrated?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author looknear

    (@looknear)

    Hi @sevans917 , version 1.3 is using minimum necessary random chars. instead of 10 in previous versions. hope it is answer your needs.
    Also, about the uppercase – it is not safe to try to use it, as the default of woo is lowercase. see this issue.

    Hello,
    i have the same need as @sevans917 that is to decide how long the random automatically generated part of the code is long.
    in this moment i get some useless results like
    prefix-a
    prefix-p
    prefix-q
    for three generated coupon, too easy to “crack”

    It would be great to have a box that asks how long is the random part so i can set the number of characters after the prefix
    eg. if the lenght it 8 i would get smth like:
    prefix-jac9s8fj
    prefix-ajd89cwh
    prefix-dncao39q

    i’ve seein your code that you already have the chance to change the number of random chars:
    coupon-bulker/admin/class-coupon-bulker-admin.php -> line 266:
    generate_coupon_code($num_of_random_chars, $code_prefix);

    what is missing is exposing the option to the user..
    ..i actually modified by hand the function
    private function generate_coupon_code($chars, $prefix)
    forcing
    $chars = 8;

    Not sure what happened here, it seems to be some new issue – maybe with WooCommerce update? – that has reduced the number of random characters to 1.

    Downloads are also broken, incidentally: Attempts to download new coupons still show the last downloaded/exported group.

    Checking the code a little more, the js script for producing num_of_random_chars is producing “0” as in Form Data (in developer console):

    action: coupon_bulker_ajax_endpoint
    fn: bulk_coupon_generate
    coupon_id: 188854
    code_prefix: bulker
    num_of_coupons: 1
    num_of_random_chars: 0

    An alternative to the hack described above could be in coupon-bulker-admin.js at line 39 or line 48.

    The alternative I’m currently using (since we just want 8 characters regardless), is in class-coupon-bulker-admin.php, lines 254-5:

    
        //$num_of_random_chars = intval( $_POST['num_of_random_chars']);
        $num_of_random_chars = 8 ; 
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Wishlist’ is closed to new replies.