Cs-Cart Integration With Intercom.io?

Hi there,

I'm wondering whether anyone has gained success in integrating Intercom.io with Cs-Cart multi-vendor.



As per the instructions, given on Intercom.io website, one needs to add the following code before on every page where the users are logged in.


```php



```



Also, as the attribute $user->name and $user->email seem to be generic, what should be the correct terms with which they should be replaced so as the script directly exports the user's name and email address into the analytics dashboard of Intercom.io



A little help on the installation in terms of location of the .tpl file where the above code needs to be put will be greatly appreciated.



Regards,

NaMo

search the forums for using the 'scripts' template hook and then enclose it in:

{if $auth.user_id}

{literal}

{* user is logged in, add your script stuff here*}

{/literal}

{/if}

Hi Tony,



Thanks for your help



I've used the script template hook by learning about it from this post: scripts hook help v4 - Store Design & Templates - CS-Cart Community Forums



Also, I've replaced $user->name and $user->email successfully with $user_info.firstname and $user_info.email but what variable does cs-cart uses for recording user-account creating date i.e. the timestamp as I need to swap it with $user->created_at

in the above code for it to work perfectly.



Regards,



NaMo

You will have to use a my_changes controller for init.post.php to capture the contents of the user's 'row' in the cscart_users table and make that available as a template variable. I.e. {$my_user_info}

Hi Tony,



Thanks for the help but how do we capture the content of the user;s 'row' in the cscart_users_table and [color=#282828][font=arial, verdana, tahoma, sans-serif]make that available as a template variable?[/font][/color]



[color=#282828][font=arial, verdana, tahoma, sans-serif]It would be greatly appreciated if could you elaborate more in terms of the code which we have to create/modify?[/font][/color]



Regards,

NaMo

Can't give all the details here. Tired of repeating.[list]

[]Create a frontend/init.post.php controller.

[
]If the user is logged in do a $u_data = db_get_row(“SELECT from ?:users WHERE user_id=?i”, $_SESSION['auth']['user_id']; (you could optimize this by saving it in $_SESSION so you only do the query once per user versus every page load)

[]Registry::get('view')->assign('u_data', $u_data);

[
]{$u_data} array is now available in templates

[/list]