Print Company Data To Page

I want to create a returns, privacy policy pages that can be shared among ultimate store fronts. Problem is I have to mention in text apart from company name also url.

So can I have somehow url be printed among text?

For example privacy-policy

At {domain}, your privacy is our priority.

?

Use square brackets to exclude problems with SMARTY

For example, in design/themes/THEME/templates/views/pages/view.tpl

replace

{$page.description nofilter}

with

{$cname = $runtime.company_id|fn_get_company_name}
{$page.description|replace:'[domain]':$cname nofilter}

It can be also made with hooks, if you are familiar with them

Will above print company name or its url ?

I would want

/admin.php?dispatch=companies.update&company_id=1

Company website field to be printed, domain name you are on now

If I understand you correctly, you can use

{$cdata = $runtime.company_id|fn_get_company_data}
{capture name="cdata"}
    {$cdata.company}
{/capture}
{$page.description|replace:'[domain]':$smarty.capture.cdata nofilter}

This is fantastic, must have feature for ultimate with many store fronts. Thank you!

You are welcome!

This is great, or actually...this should be a basic feature.

Unfortunatly i have the same thing, same situation as Darius, i want the same pages, but then print the company name and i have really no clue on how to do that. Would be great if you could spare a couple and help with this.

and just to be sure, there is no integrated system to put something like [company.name] on a page which automaticly displays the Company name, right?

This is great, or actually...this should be a basic feature.

Unfortunatly i have the same thing, same situation as Darius, i want the same pages, but then print the company name and i have really no clue on how to do that. Would be great if you could spare a couple and help with this.

and just to be sure, there is no integrated system to put something like [company.name] on a page which automaticly displays the Company name, right?

Yes, it is not possible out of the box. Just use solution from post #2

eComLabs...Thanks.
Was reading with my nose ;)

Could you help me for one minute how to get multiple data? Company Name, phonenumber and address.
I keep getting a "store closed" message when adding more, might be making dumb errors, but not an expert with these things.

eComLabs...Thanks.
Was reading with my nose ;)

Could you help me for one minute how to get multiple data? Company Name, phonenumber and address.
I keep getting a "store closed" message when adding more, might be making dumb errors, but not an expert with these things.

Hello!

Please try something like this:

{$page.description|replace:'[phone]':$cdata.phone}
{$page.description|replace:'[address]':$cdata.address}

after the code from post #4.

Hello!

Please try something like this:

{$page.description|replace:'[phone]':$cdata.phone}
{$page.description|replace:'[address]':$cdata.address}

after the code from post #4.

Hello,

Please dont do this, now the product description will be scanned twice, it is very inefficient. Please use the following:

{assign var="find" value=['[phone]', '[address]']}
{assign var="replace" value=[$cdata.phone, $cdata.address]}

{$page.description|replace:$find:$replace}

Now you can also add your own parameters easily, just add them to the array.

Final code is

{$cdata = $runtime.company_id|fn_get_company_data}
{capture name="cdata"}
    {$cdata.company}
{/capture}
{assign var="find" value=['[domain]', '[phone]', '[address]']}
{assign var="replace" value=[$smarty.capture.cdata, $cdata.phone, $cdata.address]}

{$page.description|replace:$find:$replace nofilter}

Incredible! Thanks guys! :)

eCom, i must be doing something wrong.

I still need to replace the final code with the -> {$page.description nofilter} ? I'm such a noob with these things.

Yes, replace this code with the code from post #12

Ah, found it.. or at least, the issue.

{hook name="pages:page_content"}
{$cdata = $runtime.company_id|fn_get_company_data} {capture name="cdata"} {$cdata.company} {/capture} {assign var="find" value=['[domain]', '[phone]', '[address]']} {assign var="replace" value=[$smarty.capture.cdata, $cdata.phone, $cdata.address]}

{$page.description|replace:$find:$replace nofilter}


{/hook}

{capture name=“mainbox_title”}{$page.page}{/capture}

{hook name=“pages:page_extra”}
{/hook}


That's the code as i have it. [domain] is working, however [phone] & [address] do nothing.

I also need to pull the [companyname], would the following line for that be correct:
{assign var="find" value=['[domain]', '[phone]', '[address], '[companyname]']}
{assign var="replace" value=[$smarty.capture.cdata, $cdata.phone, $cdata.company_name]}


Again, eComLabs, thanks for the amazing help!






Please try

{$cdata = $runtime.company_id|fn_get_company_data}
{capture name="cdata"}
    {$cdata.company}
{/capture}
{assign var="find" value=['[domain]', '[phone]', '[address]', '[companyname]']}
{assign var="replace" value=[$smarty.capture.cdata, $cdata.phone, $cdata.address, $cdata.company]}

{$page.description|replace:$find:$replace nofilter}

Please try

{$cdata = $runtime.company_id|fn_get_company_data}
{capture name="cdata"}
    {$cdata.company}
{/capture}
{assign var="find" value=['[domain]', '[phone]', '[address]', '[companyname]']}
{assign var="replace" value=[$smarty.capture.cdata, $cdata.company_phone, $cdata.company_address, $cdata.company_name]}

That results in a blank page. No text loaded at all.

I have corrected my post. Please try

It's only printing the domain now. The rest is blank. Even the companyname.