EasySocial Integration

  • Posts: 410
  • Thank you received: 15
5 years 7 months ago #297603

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.

<?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.

  • Posts: 158
  • Thank you received: 8
5 years 7 months ago #297609

Hello

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.

  • Posts: 410
  • Thank you received: 15
5 years 7 months ago #297611

You can use it in hikashop - product/show_block_characteristic.php and replace the vendor's name with this code.

Attachments:
Last edit: 5 years 7 months ago by neo191987.

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

  • Posts: 158
  • Thank you received: 8
5 years 7 months ago #297613

Thank you so much
I will test this when I have spare time

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

  • Posts: 26004
  • Thank you received: 4004
  • MODERATOR
5 years 7 months ago #297606

Hello,

Thanks for the share.
Please note that in the product page, you can already have the vendor details in the objects.

$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.

  • Posts: 410
  • Thank you received: 15
5 years 7 months ago #297632

Thanks. Already working with this 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.081 seconds
Powered by Kunena Forum