Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

User Company Name Display Modification Rate Topic   - - - - -

 

Posted 11 October 2018 - 08:28 AM #1

I'm trying to display user's profile including name, company name, address, phone and email to a page.

 

I can retrieve user's name and email address but can't retrieve company information or the phone.

 

Here's my code:

 

{if $user_info.firstname || $user_info.lastname}{$user_info.firstname} {$user_info.lastname}{/if}<br />

{$user_info.b_company}<br />

{if $user_info.b_address || $user_info.b_address_2}{$user_info.b_address} <br />{$user_info.b_address_2}  {/if}<br />

 {if $user_info.b_city || $user_info.b_state_descr || $user_info.b_zipcode}{$user_info.b_city}  {$user_info.b_state_descr}  {$user_info.b_zipcode}{/if}<br />

{$user_info.b_phone}<br />

{$user_info.email}

 

I can't seems to figure out what I'm doing wrong. Can someone advise me on this?

 

 



 

Posted 11 October 2018 - 09:21 AM #2

I figured out after spending many hours trying to solve this.

 

This is how I resolved it:

 

{if !$company_placement_info}

{assign var="company_placement_info" value=$user_info.company_id|fn_get_company_placement_info:$smarty.const.CART_LANGUAGE}
{/if}
 
{if $user_info.firstname || $user_info.lastname}{$user_info.firstname} {$user_info.lastname}{/if}<br />{$company_placement_info.company_name}<br />
{$company_placement_info.company_address}<br />
{$company_placement_info.company_city}{if $company_placement_info.company_city && ($company_placement_info.company_state_descr || $company_placement_info.company_zipcode)},{/if} {$company_placement_info.company_state_descr} {$company_placement_info.company_zipcode}<br />
{$company_placement_info.company_country_descr}<br />
Email: {$user_info.email}<br />
Tel: {if $company_placement_info.company_phone}{$company_placement_info.company_phone}{/if}


 

Posted 17 October 2018 - 02:13 AM #3

Little minor issue maybe someone can help:

 

If I use the code above, it only pulls user's information if they are registered as vendor. Does anyone know how to pull user's information if they are registered as customer?

 

Any help would be greatly appreciated.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19276 posts

Posted 17 October 2018 - 05:24 AM #4

Please try
{$udata = $auth.user_id|fn_get_user_info}
{$udata|fn_print_r}
Second line will print received data. You should remove it later

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 

Posted 17 October 2018 - 07:12 AM #5

Please try

{$udata = $auth.user_id|fn_get_user_info}
{$udata|fn_print_r}
Second line will print received data. You should remove it later

 

 

Thanks... I got it working by changing the format to:

 

{$udata = $auth.user_id|fn_get_user_info}{$udata.b_address}<br />{$udata.b_city}, {$udata.b_state_descr}<br />{$udata.b_zipcode}

 

Just one more question: how do I retrieve the company name?

 

I tried to use {$udata.b_company} but no luck.



 
  • galtinbaeva
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 3325 posts

Posted 17 October 2018 - 08:04 AM #6

Thanks... I got it working by changing the format to:

 

{$udata = $auth.user_id|fn_get_user_info}{$udata.b_address}<br />{$udata.b_city}, {$udata.b_state}<br />{$udata.b_zipcode}

 

Just one more question: how do I retrieve the company name?

 

I tried to use {$udata.b_company} but no luck.

 

Hello!

 

Please try

{$company_name = $udata.company_id|fn_get_company_name}

Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE

Google Analytics Enhanced Ecommerce - get advanced ecommerce analytics


 

Posted 17 October 2018 - 08:29 AM #7

 

Hello!

 

Please try

{$company_name = $udata.company_id|fn_get_company_name}

 

I tried to do this way but it isn't working for me:

 

{$company_name = $udata.company_id|fn_get_company_name}{$udata.b_company} 

 

or

 

{$company_name = $udata.company_id|fn_get_company_name}{$udata.company_name}

 

Am I doing it right?



 
  • galtinbaeva
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 3325 posts

Posted 17 October 2018 - 08:53 AM #8

I tried to do this way but it isn't working for me:

 

{$company_name = $udata.company_id|fn_get_company_name}{$udata.b_company} 

 

or

 

{$company_name = $udata.company_id|fn_get_company_name}{$udata.company_name}

 

Am I doing it right?

 

When you print company name, use just {$company_name}, not {$udata.company_name}


Simtech Development | sales@simtechdev.com | www.simtechdev.com
CERTIFIED CS-CART PARTNER | LICENSES | DEVELOPMENT | ADD-ONS | DESIGN | UPGRADE

Google Analytics Enhanced Ecommerce - get advanced ecommerce analytics


 

Posted 17 October 2018 - 09:19 AM #9

When you print company name, use just {$company_name}, not {$udata.company_name}

 

That didn't work for me so I just used main profile company name by using this code: {$udata.company}

 

Thanks for all of your help.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19276 posts

Posted 17 October 2018 - 12:58 PM #10

Thanks... I got it working by changing the format to:
 
{$udata = $auth.user_id|fn_get_user_info}{$udata.b_address}<br />{$udata.b_city}, {$udata.b_state_descr}<br />{$udata.b_zipcode}
 
Just one more question: how do I retrieve the company name?
 
I tried to use {$udata.b_company} but no luck.

 

If you mean default profile field

 

http://prntscr.com/l73xlj

 

please use

{$udata.company}

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.