Ecshop Product category page Get album list method

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.