• Resolved nikolas27

    (@nikolas27)


    Hello, In a members only shop, is it possible to get the username on the email notification after an order?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author ollybach

    (@ollybach)

    Hi,
    there isn’t anything built in that does exactly that, however, the simplest way would probably be to use the following filter like so ( as an example, adjust as required )

    
    add_filter('wppizza_filter_ordervars_formatted', 'myprefix_wppizza_ordervars_formatted');
    function myprefix_wppizza_ordervars_formatted($order_parameters){
    	/* change formatted output if id > 0 , i.e a registered user */
    	if(!empty($order_parameters['wp_user_id']['value'])){
    		$wpUserId = $order_parameters['wp_user_id']['value'];
    		$order_parameters['wp_user_id']['value_formatted'] = 'do: get username from user id (as set in wpUserId above / $order_parameters['wp_user_id']['value'] ) according to wordpress codex';
    	}
    return $order_parameters;
    }
    

    and subsequently enable the “User ID :” in the WPPizza->Templates” settings where/as required

    hope that helps

    • This reply was modified 10 months, 1 week ago by ollybach.
    • This reply was modified 10 months, 1 week ago by ollybach.
    Thread Starter nikolas27

    (@nikolas27)

    Thank you @ollybach please consider this a feature request. All the best

    Plugin Author ollybach

    (@ollybach)

    As per your feature request: I couldn’t really see any reason not to add the display name (typically the same as login / nicename) after the user id (if enabled in the templates as referred to above)

    So v3.18.7 has this now added.
    If you still want this differently somewhat, the above filter is the one that would still let you do that

    • This reply was modified 10 months ago by ollybach.
    Plugin Author ollybach

    (@ollybach)

    actually , i made a mistake there in 3.18.7 regarding the above. will be fixed tomorrow.

    Plugin Author ollybach

    (@ollybach)

    ok, 3.18.8 should now have this fixed

    Thread Starter nikolas27

    (@nikolas27)

    Thank you, keep up the good work

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘username on ordering’ is closed to new replies.