search
Homephp教程php手册ECSHOP:首页实现显示子分类商品,并实现点击Tab页切换分类商品
ECSHOP:首页实现显示子分类商品,并实现点击Tab页切换分类商品Jun 13, 2016 am 11:29 AM
ecshoptabClassificationswitchmerchandiseaddressaccomplishswitchstartOpendocumentshowClickdebugfront page

开始:    1. 打开调试开关     文件地址:include/cls_template.php 找到 :     

 function _eval($content)
     函数体第一行增加: echo($content);    改写调试完毕后在注释掉。   2. 修改goods获取函数,以便显示子分类。    文件:include/cls_goods.php 找到函数:function assign_cat_goods, 在 $cat['id']   = $cat_id; 后增加一行:
$cat['cat_id'] = get_child_tree($cat_id);

// 调用子分类信息。

  3.修改模板 cat_goods.lbi ,显示子分类并调用子商品  

     

     

      //这里循环获取当前商品分类ID,传入获取商品信息集合
               $cid = $this->_var['rec_cat1']['id'];
            $this ->assign('goods_cat_'.$cid, assign_cat_goods($cid, 4));
            $this->assign('cat_goods_nf',$this->_var['cat_goods_'.$cid]);
     ?>
       

         

             
           

             
{$goods.name|escape:html}
               
{$goods.short_name|escape:html}

                市场价:
     
     
     

       

         

           
           

             
{$goods.name|escape:html}
               
{$goods.short_name|escape:html}

                  市场价: 改正如下: 1. 增加当前大分类ID是否有值的判断     增加位置:商品分类模板第一行cat_goods.lbi     代码:
<!--   {<span if</span> not <span is_null</span>(<span $goods_cat</span>.id) || <span $goods_cat</span>.id>0}   -->

2. 修改获取当前ID代码。代码如下:

      <!--   {<span foreach</span> from=<span $goods_cat</span>.cat_id item=rec_cat1 name=f1 <span key</span>=curCat}-->
<span //</span><span 这里循环获取当前商品分类ID,传入获取商品信息集合</span>
       <?<span php 
               </span><span $cid</span> = <span $this</span>->_var['curCat'];  <span //</span><span 改为这个 </span>
            <span $this</span> ->assign('goods_cat_'.<span $cid</span>, assign_cat_goods(<span $cid</span>, 4<span )); //4表示每个分类显示的商品数量,根据实际情况自己修改
            </span><span $this</span>->assign('cat_goods_nf',<span $this</span>->_var['cat_goods_'.<span $cid</span><span ]);
     </span>?>
 

 
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
如何设置谷歌浏览器首页如何设置谷歌浏览器首页Mar 02, 2024 pm 04:04 PM

如何设置谷歌浏览器首页?谷歌浏览器是如今最受欢迎的一款网络浏览器软件,这款浏览器拥有简洁高效的特性,神兽用户喜欢,在使用浏览器的时候,不同的人有不同的设置喜好,有人喜欢将谷歌浏览器设置成默认首页,也有人喜欢将首页设置成其他搜索引擎,那么具体要在哪里设置呢。接下来小编就给大家带来快速设置谷歌浏览器首页方法,希望能够给大家带来帮助。快速设置谷歌浏览器首页方法1、打开谷歌浏览器(如图所示)。2、点击界面右上角的菜单键(如图所示)。3、选择“设置”选项(如图所示)。4、在设置菜单中,找到“搜索引擎”(如

ecshop是什么构架ecshop是什么构架Feb 23, 2023 am 09:32 AM

ecshop是“B2C”构架;ecshop是一款B2C独立网店系统,适合企业及个人快速构建个性化网上商店;该系统是基于PHP语言及MYSQL数据库构架开发的跨平台开源程序。

谷歌浏览器首页变360了怎么办?谷歌浏览器首页恢复谷歌浏览器首页变360了怎么办?谷歌浏览器首页恢复Mar 15, 2024 am 08:16 AM

谷歌浏览器首页变360了怎么办?谷歌浏览器是一款简洁便利的浏览器,不过很多小伙伴在使用的过程中却发现简洁的首页被替换成了360首页,想要将它恢复为原来的样式,那么应该怎么设置呢?下面就由小编为大家带来谷歌浏览器首页恢复的方法。  解决方法  1、首先打开谷歌浏览器。  2、想要改成默认,那就点击右上角的三个点。  3、点击【设置】打开设置页面。  4、点击【启动时】。  5、如图所示,这里【打开特定网页或一组网页】是360导航的网址。  6、点击360导航右侧的三个点。  7、点击【移除】。  

ecshop文章排序方法有哪些ecshop文章排序方法有哪些Jun 16, 2023 am 11:30 AM

ecshop文章排序方法:1、按照发布时间排序,可以通过修改文章的发布时间来控制文章在列表中的排列顺序;2、按照点击量排序,可以通过安装“文章点击排行榜”插件来实现该排序功能,该插件可以统计文章的点击量;3、按照评论数排序,可以通过安装“文章评论排行榜”插件来实现该排序功能,该插件可以统计文章的评论数;4、按照相关度排序,可以通过安装“搜索排名”插件来实现该排序功能。

UniApp实现首页与导航页的设计与开发方法UniApp实现首页与导航页的设计与开发方法Jul 07, 2023 pm 09:09 PM

UniApp实现首页与导航页的设计与开发方法一、简介UniApp是一款基于Vue.js框架构建的跨平台开发工具,能够实现一套代码编译出多个平台的应用程序。在UniApp中,首页和导航页是开发应用时必备的两个页面,本文将介绍UniApp中如何设计和开发这两个页面,并提供相应的代码示例。二、首页设计与开发方法页面结构UniApp的首页一般包含标题栏、轮播图、分类

html子页如何返回到首页html子页如何返回到首页Nov 15, 2023 am 10:33 AM

html子页返回到首页的方法:1、使用超链接;2、使用JavaScript;3、使用浏览器的历史记录。详细介绍:1、使用超链接,在子页中添加一个超链接,将其链接到首页的URL,在子页的底部或导航栏中添加一个"返回首页"的链接,使用”<a>“标签来创建超链接,设置“href”属性为首页的URL;2、使用JavaScript,通过JavaScript代码来实现返回首页的功能等等。

如何在PHP中实现管家婆系统?如何在PHP中实现管家婆系统?May 12, 2023 am 08:12 AM

管家婆系统在现代企业管理中扮演着重要的角色,它不仅仅能够有效地提高企业的工作效率,还可以大大提高了企业的生产力和竞争力。与此同时,PHP作为一种广泛使用的动态脚本语言,也受到了许多企业的青睐。接下来,我们将探讨如何在PHP中实现管家婆系统,以提高企业的管理效率。一、了解管家婆系统管家婆系统是一种企业管理软件,主要用于管理公司的财务、销售、采购、仓库、人力资源

ecshop有什么特点ecshop有什么特点Feb 13, 2023 am 09:43 AM

特点:1、开源系统,具有灵活性、可定制性和高拓展性;2、支持自主二次开发;3、丰富的模版、插件;4、行业适应能力强;5、避免被软件商束缚;6、更强的可靠性、稳定性;7、移动H5框架升级,基于VUE全面换代,更加灵活开放;8、多级返佣功能,支持二维码、海报等推广方式,无限裂变发展分销商;8、管理端视觉交互全面焕新,UI简洁美观,操作体验升级;9、支持PHP7.2,性能提升一倍。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment