Zen Cart Logo
Forums / Basic Configuration / Adding a link to a terms page

Adding a link to a terms page

Views: 2,653

Results 1 to 16 of 16
11 May 2015, 2:03 AM
#1
bravo685 avatar

bravo685

New Zenner

Join Date:
May 2015
Location:
United States
Posts:
13
Plugin Contributions:
0

Adding a link to a terms page

Hi everyone, I have a question about creating a link to a terms page.

At the footer of my store I have:
Copyright © 2015 My Online Store. Powered by Zen Cart | Privacy Notice |

I wish to add a terms page to my footer and link 'Terms' to an EZpage called Terms & Conditions.
Copyright © 2015 My Online Store Name. Powered by Zen Cart | Privacy Notice | Terms

What would I need to do to create this link across all pages.

Thanks,
Rob

11 May 2015, 2:16 AM
#2
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Adding a link to a terms page

bravo685:

Hi everyone, I have a question about creating a link to a terms page.

At the footer of my store I have:
Copyright © 2015 My Online Store. Powered by Zen Cart | Privacy Notice |

I wish to add a terms page to my footer and link 'Terms' to an EZpage called Terms & Conditions.
Copyright © 2015 My Online Store Name. Powered by Zen Cart | Privacy Notice | Terms

What would I need to do to create this link across all pages.

Thanks,
Rob

ZC has a ready-made (stock) Conditions of Use page - why won't you use that page and add a link to the footer?

11 May 2015, 2:19 AM
#3
bislewl avatar

bislewl

Totally Zenned

Join Date:
Dec 2011
Location:
Wisconsin, USA
Posts:
674
Plugin Contributions:
12

Re: Adding a link to a terms page

You can use this tutorial here:
https://www.zen-cart.com/content.php?239-how-can-i-program-a-link-to-an-ez-page

Personally I have switched away from using EZ_pages and been creating defines pages instead, as I feel they are easier once they are added.

11 May 2015, 2:35 AM
#4
bravo685 avatar

bravo685

New Zenner

Join Date:
May 2015
Location:
United States
Posts:
13
Plugin Contributions:
0

Re: Adding a link to a terms page

frank18:

ZC has a ready-made (stock) Conditions of Use page - why won't you use that page and add a link to the footer?

I would but the how to add the link is where I need the help.

11 May 2015, 2:39 AM
#5
bravo685 avatar

bravo685

New Zenner

Join Date:
May 2015
Location:
United States
Posts:
13
Plugin Contributions:
0

Re: Adding a link to a terms page

bislewl:

You can use this tutorial here:
https://www.zen-cart.com/content.php?239-how-can-i-program-a-link-to-an-ez-page

Personally I have switched away from using EZ_pages and been creating defines pages instead, as I feel they are easier once they are added.

Thanks Bislewl,
Can you tell me what php file needs to be edited to add the link?

Thanks,
Rob

11 May 2015, 2:50 AM
#6
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Adding a link to a terms page

bravo685:

I would but the how to add the link is where I need the help.

You can get some clues by looking into

includes/languages/YOUR_TEMPLATE/english.php

near the top of that file you should find some links such as the Copyright etc

11 May 2015, 2:26 PM
#7
bravo685 avatar

bravo685

New Zenner

Join Date:
May 2015
Location:
United States
Posts:
13
Plugin Contributions:
0

Re: Adding a link to a terms page

frank18:

You can get some clues by looking into

includes/languages/YOUR_TEMPLATE/english.php

near the top of that file you should find some links such as the Copyright etc

Hi Frank18,
Yep I did some digging and I believe I found what I was looking for but also discovered that it's possibly 2 issues combined.

Originally I thought I was not able to locate the page I needed to edit. Specifically the php page that held the string and page reference I was hunting for. <a href="<?php echo zen_href_link(terms)?> "terms is a page created in EZpages using the Internal Link URL: index.php?main_page=terms.

As I continued to dig into this I found that any page I create in EZpages does not open - 404 page not found. So I need to go back and see what I have missed when creating an EZpage.

