- Posts: 45
- Thank you received: 2
read out a user's company name in onBeforeDownload
14 years 1 month ago #66237
by klimmbimm
read out a user's company name in onBeforeDownload was created by klimmbimm
In my
PDFBranding Plugin
I need to access a user's company name (if given).
How would I do that?
How would I do that?
Please Log in or Create an account to join the conversation.
14 years 1 month ago #66443
by nicolas
Replied by nicolas on topic Re: read out a user's company name in onBeforeDownload
You can get the current user id like that:
$user_id = hikashop_loadUser();
Then you need to load the addresses of the user like that:
$class = hikashop_get('class.address');
$addresses = $class->getByUser($user_id);
Then, the first address:
$address = reset($addresses);
Then the company name:
echo $address->address_company;
$user_id = hikashop_loadUser();
Then you need to load the addresses of the user like that:
$class = hikashop_get('class.address');
$addresses = $class->getByUser($user_id);
Then, the first address:
$address = reset($addresses);
Then the company name:
echo $address->address_company;
The following user(s) said Thank You: klimmbimm
Please Log in or Create an account to join the conversation.
14 years 1 month ago #66862
by klimmbimm
Replied by klimmbimm on topic Re: read out a user's company name in onBeforeDownload
works perfectly! thank you very much!
Please Log in or Create an account to join the conversation.
Time to create page: 0.051 seconds