Jump to content

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

Print Company Data To Page Rate Topic   - - - - -

 
  • Darius
  • Douchebag
  • Members
  • Join Date: 20-Apr 08
  • 3214 posts

Posted 22 June 2018 - 09:11 AM #1

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.

 

?



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

Posted 22 June 2018 - 01:01 PM #2

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


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 руб.


 
  • Darius
  • Douchebag
  • Members
  • Join Date: 20-Apr 08
  • 3214 posts

Posted 22 June 2018 - 01:12 PM #3

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



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

Posted 22 June 2018 - 01:28 PM #4

If I understand you correctly, you can use

{$cdata = $runtime.company_id|fn_get_company_data}
{capture name="cdata"}
    <a href="{$cdata.storefront}" target="_blank">{$cdata.company}</a>
{/capture}
{$page.description|replace:'[domain]':$smarty.capture.cdata nofilter}

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 руб.


 
  • Darius
  • Douchebag
  • Members
  • Join Date: 20-Apr 08
  • 3214 posts

Posted 22 June 2018 - 02:56 PM #5

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



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

Posted 25 June 2018 - 06:30 AM #6

You are welcome!


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 руб.


 
  • mumbomedia
  • Member
  • Members
  • Join Date: 13-Jan 17
  • 46 posts

Posted 08 October 2018 - 11:41 AM #7

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?



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

Posted 08 October 2018 - 01:43 PM #8

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


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 руб.


 
  • mumbomedia
  • Member
  • Members
  • Join Date: 13-Jan 17
  • 46 posts

Posted 08 October 2018 - 02:19 PM #9

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.

 



 
  • oleg.gorshkov
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 06-Dec 13
  • 3081 posts

Posted 09 October 2018 - 05:31 AM #10

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.


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

Mega SEO Package - All you need for your SEO


 
  • poppedweb
  • Authorized Reseller
  • Members
  • Join Date: 02-Aug 16
  • 446 posts

Posted 09 October 2018 - 05:35 AM #11

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.


PoppedWeb | sales@poppedweb.com | https://poppedweb.com
TurnKey Website Design | Add-Ons | Performance Audits | Dedicated Server Management
24/7 Support | Response within an hour (during working hours).

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

Posted 09 October 2018 - 06:05 AM #12

Final code is

 

{$cdata = $runtime.company_id|fn_get_company_data}
{capture name="cdata"}
    <a href="{$cdata.storefront}" target="_blank">{$cdata.company}</a>
{/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}

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 руб.


 
  • mumbomedia
  • Member
  • Members
  • Join Date: 13-Jan 17
  • 46 posts

Posted 09 October 2018 - 01:20 PM #13

Incredible! Thanks guys! :)



 
  • mumbomedia
  • Member
  • Members
  • Join Date: 13-Jan 17
  • 46 posts

Posted 10 October 2018 - 11:44 AM #14

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.



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

Posted 10 October 2018 - 02:32 PM #15

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


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 руб.


 
  • mumbomedia
  • Member
  • Members
  • Join Date: 13-Jan 17
  • 46 posts

Posted 11 October 2018 - 08:31 AM #16

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

<div class="ty-wysiwyg-content">
    {hook name="pages:page_content"}
    <div {live_edit name="page:description:{$page.page_id}"}>{$cdata = $runtime.company_id|fn_get_company_data}
{capture name="cdata"}
    <a href="{$cdata.storefront}" target="_blank">{$cdata.company}</a>
{/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}</div>
    {/hook}
</div>


{capture name="mainbox_title"}<span {live_edit name="page:page:{$page.page_id}"}>{$page.page}</span>{/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!






 


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

Posted 11 October 2018 - 01:27 PM #17

Please try
 
 

{$cdata = $runtime.company_id|fn_get_company_data}
{capture name="cdata"}
    <a href="{$cdata.storefront}" target="_blank">{$cdata.company}</a>
{/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}

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 руб.


 
  • mumbomedia
  • Member
  • Members
  • Join Date: 13-Jan 17
  • 46 posts

Posted 11 October 2018 - 06:59 PM #18

 

Please try

 

{$cdata = $runtime.company_id|fn_get_company_data}
{capture name="cdata"}
    <a href="{$cdata.storefront}" target="_blank">{$cdata.company}</a>
{/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.



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

Posted 12 October 2018 - 06:46 AM #19

I have corrected my post. Please try


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 руб.


 
  • mumbomedia
  • Member
  • Members
  • Join Date: 13-Jan 17
  • 46 posts

Posted 12 October 2018 - 07:02 AM #20

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