网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 网站建设 > ZenCart
User Name
Password
 
FAQ Members List Calendar Cheap Glasses Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1   IP: 117.95.89.159
Old 2016-04-09, 11:09 AM
Rocky Gap Rocky Gap is offline
初级会员
 
Join Date: 2011-01-10
Posts: 2
Rocky Gap 现在声名狼藉
Default 彻底征服zencart的默认page页面

zencart安装后默认会有page_2、page_3、page_4这3个没有啥用处的页面,现在我们拿其中的任意一个修改成about us页面,通过这样的修改你就会知道自己添加页面需要怎么处理了。

我们以默认的classic模版为例来介绍下具体步骤:

1、打开/includes/filenames.php,挨着contact_us(非必须挨着)添加下面两句后保存:

1.define('FILENAME_DEFINE_ABOUT_US', 'define_about_us');
2.define('FILENAME_ABOUT_US', 'about_us');


2、打开/includes/modules/pages,该文件夹下有page_2、page_3、page_4这3个文件夹,假设我们要拿page 2开刀,就将page_2的文件夹名称改为about_us,改完后打开about_us,打开里面的header_php.php,修改里面的 FILENAME_DEFINE_PAGE_2 为 FILENAME_DEFINE_ABOUT_US 并保存;

3、打开/includes/languages/english.php,修改里面的 define('BOX_INFORMATION_PAGE_2', 'Page 2'); 为 define('BOX_INFORMATION_ABOUT_US', 'About Us'); 并保存;

4、打开/includes/languages/english/,将里面的 page_2.php 更名为 about_us.php ,打开about_us.php,修改里面的 Page 2 为 About Us 并保存;

5、打开/includes/languages/english/html_includes/classic/,将里面的 define_page_2.php 更名为 define_about_us.php,上面目录classic为默认模版名,最好将/includes/languages/english/html_includes下的define_page_2.php一并更名为define_about_us.php。

6、打开/includes/templates/template_default/templates/,将里面的 tpl_page_2_default.php 更名为 tpl_about_us_default.php,然后打开tpl_about_us_default.php,修改 DEFINE_PAGE_2_STATUS 为 DEFINE_ABOUT_US_STATUS,并保存。

到这一步基本上已经大功告成,但是打开 yourdomain.com/index.php?main_page=about_us 除了显示about us的标题外并不显示内容,问题出在第6步 tpl_about_us_default.php 文件里的15行一个判断:

1.<?php if (DEFINE_ABOUT_US_STATUS >= 1 and DEFINE_ABOUT_US_STATUS <= 2) { ?>


如果我们不修改DEFINE_PAGE_2_STATUS 为 DEFINE_ABOUT_US_STATUS或许不影响这个判断,但是不改个人觉得不爽,研究了一下有两个方法可以解决这个问题:

1、直接删除这个判断,删掉15行上面的那句,删完记得要把24行的 <?php } ?>也删了,不然会出错,删掉一了百了。
2、打开数据库,搜索 Define Page 2 在表 configuration 中找到Define Page 2对应的configuration_id,比如我的是522,这个千万不能搞错,然后运行下面的sql(记得修改最后的那个id为你的id):

1.UPDATE `你的数据库名`.`configuration` SET `configuration_title` = 'Define About Us',
2.`configuration_key` = 'DEFINE_ABOUT_US_STATUS',
3.`configuration_description` = 'Enable the Defined About us Link/Text?&lt;br /&gt;0= Link ON, Define Text OFF&lt;br /&gt;1= Link ON, Define Text ON&lt;br /&gt;2= Link OFF, Define Text ON&lt;br /&gt;3= Link OFF, Define Text OFF' WHERE `configuration`.`configuration_id` =522;


这样你就可以通过后台 【商店设置】 -> 【定义页面】 来控制是否显示about页面的内容了。修改页面内容在后台 【工具】 -> 【页面编辑】,找到对应的about us编辑就好了。

同样的步骤来增加和修改文件,就可以添加自己的页面了。
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 02:05 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.