How to create a hidden checkout field?
-
I want to include a link to a profile of the current user who submitted a checkout form.
That is, to place automatically a current user’s author link like this in the hidden field: example.com/author/username
I want to achieve this by adding a hidden field in checkout form. So to get a link I would write something likes this:
<?php
$currentUser = get_current_user_id();
$user = get_user_by( ‘id’, $currentUser );
$userUrl = get_bloginfo(‘home’).’/author/’.$user->user_login;
echo $userUrl;
?>My question is how can I create this hidden field in checkout form and also how to include this field on order page and emails?
Thanks
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to create a hidden checkout field?’ is closed to new replies.