zen-cart网站,模版,采集,二次开发

首页 » ZenCart » ZenCart教程 » 阅读文章

ZenCart产品标签producttags插件

2011-12-01 11:30 96394 18 发表评论
标签:


这个插件最早是在lightinthebox里使用的,是从他模板里面扣出来的,这款插件网上有很多,这里只是收集,整理,备查。

zen cart producttags功能就是在网站底部显示26个英文字母,当用户点击其中的一个的时候,就查找出来所有以这个字母开头的产品。这个功能对客户不是很有用,对seo来说可是非常之有用,可为你的网站添加很多的分类收录。

使用方法

1.上传文件覆盖。

(更正)2.在.htaccess中# For Open Operations Info Manager上面增加(下载包中附完整.htaccess)

#producttags
RewriteRule ^producttags/([-\w]+)/$ index\.php?main_page=producttags&letter=$1&%{QUERY_STRING} [L]
RewriteRule ^producttags/([\w])/([0-9]+).html$ index\.php?main_page=producttags&letter=$1&page=$2&%{QUERY_STRING} [L]
RewriteRule ^wishlist/$ index\.php?main_page=wishlist [L]
RewriteRule ^wishlist/([\w])/$ index\.php?main_page=wishlist&letter=$1&%{QUERY_STRING} [L]
RewriteRule ^wishlist/([\w])/([0-9]+).html$ index\.php?main_page=wishlist&letter=$1&page=$2&%{QUERY_STRING} [L]

3.在includes\templates\你的模板\common\tpl_footer.php中添加适当位置添加

<!-- bof productTags-->
<div style="width:100%;margin:10px 0;text-align:center">Product Tags:
<?php
// display productTagList
foreach(range('a', 'z') as $letter) {
echo '<a target="_top" href="' .
HTTP_SERVER.DIR_WS_CATALOG.'producttags/'.$letter.'/" >'.strtoupper
($letter).'</a> ';
}
echo '<a target="_top" href="' .
HTTP_SERVER.DIR_WS_CATALOG.'producttags/0-9/" >0-9</a> ';
?>
</div>
<!-- eof productTags-->

(更正)

(新增)4.调整页面显示个数

在includes\templates\template_default\templates\tpl_producttags_default.php中查找

$producttags_split = new splitPageResults($producttags_split_sql, 100, 'p.products_id', 'page');

将100改为自己想要的个数即可。

相关日志:

评论 共18条 (RSS 2.0) 发表评论

  1. zenlove 说道:

    请问大哥是用的zen cart是哪个版本的,为什么我按你说的去做,点击字母去搜索只会显示:“Not Found
    The requested URL /zc/producttags/h/ was not found on this server.

  2. adam 说道:

    今天我又来了,支持新文章。这个我测试了,有个小问题,就是点tag后显示的产品页面,我的只有1页,点击那个翻页的1就没有内容,是不是有2页以上才翻页?

    • E-zencart 说道:

      感谢提醒,以更正。

      • su35 说道:

        以字母开头的链接分页正常。 但以数字开头的 (0-9) 点击分页链接会出现404。

        • ezencart 说道:

          插件自身的小问题,加一条标题字母开头的产品或者,删掉0-9的tag即可

  3. lolola 说道:

    能正常显示但点击的时候会自动跳转到首页不知什么问题,没有显示相应的类产品

  4. 123q1q1q 说道:

    你好博主,本机 zencart V1.3.9h,安装了 SSU,
    除了 .htaccess文件,其它的文件都覆盖了。

    本机的.htaccess 文件内容如下:

    #### BOF SSU
    Options +FollowSymLinks -MultiViews
    RewriteEngine On
    # Make sure to change "test_site" to the subfolder you install ZC. If you use root folder, change to: RewriteBase /
    RewriteBase /mytest/
    
    # Deny access from .htaccess
    RewriteRule ^\.htaccess$ - [F]
    
    RewriteCond %{SCRIPT_FILENAME} !-f
    RewriteCond %{SCRIPT_FILENAME} !-d
    
    RewriteRule ^(.*) index.php?/$1 [E=VAR1:$1,QSA,L]
    
    #### EOF SSU
    

    但是,

    #producttags
    RewriteRule ^producttags/([-\w]+)/$ index\.php?main_page=producttags&letter=$1&%{QUERY_STRING} [L]
    RewriteRule ^producttags/([\w])/([0-9]+).html$ index\.php?main_page=producttags&letter=$1&page=$2&%{QUERY_STRING} [L]
    RewriteRule ^wishlist/$ index\.php?main_page=wishlist [L]
    RewriteRule ^wishlist/([\w])/$ index\.php?main_page=wishlist&letter=$1&%{QUERY_STRING} [L]
    RewriteRule ^wishlist/([\w])/([0-9]+).html$ index\.php?main_page=wishlist&letter=$1&page=$2&%{QUERY_STRING} [L]
    

    这个代码不管加在哪个位置,
    都会 出现“Page Not Found”, “Custom 404 Error Page with Site Map Sample Text …” 提示,

    这是哪里没改好,谢谢。

  5. alex 说道:

    博主,能不能弄个标签云呢?zc论坛上的标签云插件是老版本的,不能用! :razz:

  6. aaaaaaaaaa 说道:

    还有个小问题,字母搜索 如果没有这个字母开头 就有点错误了。主要是,所以最好把所有的url 都strtolower, 或者在判读那里strtolower

  7. 小梁 说道:

    我用上去,怎么没功能出现呢?而且整站都乱码了 :cry:

  8. john 说道:

    如果是0-9的话,有分页,点1 ,2 ,3都会出错,如果这个能修正好就完美了

    • 007 说道:

      是啊,就是有这个BUG,楼上的su35也遇到了,跪求博主修复

  9. franc 说道:

    你好,点击有些没有产品的字母时会提示以下错误:
    Warning: Cannot modify header information – headers already sent by (output started at /www/web/jerseys_xj17/public_html/includes/templates/jersey/common/html_header.php:22) in /www/web/jerseys_xj17/public_html/includes/functions/functions_general.php on line 86

    这是什么问题?

发表评论

  • 
  • 插入代码

联系我 Contact Me

回到页首