ecshop怎么让产品显示关联文章
答案:2 悬赏:80 手机版
解决时间 2021-03-09 17:43
- 提问者网友:寂寞梧桐
- 2021-03-09 02:12
ecshop怎么让产品显示关联文章
最佳答案
- 五星知识达人网友:动情书生
- 2021-03-09 03:10
获得指定分类下所有商品的关联文章
* sun04zh3-20130321
* @access public
* @param integer $cat_id
* @return array
*/
function get_category_linked_articles($cat_id)
{
$sql = 'SELECt a.article_id, a.title, a.file_url,
a.open_type, a.add_time ' .
'FROM ' . $GLOBALS['ecs']->table('goods_article') . ' AS ga, ' .
$GLOBALS['ecs']->table('article') . ' AS a, ' .
$GLOBALS['ecs']->table('goods').' AS g '.
"WHERe ga.article_id = a.article_id AND
".get_children($cat_id).
" AND a.is_open = 1 and ga.goods_id = g.goods_id " .
'ORDER BY a.add_time DESC';
$res = $GLOBALS['db']->query($sql);
$arr = array();
while ($row = $GLOBALS['db']->fetchRow($res))
{
$row['url']= $row['open_type'] != 1 ?
build_uri('article', array('aid'=>$row['article_id']), $row['title'])
: trim($row['file_url']);
$row['add_time'] = local_date($GLOBALS['_CFG']['date_format'],
$row['add_time']);
* sun04zh3-20130321
* @access public
* @param integer $cat_id
* @return array
*/
function get_category_linked_articles($cat_id)
{
$sql = 'SELECt a.article_id, a.title, a.file_url,
a.open_type, a.add_time ' .
'FROM ' . $GLOBALS['ecs']->table('goods_article') . ' AS ga, ' .
$GLOBALS['ecs']->table('article') . ' AS a, ' .
$GLOBALS['ecs']->table('goods').' AS g '.
"WHERe ga.article_id = a.article_id AND
".get_children($cat_id).
" AND a.is_open = 1 and ga.goods_id = g.goods_id " .
'ORDER BY a.add_time DESC';
$res = $GLOBALS['db']->query($sql);
$arr = array();
while ($row = $GLOBALS['db']->fetchRow($res))
{
$row['url']= $row['open_type'] != 1 ?
build_uri('article', array('aid'=>$row['article_id']), $row['title'])
: trim($row['file_url']);
$row['add_time'] = local_date($GLOBALS['_CFG']['date_format'],
$row['add_time']);
全部回答
- 1楼网友:第四晚心情
- 2021-03-09 04:36
默认的ecshop自带这个功能的,您在添加编辑商品的时候,选项里有关联文章那个按钮;进去之后搜索你要关联的文章,然后从左边框移到右边框,点确定就行了。选择双向关联的话,商品页面出现文章,文章内页出现商品;文章的也类似。
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