11 May 2015, 3:24 PM
#8
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,017
Plugin Contributions:
2

Re: Adding a link to a terms page

You can create define pages by duplicating the About Us mod, which can then be linked using URL:index.php?main_page=terms. Link can be placed in any menu or standalone.

11 May 2015, 8:13 PM
#9
bravo685 avatar

bravo685

New Zenner

Join Date:
May 2015
Location:
United States
Posts:
13
Plugin Contributions:
0

Re: Adding a link to a terms page

dw08gm:

You can create define pages by duplicating the About Us mod, which can then be linked using URL:index.php?main_page=terms. Link can be placed in any menu or standalone.

dwo8gm,
I have been trying that option for a little while now. I am also running into issues with it not displaying. I downloaded the ZenCart Define Page Generator and put the files in their directories (shown below). The page now opens - header and sidebox is displayed but nothing else. No matter what text I enter into the file either manually or via the 'Define Page Editor' nothing is displayed. Just the header and left sidebox as my other pages. The footer is missing & center of the page (where the actual information would be) is not present meaning just the page background is shown there.

I have tried editing both files in the html_includes directory but no luck.

ZenCart Define Page Generator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Files Generated:
/includes/extra_datafiles/terms_filenames.php
/includes/languages/english/extra_definitions/terms/terms.php
/includes/languages/english/html_includes/define_terms.php
/includes/languages/english/html_includes/terms/define_terms.php
/includes/languages/english/terms/terms.php
/includes/modules/pages/terms/header_php.php
/includes/templates/terms/templates/tpl_terms_default.php

After copying these files to your zencart installation directory, you can link to this page using the following link:
http://yourdomain.com/zencart_directory/index.php?main_page=terms

12 May 2015, 2:44 PM
#10
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,017
Plugin Contributions:
2

Re: Adding a link to a terms page

Not sure what you have done, but your folder structure does not look right. Unless you really have a template called terms, you should remove all references to /terms/ in your folder structure, except for that in /includes/modules/pages/terms/header_php.php. You do not need to create a template for a single page, but if you run a template then the fileset will need to be distributed accordingly.

Once you have edited the names and contents of each file to conform to your page set "terms", the main content of the page will be contained in /includes/languages/english/html_includes/YOUR_TEMPLATE/define_terms.php.

I edit pages directly in a text editor (eg notepad++), where it is much easier to save/refresh/re-edit a page, rather than go through the admin define pages editor.

I have not seen nor used the ZenCart Define Page Generator.

12 May 2015, 6:42 PM
#11
bravo685 avatar

bravo685

New Zenner

Join Date:
May 2015
Location:
United States
Posts:
13
Plugin Contributions:
0

Re: Adding a link to a terms page

dw08gm:

Not sure what you have done, but your folder structure does not look right. Unless you really have a template called terms, you should remove all references to /terms/ in your folder structure, except for that in /includes/modules/pages/terms/header_php.php. You do not need to create a template for a single page, but if you run a template then the fileset will need to be distributed accordingly.

Once you have edited the names and contents of each file to conform to your page set "terms", the main content of the page will be contained in /includes/languages/english/html_includes/YOUR_TEMPLATE/define_terms.php.

I edit pages directly in a text editor (eg notepad++), where it is much easier to save/refresh/re-edit a page, rather than go through the admin define pages editor.

I have not seen nor used the ZenCart Define Page Generator.

dw08gm,

Thanks for your help on this. I am one step closer I now see a single row for text with the following word 'terms'.
Editing the file in Define Pages Editor changes nothing. I also made the changes to the directory structure you suggested but no luck either.

So ... I think I will delete everything I did and just copy a different page/rename it and start over. It's odd that I see it in the Define Page editor but page content is not showing.

12 May 2015, 9:35 PM
#12
bravo685 avatar

bravo685

New Zenner

Join Date:
May 2015
Location:
United States
Posts:
13
Plugin Contributions:
0

Re: Adding a link to a terms page

Just an update on where I stand with this.

