- Posts: 431
- Thank you received: 19
EasySocial Integration
8 years 3 weeks ago #297603
by neo191987
EasySocial Integration was created by neo191987
I'm posting this post because it might be useful to someone. This code will associate the profiles of vendors who have created variants and will also display the profiles in EasySocial.
Code:
<?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>
The following user(s) said Thank You: n00bster
Please Log in or Create an account to join the conversation.
8 years 3 weeks ago #297609
by pprle
Replied by pprle on topic EasySocial Integration
Hello
Thank you for sharing this I also saw your ticket on SI website.
Where do you place this code?
Thank you for sharing this I also saw your ticket on SI website.
Where do you place this code?
Please Log in or Create an account to join the conversation.
8 years 3 weeks ago - 8 years 3 weeks ago #297611
by neo191987
Replied by neo191987 on topic EasySocial Integration
Last edit: 8 years 3 weeks ago by neo191987.
Please Log in or Create an account to join the conversation.
8 years 3 weeks ago #297613
by pprle
Replied by pprle on topic EasySocial Integration
Thank you so much
I will test this when I have spare time
I will test this when I have spare time
Please Log in or Create an account to join the conversation.
8 years 3 weeks ago #297606
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Replied by Jerome on topic EasySocial Integration
Hello,
Thanks for the share.
Please note that in the product page, you can already have the vendor details in the objects.
Regards,
Thanks for the share.
Please note that in the product page, you can already have the vendor details in the objects.
Code:
$userClass = hikashop_get('class.user');
$vendor_user = $userClass->get($this->element->vendor->vendor_admin_id);
$es_user = ES::user( (int)$vendor_user->user_cms_id );
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: neo191987
Please Log in or Create an account to join the conversation.
8 years 2 weeks ago #297632
by neo191987
Replied by neo191987 on topic EasySocial Integration
Thanks. Already working with this code
Code:
<?php
$vendorClass = hikamarket::get('class.vendor');
$vendor_user = $vendorClass->get($variant->product_vendor_id,'vendor');
$userClass = hikashop_get('class.user');
$hika_user = $userClass->get($vendor_user->vendor_admin_id);
$id = $hika_user->user_cms_id;
$es_user = ES::user($id);
?>
Please Log in or Create an account to join the conversation.
Moderators: Obsidev
Time to create page: 0.183 seconds