1th Step: Find the root directory of the category.php file, look for about: 486 rows or so (note that this is not the exact location, see the actual OH), find this function:/** * The item under category * * @access public * @param string $children * @return Array*/function Category_get_goods ($children, $brand, $min, $max, $ext, $size, $page, $sort, er) ... The following code is omitted. And then in this function:if($watermark _img! ="') {$arr [$row ['goods_id']]['watermark_img'] =$watermark _img; } $arr [$row ['goods_id']]['goods_id'] = $row ['goods_id']; Add a piece of code to the following line://call thumbnail 2014-05-26 11:24:12$gid = $row ['goods_id']; $SQLG="SELECT Img_url,thumb_url from". $GLOBALS ['ECS']->table ('Goods_gallery') ."WHERE goods_id =". $gid; $ggres 2= $GLOBALS ['DB']->GetAll ($SQLG);//Print_r ($ggres 2);The general meaning is: Through the list of Product ID number, to find the corresponding product album in the thumbnail set, the return should be an image address array! (How many hours did it take to get this code?) Small series is really stupid ah ... ) and find here: $arr [$row ['goods_id']]['goods_img'] = Get_image_path ($row ['goods_id'], $row ['goods_img']); $arr [$row ['goods_id']]['URL'] = Build_uri ('Goods', Array ('GID'= = $row ['goods_id']), $row ['Goods_name']); followed by a line of code: $arr [$row ['goods_id']]['GPIC'] =$ggres 2; OK, the modification is half done, and the rest is called in the template. 2nd Step: Modify Library Files/Goods_list.lbi. In this file, find the location where you need to invoke the small picture of the product album so that the call can:<!--{foreach from= $goods. gpic item=picture name=no}--> <!--{if$smarty.foreach. no.iteration <5}-->"{if $picture. thumb_url}{$picture. thumb_url}{else}{$picture. img_url}{/if}"Width=" -"alt="{$goods. goods_name}"data-s="{if $picture. thumb_url}{$picture. thumb_url}{else}{$picture. img_url}{/if}"/><!--{/if}--> <!--{/foreach}-->I use the "{if$smarty.foreach. no.iteration <5} "To limit the number of calls to a maximum of 4, you need to modify this number of friends. In this article, we use Smarty to loop an array of album addresses, and note that the from= $goods. GPIC, the majority of the parameters that we have seen from the back are just a name, such as from= $goods _list This, but today I try to use from=$goods. Gpic in this form, the discovery is also able to loop out the array, the original really is so simple.
Ecshop Product category page Get album list method