Jump to content

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

How To Get Company Id From Index Page? Rate Topic   - - - - -

 
  • Dexterflamez
  • Senior Member
  • Trial users
  • Join Date: 08-Jan 18
  • 312 posts

Posted 22 December 2020 - 02:25 PM #1

try thi but it didn't work

 

 
{$company_id = $runtime.company_id|fn_get_company_data}


 
  • harmsmitsdev
  • Senior Member
  • Members
  • Join Date: 22-Feb 20
  • 183 posts

Posted 22 December 2020 - 03:09 PM #2

What are you trying to do, retrieve the company data, or the company id?


harmsmitsdev@gmail.com


 
  • Dexterflamez
  • Senior Member
  • Trial users
  • Join Date: 08-Jan 18
  • 312 posts

Posted 22 December 2020 - 04:13 PM #3

just the company id



 
  • harmsmitsdev
  • Senior Member
  • Members
  • Join Date: 22-Feb 20
  • 183 posts

Posted 22 December 2020 - 11:13 PM #4

just the company id

Then just use $runtime.company_id


harmsmitsdev@gmail.com


 
  • Dexterflamez
  • Senior Member
  • Trial users
  • Join Date: 08-Jan 18
  • 312 posts

Posted 22 December 2020 - 11:44 PM #5

yeah, {$runtime.company_id} show 0 from the index page, i ended up using {$user_data.company_id}. thanks



 
  • Dexterflamez
  • Senior Member
  • Trial users
  • Join Date: 08-Jan 18
  • 312 posts

Posted 23 December 2020 - 12:18 AM #6

{$auth.company_id} will show the company id anywhere on the site, making it possible to show the vendor logo anywhere



 
  • harmsmitsdev
  • Senior Member
  • Members
  • Join Date: 22-Feb 20
  • 183 posts

Posted 23 December 2020 - 07:14 PM #7

yeah, {$runtime.company_id} show 0 from the index page, i ended up using {$user_data.company_id}. thanks

you can use $runtime.forced_company_id when necessary.


harmsmitsdev@gmail.com


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 12071 posts

Posted 23 December 2020 - 10:03 PM #8

Use the function fn_get_runtime_company_id() (or in template code {""|fn_get_runtime_company_id}.  Using $runtime.company_id only works for multiple storefronts or for MVE.  It is a hack they did way back in early version 4 for compatibility where they should have just converted the single-store company to company_id 1.  But now we live with it.  You can look at the fn_get_runtime_company_id() function to see how it uses $runtime.company_id to determine the actual real company_id.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • Dexterflamez
  • Senior Member
  • Trial users
  • Join Date: 08-Jan 18
  • 312 posts

Posted 27 December 2020 - 08:29 AM #9

Thanks guys, i appreciate it