Ecshop Tutorial Product Page _ Change the previous next picture to the product name

Source: Internet
Author: User

1th Step: Modify the goods.php file

Find the following code

$prev _gid = $db->getone ("SELECT goods_id from". $ecs->table ('Goods')."WHERE cat_id=". $goods ['cat_id'] ."> goods_id". $goods ['goods_id'] ."and Is_on_sale = 1 and Is_alone_sale = 1 and is_delete = 0 LIMIT 1"); if(!empty ($prev _gid)) {$prev _good['URL'] = Build_uri ('Goods', Array ('GID'= = $prev _gid), $goods ['Goods_name']); $smarty->assign ('Prev_good', $prev _good);//Previous Item} $next _gid= $db->getone ("SELECT Max (goods_id) from". $ecs->table ('Goods') ."WHERE cat_id=". $goods ['cat_id']."< goods_id". $goods ['goods_id'] ."and Is_on_sale = 1 and Is_alone_sale = 1 and is_delete = 0"); if(!empty ($next _gid)) {$next _good['URL'] = Build_uri ('Goods', Array ('GID'= = $next _gid), $goods ['Goods_name']); $smarty->assign ('Next_good', $next _good);//Next Product}


Then modify it to the following code (note the red part)

$prev _gid = $dbGetRow("SELECT goods_id,goods_name  from". $ecs->table ('Goods')."WHERE cat_id=". $goods ['cat_id'] ."> goods_id". $goods ['goods_id'] ."and Is_on_sale = 1 and Is_alone_sale = 1 and is_delete = 0 LIMIT 1"); if(!empty ($prev _gid)) {$prev _good['URL'] = Build_uri ('Goods', Array ('GID'=$prev _gid[' goods_id '), $goods [' Goods_name ']); $prev _good[ ' goods_name '] = $prev _gid[' goods_name ']; $smarty->assign ('Prev_good', $prev _good);//Previous Item} $next _gid= $dbGetRow("SELECT goods_id,goods_name  from". $ecs->table ('Goods') ."WHERE cat_id=". $goods ['cat_id']."< goods_id". $goods ['goods_id'] ."and Is_on_sale = 1 and Is_alone_sale = 1 and Is_delete = 0 ORDER BY goods_id desc LIMIT 1"); if(!empty ($next _gid)) {$next _good['URL'] = Build_uri ('Goods', Array ('GID'= $next _gid['goods_id']), $goods ['Goods_name']); $next _good[ ' goods_name '] = $next _gid[' goods_name ']; $smarty->assign ('Next_good', $next _good);//Next Product}


2nd Step: Modify the template file/themes/default/goods.dwt

Will

<a href="{$prev _good.url}"><img alt="prev " src= " ./images/up.gif " /></a>

Modified to:

<a href="{$prev _good.url}">{$prev _good.goods_name}"</a >

Then the

<a href="{$next _good.url}"><img alt="next" src= " ./images/down.gif " /></a>


Revision changed to

<a href="{$next _good.url}">{$next _good.goods_name}"</a >

Ecshop Tutorial Product Page _ Change the previous next picture to the product name

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.