佚名 向大家介绍了ecshop二次开发,ecshop二次开发手册,ecshop二次开发教程,ecshop二次开发视频,ecshop二次开发文档等相关知识,希望对您有所帮助
收货人信息的省市区设成非必选项
一般面向国外用户的ECSHOP商城,可能会有这方面的需求:【将Ecshop中收货人信息的省市区设成非必选项】,其实也就是只留一个“请选择国家”的下拉选择框。
修改相关JS文件
打开 /js/shopping_flow.js 文件,将下面JS代码删除掉
- if (frm.elements['province'] && frm.elements['province'].value == 0 && frm.elements['province'].length > 1)
- {
- err = true;
- msg.push(province_not_null);
- }
- if (frm.elements['city'] && frm.elements['city'].value == 0 && frm.elements['city'].length > 1)
- {
- err = true;
- msg.push(city_not_null);
- }
- if (frm.elements['district'] && frm.elements['district'].length > 1)
- {
- if (frm.elements['district'].value == 0)
- {
- err = true;
- msg.push(district_not_null);
- }
- }
修改 /inlcudes/lib_order.php 文件,将下列PHP代码删除掉
</div>
- if ($res)
- {
- if (emptyempty($consignee['province']))
- {
- /* 没有设置省份,检查当前国家下面有没有设置省份 */
- $pro = get_regions(1, $consignee['country']);
- $res = emptyempty($pro);
- }
- elseif (emptyempty($consignee['city']))
- {
- /* 没有设置城市,检查当前省下面有没有城市 */
- $city = get_regions(2, $consignee['province']);
- $res = emptyempty($city);
- }
- elseif (emptyempty($consignee['district']))
- {
- $dist = get_regions(3, $consignee['city']);
- $res = emptyempty($dist);
- }
- }
修改底部的在线人数
建站之初,网站的在线人数肯定不会很多,那么我们可以稍微修改下ECSHOP的程序,让页面底部显示的在线人数 翻几番。
具体方法如下:
打开 /includes/lib_insert.php文件,找到下面代码
</div>
- $online_count = $GLOBALS['db']->getOne("SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('sessions'));
</div>
- $online_count = $GLOBALS['db']->getOne("SELECT COUNT(*) FROM "