In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article introduces the knowledge of "how to use ECShop to call the latest comments in the product details page". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Let me just write down the operation steps and take a look at the train of thought. I believe you will also know it.
Step one:
Building custom functions in includes/lib_goods.php
The copy code is as follows:
/ * *
* get recent comments
*
* @ return array
, /
Function get_latest_comment ($limit_num)
{
$sql = "SELECT c. Contentrec. Addmaitytime.g.goodstimedline g.goodstimename FROM". $GLOBALS ['ecs']-> table (' comment'). "AS c
LEFT JOIN ". $GLOBALS ['ecs']-> table (' goods')." AS g on c.id_value=g.goods_id
WHERE c.status=1
LIMIT ". $limit_num
$res = $GLOBALS ['db']-> getAll ($sql)
Return $res
}
Step 2:
$smarty- > assign ('goods_rank', get_goods_rank ($goods_id)) of goods.php in the root directory; / / ranking of sales of goods
Add the following code
The copy code is as follows:
$smarty- > assign ('comments_latest', get_latest_comment (10)); / / get the latest reviews
Step 3:
Create a comments_latest.lbi file in the library directory
Step 4:
Use the following code in the template file goods.dwt to call "latest comments" on the item details page
The copy code is as follows:
This is the end of the content of "how to use ECShop to invoke the latest comments on the product details page". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.