By Ivaylo Valkov on Wednesday, 05 September 2018
Posted in General Issues
Likes 0
Views 800
Votes 0
Hi, I'm trying to add a link a Hikamarket profile to Easysocial. This code displays the correct information. I could not find instructions. It is possible to display an avatar and an popup profile card?


<?php
include_once(JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/easysocial.php');
$user = JFactory::getUser();
$db = JFactory::getDbo();
$vendorClass = hikamarket::get('class.vendor');
$vendor = $vendorClass->get($variant->product_vendor_id,'vendor');
$userid = $vendor->vendor_admin_id;
$query = "SELECT `user_cms_id` FROM `#__hikashop_user` WHERE `user_id` = '" . $userid . "'";
$db->setQuery($query);
$hika_user_id = $db->loadResult();
$user_es = ES::user($hika_user_id);
var_dump($user_es->name);
?>
I managed to do it. Thank you for making integration very easy. I read this section and everything is going very fast. Is there such a section about the other components so I do not deal with unnecessary questions. https://stackideas.com/docs/easysocial/developers/welcome
·
Thursday, 06 September 2018 03:09
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi there,

Sorry as I do not quite get what you want to achieve either you want to shows popup from hikamarket or easysocial. Do mean you want to display popup as shows here?: https://www.screencast.com/t/j4gqK6kpAeZY
·
Wednesday, 05 September 2018 13:12
·
0 Likes
·
0 Votes
·
0 Comments
·
Yes. That's what I meant The goal is to display user information to display on the product page in the store. Is this possible?
·
Wednesday, 05 September 2018 13:32
·
0 Likes
·
0 Votes
·
0 Comments
·
Now I can show everything through. I will add the whole code if someone needs to use it. This is an iteration for variants created by different vendors - associating their profile.

<?php
require_once JPATH_ROOT . '/administrator/components/com_easysocial/includes/foundry.php';
$user = JFactory::getUser();
$db = JFactory::getDbo();
$vendorClass = hikamarket::get('class.vendor');
$vendor = $vendorClass->get($variant->product_vendor_id,'vendor');
$userid = $vendor->vendor_admin_id;
$query = "SELECT `user_cms_id` FROM `#__hikashop_user` WHERE `user_id` = '" . $userid . "'";
$db->setQuery($query);
$hika_user_id = $db->loadResult();
$es_user = ES::user($hika_user_id);
?>
<a href="<?php echo $es_user->getPermalink();?>" data-popbox="module://easysocial/profile/popbox" data-popbox-position="top" data-user-id="<?php echo $es_user->id;?>"><?php echo $es_user->getName();?></a>


Soon I will contact you on one important issue: My licenses are running out and I want to renew them.
·
Wednesday, 05 September 2018 15:10
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Ivaylo,

Do you mean that you already manage to do it by use the code above?
·
Wednesday, 05 September 2018 16:34
·
0 Likes
·
0 Votes
·
0 Comments
·
Yes. Can I just get some help to finish the code? I also want to display the verification badge and the profile type.This is the result I wanted to achieve.
·
Wednesday, 05 September 2018 16:58
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi there,

For verification badge you can refer on the file:
.../administrator/components/com_easysocial/themes/default/html/html.user.php
line 31

for the user's profile type perhaps can you try to use the code as shown below and see how it goes:
[gist type="php"]
<?php echo $es_user->getProfile()->get('title');?>
[/gist]
·
Thursday, 06 September 2018 14:11
·
0 Likes
·
0 Votes
·
0 Comments
·
Thank you. Now I'm doing some other things and I can say that this is the easiest integration. Thank you for making life easier for beginners like me.
·
Thursday, 06 September 2018 14:19
·
0 Likes
·
0 Votes
·
0 Comments
·
You are most welcome Ivaylo

Just for your information, I have locked and marked this thread as resolved to avoid confusions in the future. Please start a new thread if you have any other issue in the future so it will be easier for us to manage your inquiries.

Thanks for understanding and have a nice day ahead
·
Thursday, 06 September 2018 15:31
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post