Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / How to add item in the first page of zen cart?

How to add item in the first page of zen cart?

Locked

Started by sunzhoujian on 7 May 2008, 9:38 AM · Views: 3,450

Results 1 to 20 of 22
This thread is locked. New replies are disabled.
7 May 2008, 9:38 AM
#1
sunzhoujian avatar

sunzhoujian

Zen Follower

Join Date:
Jan 2008
Location:
China
Posts:
154
Plugin Contributions:
0

Post #1 by sunzhoujian

Hello everyone, I installed zen cart and phpbb, I am interested in creating one link in the first page to link to that. How should I do that? I checked index.php, but I couldn't find the file to edit to ... Thanks for your tip in advance!

7 May 2008, 9:46 AM
#2
fairestcape avatar

fairestcape

Totally Zenned

Join Date:
Mar 2008
Location:
Cape Town & London (depends on the season)
Posts:
2,957
Plugin Contributions:
0

Post #2 by fairestcape

You could use EZ-pages to create the links. This does not require any changes to the core code, such as index.php .

It is ALWAYS better to avoid changing core code where possible, and to use in-built functions to create features on your site.

7 May 2008, 10:13 AM
#3
sunzhoujian avatar

sunzhoujian

Zen Follower

Join Date:
Jan 2008
Location:
China
Posts:
154
Plugin Contributions:
0

Post #3 by sunzhoujian

EZ-pages, thanks a lot! I am not so familiar with that. Where can I find that?
Here is the website, http://www.bendigou.com/
Here is the forum, http://www.bendigou.com/forum/

Sorry that they are in Chinese, but I just wanted to add one link in the top left to link to that forum. Could you give me more detailed information?

7 May 2008, 10:15 AM
#4
sunzhoujian avatar

sunzhoujian

Zen Follower

Join Date:
Jan 2008
Location:
China
Posts:
154
Plugin Contributions:
0

Post #4 by sunzhoujian

It would be great if there is tutorial in video format as today those devices are very cheap to record how to do that, so we can just watch for reviewing...

7 May 2008, 10:24 AM
#6
sunzhoujian avatar

sunzhoujian

Zen Follower

Join Date:
Jan 2008
Location:
China
Posts:
154
Plugin Contributions:
0

Post #6 by sunzhoujian

Thanks for your link. However, there is no example, I don't know where to start that? I looked around the admin console, there is EZ-settings, but that is that, there is no place I can edit or what so ever. Could you give me more example, anyway, it would be helpful for other people as well...

7 May 2008, 10:27 AM
#7
fairestcape avatar

fairestcape

Totally Zenned

Join Date:
Mar 2008
Location:
Cape Town & London (depends on the season)
Posts:
2,957
Plugin Contributions:
0

Post #7 by fairestcape

ADMIN>>>TOOLS>>>EZ PAGES is where you create, edit and administer your EZ Pages and EZ Links...

Read through the whole tutorial on EZ Pages.

7 May 2008, 10:41 AM
#8
sunzhoujian avatar

sunzhoujian

Zen Follower

Join Date:
Jan 2008
Location:
China
Posts:
154
Plugin Contributions:
0

Post #8 by sunzhoujian

Thanks for your additional information. However, I am totally new on this field, I added one, but one information displayed in the first page and I can see there is one more home displayed there which was not I created.

Please take a look at this english version
http://nanningsigma.com/index.php?main_page=index&language=en&zenid=89b299f1d28628da33998788909e0401

There is a "Home" appeared in the mid while I was trying to add a "forum" in Chinese.

What is wrong? I read through the whole article, but it only desribe very sketchly...

7 May 2008, 10:42 AM
#9
sunzhoujian avatar

sunzhoujian

Zen Follower

Join Date:
Jan 2008
Location:
China
Posts:
154
Plugin Contributions:
0

Post #9 by sunzhoujian

Do you have skpe? Can I call you to talk to you abou this? My Skype is sunzhoujian

7 May 2008, 11:41 AM
#10
sunzhoujian avatar

sunzhoujian

Zen Follower

Join Date:
Jan 2008
Location:
China
Posts:
154
Plugin Contributions:
0

Post #10 by sunzhoujian

Can anyone give more information?

fairestcape:

ADMIN>>>TOOLS>>>EZ PAGES is where you create, edit and administer your EZ Pages and EZ Links...

Read through the whole tutorial on EZ Pages.

7 May 2008, 12:03 PM
#11
steven300 avatar

steven300

