• Resolved Doctor Web

    (@doctor-web)


    Hello

    This is a great plugin you got here!
    My issue is that for the “Users” condition you are only able to add one user email address at a time. I have over 500 emails that I would like to add. Could you implement a way to add multiple emails at once?

    For fields that could have hundreds of entries (such as Billing countries, Shipping countries, Products, Products categories and Users), you could add the option for admins to import the data from an Excel sheet / CSV file?

    These would be great!

    Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Algoritmika

    (@algoritmika)

    Hi @doctor-web,

    Thank you ??

    This is a good idea, will try to add it in the next plugin update. Meanwhile, if you are ok with adding a small PHP snippet to your site, you can achieve what you need with:

    add_action( 'init', function () {
    
        // TODO: Set your comma-separated list of user emails (and rule number) here.
        $emails  = '[email protected],[email protected],[email protected]';
        $rule_nr = 1;
    
        // Converting email addresses to user IDs.
        $users = array();
        foreach ( explode( ',', $emails ) as $email ) {
            if ( $user = get_user_by( 'email', $email ) ) {
                $users[] = ( string ) $user->ID;
            }
        }
    
        // Updating the option.
        $option = get_option( 'alg_wc_order_status_rules_users', array() );
        $option[ $rule_nr ] = $users;
        update_option( 'alg_wc_order_status_rules_users', $option );
    
    } );

    The snippet will automatically set the “Users” option in “WooCommerce > Settings > Order Status Rules > Rule #1”. After the snippet does its job, you can remove it from your site.

    Hope this helps. Please let me know what you think.

    Thread Starter Doctor Web

    (@doctor-web)

    Hello @algoritmika

    I copied and pasted the snippet in my child theme Function file but nothing changed for the “Users” option. I am still not able to enter multiple users at once in that field.

    Please test to check. Maybe there is something else that needs to be done for it to work.

    Plugin Author Algoritmika

    (@algoritmika)

    @doctor-web,

    Hmm… Did you change this line:

    
    $emails  = '[email protected],[email protected],[email protected]';

    to the actual emails list?

    Thread Starter Doctor Web

    (@doctor-web)

    Oh… I just saw that. It is working fine now. Thank you.

    I will also add that you could allow the emails to automatically list in ascending order so that admin can easily find an email that they would like to check or remove. You may even add a search box so that admin would not have to scroll through a long list.

    Also is there a way to add users that are not registered to the “Users” option?

    • This reply was modified 2 years, 7 months ago by Doctor Web.
    Plugin Author Algoritmika

    (@algoritmika)

    Hi @doctor-web,

    Oh… I just saw that. It is working fine now. Thank you.

    Great, happy to hear it’s working ??

    I will also add that you could allow the emails to automatically list in ascending order so that admin can easily find an email that they would like to check or remove. You may even add a search box so that admin would not have to scroll through a long list.

    Actually, there should be a search box already:

    Please let me know if this is not what you see on your site.

    Also is there a way to add users that are not registered to the “Users” option?

    I don’t think we can do that, however, I could add a new option – “Billing emails” – you would use it instead of the “Users” option. What do you think?

    Plugin Author Algoritmika

    (@algoritmika)

    Hi @doctor-web,

    As discussed, we’ve added a new order status rule condition to the plugin (v2.9.0) – Billing emails. Now you can set the rule’s order billing emails as a comma-separated list. And it will work with non-registered users as well.

    Please give it a try and let me know what you think.

    P.S. And if you like the plugin, please consider leaving me a rating.

    Plugin Author Algoritmika

    (@algoritmika)

    I’m going to mark this thread as “resolved” for now, hope that’s ok. Please let me know if there are still any questions/issues.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Would like to add Multiple Customer Billing Emails at Once’ is closed to new replies.