收貨人信息的省市區(qū)設(shè)成非必選項
一般面向國外用戶的ECSHOP商城,可能會有這方面的需求:【將Ecshop中收貨人信息的省市區(qū)設(shè)成非必選項】,其實也就是只留一個“請選擇國家”的下拉選擇框。
修改相關(guān)JS文件
打開 /js/shopping_flow.js 文件,將下面JS代碼刪除掉
JavaScript Code復(fù)制內(nèi)容到剪貼板
- 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代碼刪除掉
PHP Code復(fù)制內(nèi)容到剪貼板
- if ($res)
- {
- if (emptyempty($consignee['province']))
- {
- /* 沒有設(shè)置省份,檢查當(dāng)前國家下面有沒有設(shè)置省份 */
- $pro = get_regions(1, $consignee['country']);
- $res = emptyempty($pro);
- }
- elseif (emptyempty($consignee['city']))
- {
- /* 沒有設(shè)置城市,檢查當(dāng)前省下面有沒有城市 */
- $city = get_regions(2, $consignee['province']);
- $res = emptyempty($city);
- }
- elseif (emptyempty($consignee['district']))
- {
- $dist = get_regions(3, $consignee['city']);
- $res = emptyempty($dist);
- }
- }
修改底部的在線人數(shù)
建站之初,網(wǎng)站的在線人數(shù)肯定不會很多,那么我們可以稍微修改下ECSHOP的程序,讓頁面底部顯示的在線人數(shù) 翻幾番。
具體方法如下:
打開 /includes/lib_insert.php文件,找到下面代碼
PHP Code復(fù)制內(nèi)容到剪貼板
- $online_count = $GLOBALS['db']->getOne("SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('sessions'));
PHP Code復(fù)制內(nèi)容到剪貼板
- $online_count = $GLOBALS['db']->getOne("SELECT COUNT(*) FROM " . $GLOBALS['ecs']->table('sessions'))*15;
這樣,你的ECSHOP商城顯示的在線人數(shù)就會多15倍,當(dāng)然你也可以將15改成100,這樣就會多100倍。
文章的瀏覽次數(shù)
修改數(shù)據(jù)庫結(jié)構(gòu)
進ECSHOP后臺 》 數(shù)據(jù)庫管理 》SQL查詢 ,輸入下面SQL語句
復(fù)制代碼
代碼如下:ALTER TABLE `ecs_article` ADD `click_count` INT( 10 ) NOT NULL
點擊 “提交查詢”
修改 /article.php
搜索
PHP Code復(fù)制內(nèi)容到剪貼板
- else
- {
- $smarty->display('article_pro.dwt', $cache_id);
- }
復(fù)制代碼
代碼如下:$db->query("update ".$ecs->table('article')." set click_count=click_count+1 where article_id=$article_id") ;
修改 /themes/default/article.dwt
找到
復(fù)制代碼
代碼如下:{$article.add_time}
在它后邊增加PHP代碼,如下:
復(fù)制代碼
代碼如下:/ 瀏覽次數(shù):{$article.click_count}
這種修改方法,要清除緩存或者緩存自動更新后才能體現(xiàn)出最新的瀏覽次數(shù)來,如果你想能實時顯示最新的瀏覽次數(shù),就要構(gòu)造一個INSERT函數(shù),并在模板中用 {insert name =“xxx”} 調(diào)用。
【網(wǎng)站聲明】本站除付費源碼經(jīng)過測試外,其他素材未做測試,不保證完整性,網(wǎng)站上部分源碼僅限學(xué)習(xí)交流,請勿用于商業(yè)用途。如損害你的權(quán)益請聯(lián)系客服QQ:2655101040 給予處理,謝謝支持。