Totally Zenned

Join Date:
Jan 2008
Posts:
1,564
Plugin Contributions:
1

Post #11 by steven300

For us to help you, I think you need to specify exactly where you want this link to be. From your original post, it's clear that you want it somewhere on your home page, but there are many places you can choose to display it. You might want to display it in a sidebox, in the header bar, footer bar, within the main text in the centre column etc etc. Each method requires a slightly different approach. It's hard to explain anything any further without knowing what you want explaining.

7 May 2008, 12:11 PM
#12
sunzhoujian avatar

sunzhoujian

Zen Follower

Join Date:
Jan 2008
Location:
China
Posts:
154
Plugin Contributions:
0

Post #12 by sunzhoujian

Thanks so much for your message! Yes. I need it to be displayed in the header bar. In the leader bar, there are "Home" and " Log in" right now, I just need to add another one " forum " to that and have that link to our forum link http://www.bendigou.com/forum. However, the problem is that I couldn't find the pages to edit to? And I don't know how to do that with Ez-Pages... Could you give me the help?

7 May 2008, 12:28 PM
#13
steven300 avatar

steven300

Totally Zenned

Join Date:
Jan 2008
Posts:
1,564
Plugin Contributions:
1

Post #13 by steven300

Ok, EZ Pages can't be used for this.

You need to find:
includes\templates\template_default\common\tpl_header.php

Overide it as:
includes\templates\your_template\common\tpl_header.php

In your overide copy, after it says..

<li><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a></li>
<?php } } ?>

Add..

<li><a href="http://www.bendigou.com/forum">Forum</a></li>
7 May 2008, 2:46 PM
#14
sunzhoujian avatar

sunzhoujian

Zen Follower

Join Date:
Jan 2008
Location:
China
Posts:
154
Plugin Contributions:
0

Post #14 by sunzhoujian

Steven300:

Ok, EZ Pages can't be used for this.

You need to find:
includes\templates\template_default\common\tpl_header.php

Overide it as:
includes\templates\your_template\common\tpl_header.php

In your overide copy, after it says..

