ECshop详细页面 颜色 尺码 等规格和库存相连动 和淘宝的格式一样_html/css_WEB-ITnose

php中文网
发布: 2016-06-21 09:14:04
原创
1278人浏览过

二、添加css文件 找到style.css

.catt{width:100%;height:auto;overflow:hidden;padding-bottom:5px;}
.catt a{border: #7e7e7e 1px solid;  text-align: center; background-color: #fff; margin-left:5px;margin-top:6px;padding-left: 10px;padding-right: 10px;display: block; white-space: nowrap;color:#000; text-decoration:none; float:left;}
.catt a:hover {border:#ed0036 2px solid; margin: -1px; margin-left:4px;margin-top:5px;}
.catt a:focus {outline-style:none;}
.cattsel {border:#ed0036 2px solid; margin: -1px;background: url("images/test.gif") no-repeat bottom right; margin-left:4px;margin-top:5px;}
.cattsel a:hover {border: #ed0036 2px solid;margin:-1px;background: url("images/test.gif") no-repeat bottom right;}

三、添加循环文件,找到goods.dwt文件

找到:
                       
                       
                       
替换为:




href="javascript:;" name="{$value.id}" title="[{if $value.price gt 0}{$lang.plus}{elseif $value.price

lt 0}{$lang.minus}{/if} {$value.format_price|abs}]">{$value.label}
id="spec_value_{$value.id}" type="radio" name="spec_{$spec_key}" value="{$value.id}" {if $key eq 0}

checked{/if} />



四、添加js文件:

function changeatt(t,a,goods_id) {
t.lastchild.checked='checked';
for (var i = 0; i if (t.parentnode.childnodes[i].classname == 'cattsel') {
t.parentnode.childnodes[i].classname = '';
}
}

t.classname = "cattsel";
var formbuy = document.forms['ecs_formbuy'];
spec_arr = getselectedattributes(formbuy);
ajax.call('goods.php?act=get_products_info', 'id=' + spec_arr+ '&goods_id=' + goods_id, shows_number,

'get', 'json');
changeprice();
}
function shows_number(result)
{
if(result.product_number !=undefined)
{
document.getelementbyid('shows_number').innerhtml = result.product_number+'件';
}
else
{
document.getelementbyid('shows_number').innerhtml = '未设置'
}
}

五、添加php文件代码 打开goods.php ,大约在71行下添加一下代码

if (!empty($_request['act']) && $_request['act'] == 'get_products_info')
{
include('includes/cls_json.php');

$json = new json;
// $res = array('err_msg' => '', 'result' => '', 'qty' => 1);

$spce_id = $_get['id'];
$goods_id = $_get['goods_id'];
$row = get_products_info($goods_id,explode(",",$spce_id));
//$res = array('err_msg'=>$goods_id,'id'=>$spce_id);
die($json->encode($row));

}


库宝AI
库宝AI

库宝AI是一款功能多样的智能伙伴助手,涵盖AI写作辅助、智能设计、图像生成、智能对话等多个方面。

库宝AI 109
查看详情 库宝AI
淘宝
淘宝

淘宝是一个好逛、丰富、有趣的消费生活社区,每天有亿万消费者来淘宝“逛街”:发现好物、找到乐趣、表达体验……淘宝能满足人们生活中的各种需求,有需要的小伙伴快来保存下载体验吧!

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号