Home Backend Development PHP Tutorial ECSHOP: Display sub-category products on the homepage, and switch category products by clicking on the Tab page_PHP tutorial

ECSHOP: Display sub-category products on the homepage, and switch category products by clicking on the Tab page_PHP tutorial

Jul 20, 2016 am 11:13 AM
ecshop tab Classification switch merchandise address accomplish switch start Open document show Click debug front page

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

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

// 调用子分类信息。

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}   -->
Copy after login

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>?>
 
Copy after login

 

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/440369.htmlTechArticle开始: 1. 打开调试开关 文件地址:include/cls_template.php 找到 : function _eval($content) 函数体第一行增加: echo($content); 改写调试完毕后在注释掉...
Statement of this Website
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

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Detailed explanation of C++ function debugging: How to debug problems in multi-threaded functions? Detailed explanation of C++ function debugging: How to debug problems in multi-threaded functions? May 02, 2024 pm 04:15 PM

C++ multi-thread debugging can use GDB: 1. Enable debugging information compilation; 2. Set breakpoints; 3. Use infothreads to view threads; 4. Use thread to switch threads; 5. Use next, stepi, and locals to debug. Actual case debugging deadlock: 1. Use threadapplyallbt to print the stack; 2. Check the thread status; 3. Single-step the main thread; 4. Use condition variables to coordinate access to solve the deadlock.

How to use LeakSanitizer to debug C++ memory leaks? How to use LeakSanitizer to debug C++ memory leaks? Jun 02, 2024 pm 09:46 PM

How to use LeakSanitizer to debug C++ memory leaks? Install LeakSanitizer. Enable LeakSanitizer via compile flag. Run the application and analyze the LeakSanitizer report. Identify memory allocation types and allocation locations. Fix memory leaks and ensure all dynamically allocated memory is released.

Shortcut to golang function debugging and analysis Shortcut to golang function debugging and analysis May 06, 2024 pm 10:42 PM

This article introduces shortcuts for Go function debugging and analysis, including: built-in debugger dlv, which is used to pause execution, check variables, and set breakpoints. Logging, use the log package to record messages and view them during debugging. The performance analysis tool pprof generates call graphs and analyzes performance, and uses gotoolpprof to analyze data. Practical case: Analyze memory leaks through pprof and generate a call graph to display the functions that cause leaks.

How to conduct concurrency testing and debugging in Java concurrent programming? How to conduct concurrency testing and debugging in Java concurrent programming? May 09, 2024 am 09:33 AM

Concurrency testing and debugging Concurrency testing and debugging in Java concurrent programming are crucial and the following techniques are available: Concurrency testing: Unit testing: Isolate and test a single concurrent task. Integration testing: testing the interaction between multiple concurrent tasks. Load testing: Evaluate an application's performance and scalability under heavy load. Concurrency Debugging: Breakpoints: Pause thread execution and inspect variables or execute code. Logging: Record thread events and status. Stack trace: Identify the source of the exception. Visualization tools: Monitor thread activity and resource usage.

How to debug PHP asynchronous code How to debug PHP asynchronous code May 31, 2024 am 09:08 AM

Tools for debugging PHP asynchronous code include: Psalm: a static analysis tool that can find potential errors. ParallelLint: A tool that inspects asynchronous code and provides recommendations. Xdebug: An extension for debugging PHP applications by enabling a session and stepping through the code. Other tips include using logging, assertions, running code locally, and writing unit tests.

What are the debugging techniques for recursive calls in Java functions? What are the debugging techniques for recursive calls in Java functions? May 05, 2024 am 10:48 AM

The following techniques are available for debugging recursive functions: Check the stack traceSet debug pointsCheck if the base case is implemented correctlyCount the number of recursive callsVisualize the recursive stack

PHP Debugging Errors: A Guide to Common Mistakes PHP Debugging Errors: A Guide to Common Mistakes Jun 05, 2024 pm 03:18 PM

Common PHP debugging errors include: Syntax errors: Check the code syntax to make sure there are no errors. Undefined variable: Before using a variable, make sure it is initialized and assigned a value. Missing semicolons: Add semicolons to all code blocks. Function is undefined: Check that the function name is spelled correctly and make sure the correct file or PHP extension is loaded.

Samsung will provide displays for Microsoft's MR headsets, and the devices are expected to be lighter and have clearer displays Samsung will provide displays for Microsoft's MR headsets, and the devices are expected to be lighter and have clearer displays Aug 10, 2024 pm 09:45 PM

Recently, Samsung Display and Microsoft signed an important cooperation agreement. According to the agreement, Samsung Display will develop and supply hundreds of thousands of OLEDoS panels for mixed reality (MR) head-mounted devices to Microsoft. Microsoft is developing an MR device for multimedia content such as games and movies. This device is expected to It will be launched after the OLEDoS specifications are finalized, mainly serving the commercial field, and is expected to be delivered as early as 2026. OLEDoS (OLED on Silicon) technology OLEDoS is a new display technology that deposits OLED on a silicon substrate. Compared with traditional glass substrates, it is thinner and has higher pixels. OLEDoS display and ordinary display

See all articles