<li><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a></li> <?php } } ?> ``` > > Add.. > > ```php <li><a href="http://www.bendigou.com/forum">Forum</a></li> ``` Thanks a lot for that information! That is one more step towarding solving this problem! However, I couldn't find this file in my website. I installed zen cart from hostmonster.com and its version is 1.3.8a. however, I couldn't find the folder of templates after includes. Could you take a look and are there any other people who have experience on this? Thanks a lot in advance and my skype is sunzhoujian.

///////////////////////////////////////////////////
New Installation (1.3.8a)
Disk space required: 14.52 MB
Disk space available: 614277.5 MB
//////////////////////////////////////////////////

7 May 2008, 3:01 PM
#15
sunzhoujian avatar

sunzhoujian

Zen Follower

Join Date:
Jan 2008
Location:
China
Posts:
154
Plugin Contributions:
0

Post #15 by sunzhoujian

tpl_header .php

I searched all over the disk, but I still couldn't find the file. Did I miss anything? Or the version changed a lot?

7 May 2008, 3:09 PM
#16
fairestcape avatar

fairestcape

Totally Zenned

Join Date:
Mar 2008
Location:
Cape Town &amp; London (depends on the season)
Posts:
2,957
Plugin Contributions:
0

Post #16 by fairestcape

Without tpl_header.php your zenshop will probably not work. Look in the directory path(s) suggested by Steven300.

It has to be there.

7 May 2008, 3:41 PM
#17
sunzhoujian avatar

sunzhoujian

Zen Follower

Join Date:
Jan 2008
Location:
China
Posts:
154
Plugin Contributions:
0

Post #17 by sunzhoujian

Thanks a lot! I checked again, and I found that we didn't download the whole websites. And I found the tpl_header.php file. I downloaded and opened it with Notepad and uploaded again. However, I got error
message like this. What happened? I noticed that after I made edition
to the file, the format of file in Notepad changes. Can I use it to edit php file, if not, what would you suggest to use? I am using windows xp right now.

"Parse error: syntax error, unexpected '{' in /home/nannings/public_html/includes/templates/template_default/common/tpl_header.php on line 1"

7 May 2008, 4:23 PM
#18
steven300 avatar

steven300

Totally Zenned

Join Date:
Jan 2008
Posts:
1,564
Plugin Contributions:
1

Post #18 by steven300

There's some type of problem with your code. I suggest posting the contents of tpl_header.php so we can check for any mistakes. Remember to wrap it in PHP tags so it's easier to read.

Notepad should be fine for editing PHP files. After you save the file, just check its properties to see if it's still of the same file type.

Also, it doesn't look like you're making use of the overide system.

11 May 2008, 5:49 AM
#19
sunzhoujian avatar

sunzhoujian

Zen Follower

Join Date:
Jan 2008
Location:
China
Posts:
154
Plugin Contributions:
0

Post #19 by sunzhoujian

Here is the tpl_header file, sorry for the late reply and I still didn't get the problem solved. And I really look forward to your help!

<?php /** * Common Template - tpl_header.php * * this file can be copied to /templates/your_template_dir/pagename<br /> * example: to override the privacy page<br /> * make a directory /templates/my_template/privacy<br /> * copy /templates/templates_defaults/common/tpl_footer.php to /templates/my_template/privacy/tpl_header.php<br /> * to override the global settings and turn off the footer un-comment the following line:<br /> * <br /> * $flag_disable_header = true;<br /> * * @package templateSystem * @copyright Copyright 2003-2006 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: tpl_header.php 4813 2006-10-23 02:13:53Z drbyte $ */ ?> <?php // Display all header alerts via messageStack: if ($messageStack->size('header') > 0) { echo $messageStack->output('header'); } if (isset($_GET['error_message']) && zen_not_null($_GET['error_message'])) { echo htmlspecialchars(urldecode($_GET['error_message'])); } if (isset($_GET['info_message']) && zen_not_null($_GET['info_message'])) { echo htmlspecialchars($_GET['info_message']); } else { } ?> <!--bof-header logo and navigation display--> <?php if (!isset($flag_disable_header) || !$flag_disable_header) { ?> <div id="headerWrapper"> <!--bof-navigation display--> <div id="navMainWrapper"> <div id="navMain">
<ul class="back">

<li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li>
<?php if ($_SESSION['customer_id']) { ?>
<li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></li>

<li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a></li>
<?php } else { if (STORE_STATUS == '0') { ?>
<li><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a></li>
<?php } } ?> <?php if ($_SESSION['cart']->count_contents() != 0) { ?>
<li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></li>

<li><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>
<?php }?> </ul> </div> <div id="navMainSearch"><?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?></div> <br class="clearBoth" /> </div> <!--eof-navigation display--> <!--bof-branding display--> <div id="logoWrapper">
<div id="logo"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?></div>
<?php if (HEADER_SALES_TEXT != '' || (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))) { ?>
<div id="taglineWrapper">
<?php if (HEADER_SALES_TEXT != '') { ?>
  <div id="tagline"><?php echo HEADER_SALES_TEXT;?></div>
<?php } ?> <?php if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) { if ($banner->RecordCount() > 0) { ?>
  <div id="bannerTwo" class="banners"><?php echo zen_display_banner('static', $banner);?></div>
<?php } } ?>
</div>
<?php } // no HEADER_SALES_TEXT or SHOW_BANNERS_GROUP_SET2 ?> </div> <br class="clearBoth" /> <!--eof-branding display--> <!--eof-header logo and navigation display--> <!--bof-optional categories tabs navigation display--> <?php require($template->get_template_dir('tpl_modules_categories_tabs.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_categories_tabs.php'); ?> <!--eof-optional categories tabs navigation display--> <!--bof-header ezpage links--> <?php if (EZPAGES_STATUS_HEADER == '1' or (EZPAGES_STATUS_HEADER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) { ?> <?php require($template->get_template_dir('tpl_ezpages_bar_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_ezpages_bar_header.php'); ?> <?php } ?> <!--eof-header ezpage links--> </div> <?php } ?>

Steven300:

There's some type of problem with your code. I suggest posting the contents of tpl_header.php so we can check for any mistakes. Remember to wrap it in PHP tags so it's easier to read.

Notepad should be fine for editing PHP files. After you save the file, just check its properties to see if it's still of the same file type.

Also, it doesn't look like you're making use of the overide system.

11 May 2008, 9:16 AM
#20
steven300 avatar

steven300

Totally Zenned

Join Date:
Jan 2008
Posts:
1,564
Plugin Contributions:
1

Post #20 by steven300

The code you posted has double spacing. This is likely to be the cause of the problem. You need to get your last backup of the file (or a fresh version) and add the code I suggested above using a good text editor.

Try using Notepad++
http://notepad-plus.sourceforge.net/uk/site.htm