Use custom ID field when importing2021-03-14T14:00:03+05:30

Home Forums WooWallet Importer Use custom ID field when importing

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • Petter Bergström
    Participant
    Post count: 16

    When importing transactions from a csv-file, how to identify customers with a custom field “customer_number” or their user ID instead of email-adress?
    (people sometimes change email…)

    Subrata Mal
    Keymaster
    Post count: 162

    You can customize our import module using woo_wallet_importer_user filter. Please check the below code referance which will fetch the user by ID.

    add_filter('woo_wallet_importer_user', 'woo_wallet_importer_user_callback', 10, 2);
    
    if(!function_exists('woo_wallet_importer_user_callback')){
        function woo_wallet_importer_user_callback($user, $data){
            return get_user_by('id', $data);
        }
    }
    Petter Bergström
    Participant
    Post count: 16

    That´s great, thanks!

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