read out a user's company name in onBeforeDownload

  • Posts: 45
  • Thank you received: 2
12 years 1 month ago #66237

In my PDFBranding Plugin I need to access a user's company name (if given).
How would I do that?

Please Log in or Create an account to join the conversation.

  • Posts: 82818
  • Thank you received: 13362
  • MODERATOR
12 years 1 month ago #66443

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;

The following user(s) said Thank You: klimmbimm

Please Log in or Create an account to join the conversation.

  • Posts: 45
  • Thank you received: 2
12 years 1 month ago #66862

works perfectly! thank you very much!

Please Log in or Create an account to join the conversation.

Time to create page: 0.057 seconds
Powered by Kunena Forum