I have removed all previous files and started over. I copied a currently working page and it's directory struct just to see what would happen. Renamed the copy to terms and I get the same results. Page loads only the header, footer and sidebox with the center of the page empty. Even with the new files matching the directory location and structure of a working page - just renamed. Could I be getting into file permission issues? Double checking file permissions I have '604' for all the newly copied files (same as the orig file).

Here are the locations the copied file exists. Again it's just a copy of a functioning page.

Store\includes\modules\pages\terms\header_php.php
Store\includes\templates\template_default\templates\tpl_terms_default.php
Store\includes\languages\english\html_includes\classic\define_ terms.php
Store\includes\languages\english\html_includes\define_ terms.php
Store\includes\languages\english\ terms.php

What am I missing guys?? I didn't think it would be this difficult to add a new page. I would of at least expect the copied page to reference the original named files due to php code in each copied file not being altered. I see the page content getting changed in the Define Page Editor & it differs from the originally copied page. So I do know I am editing the correct page content.

13 May 2015, 11:01 AM
#14
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Adding a link to a terms page

As I mentioned earlier in this thread, the simplest way is to use the existing define page 'Conditions of Use' and change the first line in your includes/languages/YOUR_TEMPLATE/english.php file to read like this:

  define('FOOTER_TEXT_BODY', 'Copyright © ' . date('Y') . ' <a href="' . zen_href_link(FILENAME_DEFAULT) . '" target="_blank">' . STORE_NAME . '</a>.  Powered by <a href="http://www.zen-cart.com" target="_blank">Zen Cart</a>.  <a href="index.php?main_page=conditions">Terms & Conditions</a>');

Done and dusted - no fuss.

13 May 2015, 1:01 PM
#15
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,017
Plugin Contributions:
2

Re: Adding a link to a terms page

bravo685:

Just an update on where I stand with this.

I have removed all previous files and started over. I copied a currently working page and it's directory struct just to see what would happen. Renamed the copy to terms and I get the same results. Page loads only the header, footer and sidebox with the center of the page empty. Even with the new files matching the directory location and structure of a working page - just renamed. Could I be getting into file permission issues? Double checking file permissions I have '604' for all the newly copied files (same as the orig file).

Here are the locations the copied file exists. Again it's just a copy of a functioning page.

Store\includes\modules\pages\terms\header_php.php
Store\includes\templates\template_default\templates\tpl_terms_default.php
Store\includes\languages\english\html_includes\classic\define_ terms.php
Store\includes\languages\english\html_includes\define_ terms.php
Store\includes\languages\english\ terms.php

What am I missing guys?? I didn't think it would be this difficult to add a new page. I would of at least expect the copied page to reference the original named files due to php code in each copied file not being altered. I see the page content getting changed in the Define Page Editor & it differs from the originally copied page. So I do know I am editing the correct page content.

It is not difficult at all, but does require an understanding of the template overrides system and attention to detail.

If you are using the classic template, certain files must be placed in classic folders, ie
Store\includes\templatesclassic\templates\tpl_terms_default.php
Store\includes\languages\englishclassic\terms.php (the space between \ and terms needs to be removed.)

Also
Store\includes\extra_datafiles\terms_filenames.php is missing from your latest list. This is needed to define the fileset.

You may have other problems not related to the about us mod, that should be apparent by you comparing your fileset with the default fileset.

13 May 2015, 1:09 PM
#16
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,017
Plugin Contributions:
2

Re: Adding a link to a terms page

frank18:

As I mentioned earlier in this thread, the simplest way is to use the existing define page 'Conditions of Use' and change the first line in your includes/languages/YOUR_TEMPLATE/english.php file to read like this:

define('FOOTER_TEXT_BODY', 'Copyright © ' . date('Y') . ' <a href="' . zen_href_link(FILENAME_DEFAULT) . '" target="_blank">' . STORE_NAME . '</a>. Powered by <a href="http://www.zen-cart.com" target="_blank">Zen Cart</a>. <a href="index.php?main_page=conditions">Terms & Conditions</a>');

> 
> Done and dusted - no fuss.


Yes, but the about us mod also serves as a basis for the creation of diverse other pages, so is a very useful mod to have.