公司網(wǎng)絡(luò)互聯(lián)商城畢業(yè)設(shè)計(jì)說明書_第1頁
公司網(wǎng)絡(luò)互聯(lián)商城畢業(yè)設(shè)計(jì)說明書_第2頁
公司網(wǎng)絡(luò)互聯(lián)商城畢業(yè)設(shè)計(jì)說明書_第3頁
公司網(wǎng)絡(luò)互聯(lián)商城畢業(yè)設(shè)計(jì)說明書_第4頁
公司網(wǎng)絡(luò)互聯(lián)商城畢業(yè)設(shè)計(jì)說明書_第5頁
已閱讀5頁,還剩38頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

文檔可自由編輯打印43/43文檔可自由編輯打印文檔可自由編輯打印22公司網(wǎng)絡(luò)互聯(lián)商城(信息科技系網(wǎng)絡(luò)技術(shù)專業(yè)2班)TOC\o"1-1"\h\z\u1_ECSHOP去版權(quán)與標(biāo)志 12_后臺(tái)開發(fā)—為訂單增加備注功能 53_將訂單狀態(tài)設(shè)為等待客戶確認(rèn) 94_商品擴(kuò)展名功能開發(fā) 105_多貨幣解決方案的開發(fā) 136_AJAX實(shí)現(xiàn)購物車數(shù)量功能開發(fā) 207_AJAX實(shí)現(xiàn)產(chǎn)品頁的購買數(shù)量 238_商品展示放大鏡效果 249_產(chǎn)品頁的顏色選擇器功能開發(fā) 40 1_ECSHOP去版權(quán)與標(biāo)志摘要:1:去掉頭部TITLE部分的ECSHOP演示站Poweredbyecshop2.去掉友情鏈接部分3.去掉底部的Poweredbyecshopv2.7.01.去除兩張圖片2.右上角的“關(guān)于ECSHOP”3.中部ECSHOP管理中心,和底部的版權(quán)所有關(guān)鍵字:去除ecshop系統(tǒng)默認(rèn)版權(quán);去除默認(rèn)圖標(biāo)前臺(tái)部分:1:去掉頭部TITLE部分的ECSHOP演示站Poweredbyecshop前者在后臺(tái)商店設(shè)置-商店標(biāo)題修改后者打開includes/lib_main.php$page_title=$GLOBALS['_CFG']['shop_title'].'-'.'PoweredbyECShop';修改這里的'PoweredbyECShop2.去掉友情鏈接部分在后臺(tái)的友情鏈接管理里修改3.去掉底部的Poweredbyecshopv2打開js/common.js

刪除第244行:onload=function()第244行函數(shù)如下:

onload=function()

{

varlink_arr=document.getElementsByTagName(String.fromCharCode(65));

varlink_str;

varlink_text;

varregg,cc;

varrmd,rmd_s,rmd_e,link_eorr=0;

vare=newArray(97,98,99,

100,101,102,103,104,105,106,107,108,109,

110,111,112,113,114,115,116,117,118,119,

120,121,122

);

try

{

for(vari=0;i<link_arr.length;i++)

{

link_str=link_arr.href;

if(link_str.indexOf(String.fromCharCode(e[22],119,119,46,e[4],99,e[18],e[7],e[14],

e[15],46,99,111,e[12]))!=-1)

{

if((link_text=link_arr.innerText)==undefined)

{

throw"noIE";

}

regg=newRegExp(String.fromCharCode(80,111,119,101,114,101,100,46,42,98,121,46,42,69,67,83,e[7],e[14],e[15]));

if((cc=regg.exec(link_text))!=null)

{

if(link_arr.offsetHeight==0)

{

break;

}

link_eorr=1;

break;

}

}

else

{

link_eorr=link_eorr?0:link_eorr;

continue;

}

}

}//IE

catch(exc)

{

for(vari=0;i<link_arr.length;i++)

{

link_str=link_arr.href;

if(link_str.indexOf(String.fromCharCode(e[22],119,119,46,e[4],99,115,104,e[14],

e[15],46,99,111,e[12]))!=-1)

{

link_text=link_arr.textContent;

regg=newRegExp(String.fromCharCode(80,111,119,101,114,101,100,46,42,98,121,46,42,69,67,83,e[7],e[14],e[15]));

if((cc=regg.exec(link_text))!=null)

{

if(link_arr.offsetHeight==0)

{

break;

}

link_eorr=1;

break;

}

}

else

{

link_eorr=link_eorr?0:link_eorr;

continue;

}

}

}//FF

try

{

rmd=Math.random();

rmd_s=Math.floor(rmd*10);

if(link_eorr!=1)

{

rmd_e=i-rmd_s;

link_arr[rmd_e].href=String.fromCharCode(104,116,116,112,58,47,47,119,119,119,46,

101,99,115,104,111,112,46,99,111,109);

link_arr[rmd_e].innerHTML=String.fromCharCode(

80,111,119,101,114,101,100,38,110,98,115,112,59,98,

121,38,110,98,115,112,59,60,115,116,114,111,110,103,

62,60,115,112,97,110,32,115,116,121,108,101,61,34,99,

111,108,111,114,58,32,35,51,51,54,54,70,70,34,62,

69,67,83,104,111,112,60,47,115,112,97,110,62,60,47,

115,116,114,111,110,103,62);

}

}

catch(ex)

{

}

}再打開模板文件夾的library/page_footer.lbi刪除{foreachfrom=$lang.p_yitem=pv}{$pv}{/foreach}{$licensed}3、很多頁面源代碼的頭部信息中會(huì)自動(dòng)產(chǎn)生一行代碼

<metaname="Generator"content="ECSHOPv2.7.1"/>

應(yīng)該也算是ECSHOP預(yù)留的版權(quán)信息吧,下面講一下怎么刪除這行代碼,讓系統(tǒng)不再自動(dòng)產(chǎn)生。

打開includes/cls_template.php文件,

大概在1087行左右,找到

$source=preg_replace('/<head>/i',"<head>\r\n<metaname=\"Generator\"content=\"".APPNAME.''.VERSION."\"/>",$source);

將之刪除或者注釋掉即可。

后臺(tái)部分:1.去除兩張圖片admin/images/ecshop_logo.gifadmin/images/login.png2.右上角的“關(guān)于ECSHOP”打開admin/templates/top.htm刪除:<li><ahref="index.php?act=about_us"target="main-frame">{$lang.about}</a></li>3.中部ECSHOP管理中心,和底部的版權(quán)所有打開language/zh_cn/admin/common.php修改$_LANG['cp_home']='ECSHOP管理中心';

$_LANG['copyright']='版權(quán)所有©2005-2009上海商派網(wǎng)絡(luò)科技有限公司,并保留所有權(quán)利。';2_后臺(tái)開發(fā)—為訂單增加備注功能摘要:1.添加表:ecs_order_note;2.添加語言包--languages\zh_cn\admin\order.php3.修改admin/order.php文件第103行,添加代碼:4.在以下代碼下加入5.修改admin\templates\order_info.htm文件關(guān)鍵字:訂單備注;添加訂單;備注功能ECSHOP后臺(tái)為訂單增加備注功能添加表:ecs_order_note;CREATETABLEIFNOTEXISTS`ecs_order_note`(`note_id`mediumint(8)unsignedNOTNULLAUTO_INCREMENT,`order_id`mediumint(8)unsignedNOTNULL,`note_value`textNOTNULL,PRIMARYKEY(`note_id`))ENGINE=MyISAMDEFAULTCHARSET=utf8AUTO_INCREMENT=1;2.添加語言包--languages\zh_cn\admin\order.php/*訂單備注*/$_LANG['label_order_note']='客服人員訂單備注:';3.修改admin/order.php文件第103行,添加代碼:/**///--保存訂單備注/**/elseif($_REQUEST['act']=='save_ordernote'){$oid=$_REQUEST['oid'];$oval=$_REQUEST['noteVal'];$sql="selectcount(note_value)from".$ecs->table('order_note')."whereorder_id=$oid";$note_count=$db->getOne($sql);if($note_count==0){$sql="insertinto".$ecs->table('order_note')."(order_id,note_value)values(".$oid.",'".$oval."')";}else{$sql="update".$ecs->table('order_note')."setnote_value='".$oval."'whereorder_id=".$oid;}$db->query($sql);//echo"訂單備注已保存!";}4.在以下代碼下加入/*取得能執(zhí)行的操作列表*/$operable_list=operable_list($order);$smarty->assign('operable_list',$operable_list);/*取得訂單備注--*/$sql="SELECTnote_valueFROM".$ecs->table('order_note')."WHEREorder_id='$order[order_id]'";$order_note=$db->getOne($sql);$smarty->assign('order_note',$order_note);5.修改admin\templates\order_info.htm文件,<tr><td><divalign="right"><strong>{$lang.label_action_note}</strong></div></td><tdcolspan="5"><textareaname="action_note"cols="80"rows="3"></textarea></td></tr><tr>在上面代碼后面加入以下代碼:<tr><td><divalign="right"><strong>{$lang.label_order_note}</strong></div></td><tdcolspan="5"><textareaname="order_note"cols="80"rows="3"onblur="saveOrderNote({$smarty.request.order_id},this)">{$order_note}</textarea></td></tr>在本文件admin\templates\order_info.htm的JS代碼中加入下面內(nèi)容/***保存訂單備注*/functionsaveOrderNote(oid,parm){varnoteVal=parm.value;Ajax.call('order.php?is_ajax=1&act=save_ordernote&oid='+oid+'¬eVal='+noteVal,'',saveOrderResponse,'POST','');}functionsaveOrderResponse(result){//alert(result);}刪除訂單時(shí)刪除關(guān)聯(lián)的訂單備注admin/order.php找到下面代碼:/*刪除訂單*/$db->query("DELETEFROM".$ecs->table('order_info')."WHEREorder_id='$order_id'");$db->query("DELETEFROM".$ecs->table('order_goods')."WHEREorder_id='$order_id'");$db->query("DELETEFROM".$ecs->table('order_action')."WHEREorder_id='$order_id'");在后面直接加入以下代碼:(單個(gè)刪除) /*根據(jù)訂單編號(hào),刪除對(duì)應(yīng)訂單備注*/ $db->query("DELETEFROM".$ecs->table('order_note')."WHEREorder_id='$order_id'");批量刪除,找到以下代碼:約3000行后面/*刪除訂單*/$db->query("DELETEFROM".$ecs->table('order_info')."WHEREorder_id='$order[order_id]'");$db->query("DELETEFROM".$ecs->table('order_goods')."WHEREorder_id='$order[order_id]'");$db->query("DELETEFROM".$ecs->table('order_action')."WHEREorder_id='$order[order_id]'");直接加入以下代碼: /*根據(jù)訂單編號(hào),刪除對(duì)應(yīng)訂單備注(批量刪除)*/ $db->query("DELETEFROM".$ecs->table('order_note')."WHEREorder_id='$order[order_id]'");在以下代碼$GLOBALS['db']->query("DELETEFROM".$GLOBALS['ecs']->table('order_info')."WHEREorder_id='$order_id'");$GLOBALS['db']->query("DELETEFROM".$GLOBALS['ecs']->table('order_goods')."WHEREorder_id='$order_id'");$GLOBALS['db']->query("DELETEFROM".$GLOBALS['ecs']->table('order_action')."WHEREorder_id='$order_id'");后面加入以下代碼/*根據(jù)訂單編號(hào),刪除對(duì)應(yīng)訂單備注*/ $GLOBALS['db']->query("DELETEFROM".$GLOBALS['ecs']->table('order_note')."WHEREorder_id='$order_id'");3_將訂單狀態(tài)設(shè)為等待客戶確認(rèn)摘要:1.修改\includes\lib_payment.php文件,使網(wǎng)上支付成功后,訂單狀態(tài)為等待客戶確認(rèn).2.修改根目錄下的flow.php文件,使用余額付款時(shí)訂單狀態(tài)為等客服確認(rèn),只需把//$order['order_status']=OS_CONFIRMED;注解掉,或都改為$order['order_status']=OS_UNCONFIRMED;3.修改Admin\order.php,使操作記錄訂單狀態(tài)而非未付款有兩處:一個(gè)是批處理訂單,二是操作訂單狀態(tài)(處理提交)關(guān)鍵字:訂單狀態(tài);等待客服確認(rèn)將訂單狀態(tài)設(shè)為等待客戶確認(rèn)1.修改\includes\lib_payment.php文件,使網(wǎng)上支付成功后,訂單狀態(tài)為等待客戶確認(rèn)/*修改訂單狀態(tài)為已付款*/$sql='UPDATE'.$GLOBALS['ecs']->table('order_info')."SETorder_status='".OS_CONFIRMED."',"."confirm_time='".gmtime()."',"."pay_status='$pay_status',"."pay_time='".gmtime()."',"."money_paid=order_amount,"."order_amount=0"."WHEREorder_id='$order_id'";$GLOBALS['db']->query($sql);/*記錄訂單操作記錄*/order_action($order_sn,OS_CONFIRMED,SS_UNSHIPPED,$pay_status,$note,$GLOBALS['_LANG']['buyer']);修改為:/*修改訂單狀態(tài)為已付款*/$sql='UPDATE'.$GLOBALS['ecs']->table('order_info')."SETorder_status='".OS_UNCONFIRMED."',"."confirm_time='".gmtime()."',"."pay_status='$pay_status',"."pay_time='".gmtime()."',"."money_paid=order_amount,"."order_amount=0"."WHEREorder_id='$order_id'";$GLOBALS['db']->query($sql);/*記錄訂單操作記錄*/order_action($order_sn,OS_UNCONFIRMED,SS_UNSHIPPED,$pay_status,$note,$GLOBALS['_LANG']['buyer']);2.修改根目錄下的flow.php文件,使用余額付款時(shí)訂單狀態(tài)為等客服確認(rèn),只需把//$order['order_status']=OS_CONFIRMED;注解掉,或都改為$order['order_status']=OS_UNCONFIRMED;/*如果訂單金額為0(使用余額或積分或紅包支付),修改訂單狀態(tài)為已確認(rèn)、已付款*/if($order['order_amount']<=0){$order['order_status']=OS_UNCONFIRMED;//余額付款時(shí)訂單狀態(tài)為等客服確認(rèn)$order['confirm_time']=gmtime();$order['pay_status']=PS_PAYED;$order['pay_time']=gmtime();$order['order_amount']=0;}3.修改Admin\order.php,使操作記錄訂單狀態(tài)而非未付款有兩處:一個(gè)是批處理訂單,二是操作訂單狀態(tài)(處理提交)order_action($order['order_sn'],OS_CONFIRMED,SS_UNSHIPPED,PS_UNPAYED,$action_note);改為:order_action($order['order_sn'],OS_CONFIRMED,SS_UNSHIPPED,$order['pay_status'],$action_note);/*todo處理退款*/order_action($order['order_sn'],OS_CONFIRMED,SS_UNSHIPPED,PS_UNPAYED,$action_note);這個(gè)不修改修改languages\zh_cn\Admin\order.php/*訂單狀態(tài)*/$_LANG['os'][OS_UNCONFIRMED]='未確認(rèn)';改為:$_LANG['os'][OS_UNCONFIRMED]='等待客服確認(rèn)';languages\zh_cn\Admin\user.php把$_LANG['os'][OS_UNCONFIRMED]='未確認(rèn)';改為:/*訂單狀態(tài)*/$_LANG['os'][OS_UNCONFIRMED]='等待客服確認(rèn)';4_商品擴(kuò)展名功能開發(fā)摘要:1.打開數(shù)據(jù)庫,在ecs_goods表里面執(zhí)行sql2.打開admin\templates\Goods_list.htm3.打開admin\templates\Goods_list.htm4.打開admin\templates\Goods_list.htm5.打開/languages/zh_cn/admin/goods.php6.打開admin\includes\lib_goods.php7.打開admin\templates\goods_info.htm8.打開admin\goods.php9.打開goods.dwt關(guān)鍵字:商品擴(kuò)展;擴(kuò)展名功能1、打開數(shù)據(jù)庫,在ecs_goods表里面執(zhí)行sqlALTERTABLE`ecs_goods`ADD`goods_name_extends`VARCHAR(80)NOTNULLAFTER`goods_name`2、打開admin\templates\Goods_list.htm<th><ahref="javascript:listTable.sort('goods_name');">{$lang.goods_name}</a>{$sort_goods_name}</th>在下面添加<th><ahref="javascript:listTable.sort('goods_name_extends');">{$lang.goods_name_extends}</a>{$sort_goods_name_extends}</th>3、<tdclass="first-cell"style="{if$goods.is_promote}color:red;{/if}"><spanonclick="listTable.edit(this,'edit_goods_name',{$goods.goods_id})"{$goods.goods_name|escape:html}</span></td>在后面添加<tdclass="first-cell"style="{if$goods.is_promote}color:red;{/if}"><span

id="goods_extends"onclick="listTable.edit_teshu(this,

'edit_goods_name_extends',{$goods.goods_id})">

{$goods.goods_name_extends|escape:html} </span></td>4、<tdclass="first-cell"style="{if$goods.is_promote}color:red;{/if}"><spanonclick="listTable.edit(this,'edit_goods_name',{$goods.goods_id})"{$goods.goods_name|escape:html}</span></td>在這句后面添加以下代碼<tdclass="first-cell"style="{if$goods.is_promote}color:red;{/if}"><spanid="goods_extends"onclick="listTable.edit_teshu(this,'edit_goods_name_extends',{$goods.goods_id})">{$goods.goods_name_extends|escape:html} </span></td>5、打開/languages/zh_cn/admin/goods.php68行$_LANG['goods_name']='商品名稱';下面增加$_LANG['goods_name_extends']='商品名稱擴(kuò)展';在108行$_LANG['lab_goods_name']='商品名稱:';下面增加$_LANG['lab_goods_name_extends']='商品名稱擴(kuò)展:';6、打開admin\includes\lib_goods.php/*分頁大小*/$filter=page_and_size($filter);$sql="SELECTgoods_id,goods_name,緊跟在后面添加goods_name_extends,7、打開admin\templates\goods_info.htm<tr><tdclass="label">{$lang.lab_goods_name}</td><td><inputtype="text"name="goods_name"value="{$goods.goods_name|escape}"style="float:left;color:{$goods_name_color};"size="30"/><divstyle="background-color:{$goods_name_color};float:left;margin-left:2px;"id="font_color"onclick="ColorSelecter.Show(this);"><imgsrc="images/color_selecter.gif"style="margin-top:-1px;"/></div><inputtype="hidden"id="goods_name_color"name="goods_name_color"value="{$goods_name_color}"/> <selectname="goods_name_style"><optionvalue="">{$lang.select_font}</option>{html_optionsoptions=$lang.font_stylesselected=$goods_name_style}</select>{$lang.require_field}</td></tr>下面添加<tr><tdclass="label">{$lang.lab_goods_name_extends}</td><td><inputtype="text"name="goods_name_extends"value="{$goods.goods_name_extends|escape}"style="float:left;color:{$goods_name_color};"size="30"/></td></tr>8、打開admin\goods.php在872行"goods_name='$_POST[goods_name]',".下面添加"goods_name_extends='$_POST[goods_name_extends]',".9、打開goods.dwt{$goods.goods_style_name}把它改為{$goods.goods_style_name}<fontcolor="#FF0000">{$goods.goods_name_extends}</font>5_多貨幣解決方案的開發(fā)摘要:1.在shop_config表中加入記錄2.修改\languages\zh_cn\admin\shop_config.php文件3.在網(wǎng)站模版目錄themes/當(dāng)前模板/library/page_header.lbi4.在上一行代碼后面加入以下代碼5.在includes/init.php文件最后插入以下代碼6.修改\inlucdes\lib_common.php里的price_format函數(shù)7.修改表order_info8.修改flow.php文件中9.修改\inlucdes\lib_common.php在里面新增加price_format_hs函數(shù)在\includes\modules\payment\paypal.php大約92行一個(gè)get_code函數(shù)10.在/admin/order.php文件第5046行里的select語句中加入關(guān)鍵字:多貨幣;貨幣解決方案在shop_config表中加入記錄INSERTINTO`ecs_shop_config`(`id`,`parent_id`,`code`,`type`,`store_range`,`store_dir`,`value`,`sort_order`)VALUES(NULL,'1','rate','text','','','1,0.71,0.69,6.85,1.45','1'),(NULL,'1','ybprice_format','text','','','&%s','1'),(NULL,'1','aprice_format','text','','','EUR%s','1'),(NULL,'1','cprice_format','text','','','¥%s','1'),(NULL,'1','aoprice_format','text','','','AUD%s','1');修改\languages\zh_cn\admin\shop_config.php文件$_LANG['cfg_name']['rate']='貨幣匯率';$_LANG['cfg_name']['ybprice_format']='英鎊格式';$_LANG['cfg_name']['aprice_format']='歐元格式';$_LANG['cfg_name']['cprice_format']='人民幣格式';$_LANG['cfg_name']['aoprice_format']='澳元格式';$_LANG['cfg_desc']['rate']='輸入規(guī)則按照和美元的匯率進(jìn)行輸入U(xiǎn)S,EUR,BritishPound,$_LANG['cfg_desc']['ybprice_format']='顯示英鎊格式,%s將被替換為相應(yīng)的價(jià)格';$_LANG['cfg_desc']['aprice_format']='顯示歐元格式,%s將被替換為相應(yīng)的價(jià)格';$_LANG['cfg_desc']['cprice_format']='顯示人民幣格式,%s將被替換為相應(yīng)的價(jià)格';$_LANG['cfg_desc']['aoprice_format']='顯示澳元格式,%s將被替換為相應(yīng)的價(jià)格';在網(wǎng)站模版目錄themes/當(dāng)前模板/library/page_header.lbi <ulclass="hd-my">在上一行代碼后面加入以下代碼<ahref="{$url_head}¤cy=USD">美元</a> <ahref="{$url_head}¤cy=GBP">英鎊</a> <ahref="{$url_head}¤cy=EUR">歐元</a> <ahref="{$url_head}¤cy=CNY">人民幣</a> <ahref="{$url_head}¤cy=AUD">澳元</a>在includes/init.php文件最后插入以下代碼$url_this="http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']."?id=".@$_GET['id'];$smarty->assign("url_head",$url_this);$currency=@$_GET['currency'];if($currency!=""){$_SESSION['currency']=$currency;}if($_SESSION['currency']==''){$_SESSION['currency']='USD';}修改\inlucdes\lib_common.php里的price_format函數(shù)/***格式化商品價(jià)格**@accesspublic*@paramfloat$price商品價(jià)格*@returnstring*/functionprice_format($price,$change_price=true){$currency=$_SESSION['currency'];$rate=explode(',',$GLOBALS['_CFG']['rate']);if($currency=='USD'){$price=$price*$rate[0];}if($currency=='CNY'){$price=$price*$rate[3];}if($currency=='EUR'){$price=$price*$rate[1];}if($currency=='GBP'){$price=$price*$rate[2];}if($currency=='AUD'){$price=$price*$rate[4];}if($change_price&&defined('ECS_ADMIN')===false){switch($GLOBALS['_CFG']['price_format']){case0:$price=number_format($price,2,'.','');break;case1://保留不為0的尾數(shù)$price=preg_replace('/(.*)(\\.)([0-9]*?)0+$/','\1\2\3',number_format($price,2,'.',''));if(substr($price,-1)=='.'){$price=substr($price,0,-1);}break;case2://不四舍五入,保留1位$price=substr(number_format($price,2,'.',''),0,-1);break;case3://直接取整$price=intval($price);break;case4://四舍五入,保留1位$price=number_format($price,1,'.','');break;case5://先四舍五入,不保留小數(shù)$price=round($price);break;}}else{$price=number_format($price,2,'.','');}switch($currency){case'USD':returnsprintf($GLOBALS['_CFG']['currency_format'],$price);break;case'EUR':returnsprintf($GLOBALS['_CFG']['aprice_format'],$price);break;case'GBP':returnsprintf($GLOBALS['_CFG']['ybprice_format'],$price);break;case'AUD':returnsprintf($GLOBALS['_CFG']['aoprice_format'],$price);break;case'CNY':returnsprintf($GLOBALS['_CFG']['cprice_format'],$price);break;}//returnsprintf($GLOBALS['_CFG']['currency_format'],$price);}修改表order_infoALTERTABLE`ecs_order_info`ADD`currency`VARCHAR(10)NOTNULL,ADD`new_money`DECIMAL(10,2)NOTNULL修改flow.php文件中{//分成功能關(guān)閉$parent_id=0;}$order['parent_id']=$parent_id;大約1608行左右插入以下代碼$order['currency']=$_SESSION['currency'];$order['new_money']=price_format_hs($order['order_amount']);修改\inlucdes\lib_common.php在里面新增加price_format_hs函數(shù)/***用于支付換算**@accesspublic*@paramfloat$price商品價(jià)格*@returnstring*/functionprice_format_hs($price,$change_price=true){$currency=$_SESSION['currency'];$rate=explode(',',$GLOBALS['_CFG']['rate']);if($currency=='USD'){$price=$price*$rate[0];}if($currency=='CNY'){$price=$price*$rate[3];}if($currency=='EUR'){$price=$price*$rate[1];}if($currency=='GBP'){$price=$price*$rate[2];}if($currency=='AUD'){$price=$price*$rate[4];}if($change_price&&defined('ECS_ADMIN')===false){switch($GLOBALS['_CFG']['price_format']){case0:$price=number_format($price,2,'.','');break;case1://保留不為0的尾數(shù)$price=preg_replace('/(.*)(\\.)([0-9]*?)0+$/','\1\2\3',number_format($price,2,'.',''));if(substr($price,-1)=='.'){$price=substr($price,0,-1);}break;case2://不四舍五入,保留1位$price=substr(number_format($price,2,'.',''),0,-1);break;case3://直接取整$price=intval($price);break;case4://四舍五入,保留1位$price=number_format($price,1,'.','');break;case5://先四舍五入,不保留小數(shù)$price=round($price);break;}}else{$price=number_format($price,2,'.','');}return$price;}在\includes\modules\payment\paypal.php大約92行一個(gè)get_code函數(shù),修改成下面functionget_code($order,$payment){ $paypal_currency=$_SESSION['currency'];$data_order_id=$order['log_id'];$data_amount=$order['new_money'];$data_return_url=return_url(basename(__FILE__,'.php'));$data_pay_account=$payment['paypal_account'];$currency_code=$paypal_currency;$data_notify_url=return_url(basename(__FILE__,'.php'));$cancel_return=$GLOBALS['ecs']->url();$def_url='<br/><formstyle="text-align:center;"action=""method="post"target="_blank">'.//不能省略"<inputtype='hidden'name='cmd'value='_xclick'>".//不能省略"<inputtype='hidden'name='business'value='$data_pay_account'>".//貝寶帳號(hào)"<inputtype='hidden'name='item_name'value='$order[order_sn]'>".//paymentfor"<inputtype='hidden'name='amount'value='$data_amount'>".//訂單金額"<inputtype='hidden'name='currency_code'value='$currency_code'>".//貨幣"<inputtype='hidden'name='return'value='$data_return_url'>".//付款后頁面"<inputtype='hidden'name='invoice'value='$data_order_id'>".//訂單號(hào)"<inputtype='hidden'name='charset'value='utf-8'>".//字符集"<inputtype='hidden'name='no_shipping'value='1'>".//不要求客戶提供收貨地址"<inputtype='hidden'name='no_note'value=''>".//付款說明"<inputtype='hidden'name='notify_url'value='$data_notify_url'>"."<inputtype='hidden'name='rm'value='2'>"."<inputtype='hidden'name='cancel_return'value='$cancel_return'>"."<inputtype='submit'value='".$GLOBALS['_LANG']['paypal_button']."'>".//按鈕"</form><br/>";return$def_url;}在/admin/order.php文件第5046行里的select語句中加入在SELECTo.order_id,o.order_sn,o.add_time,后面加入后面加入o.currency,o.new_money,打開/admin/templetes/order_list.htm找到<th><ahref="javascript:listTable.sort('order_amount','DESC');">{$lang.order_amount}</a>{$sort_order_amount}</th>在這句的后面加上以下代碼<th><ahref="javascript:listTable.sort('order_amount','DESC');">{$lang.order_currency}</a>{$sort_order_currency}</th><th><ahref="javascript:listTable.sort('order_amount','DESC');">{$lang.order_new_money}</a>{$sort_order_new_money}</th>找到<tdalign="right"valign="top"nowrap="nowrap">{$order.formated_order_amount}</td>在這句的后面加上以下代碼<tdalign="center"valign="top"nowrap="nowrap">{$order.currency}</td><tdalign="center"valign="top"nowrap="nowrap">{$order.new_money}</td>6_AJAX實(shí)現(xiàn)購物車數(shù)量功能開發(fā)摘要:1.修改flow.dwt2.后面修改為以下內(nèi)容,并把上面的input也就是輸入框刪掉3.把sub_one.jpg和add_one.jpg拷貝到模板目錄下的images目錄里4.把jqueyry.js復(fù)制到模板目錄的js文件里面5.修改flow.php6.修改flow_update_cart函數(shù)關(guān)鍵字:AJAX;購物車;購物數(shù)量功能1、修改flow.dwt<body>后面加入以下內(nèi)容<scripttype="text/javascript"src="js/jquery.js"></script><!--購物車--><scripttype="text/javascript">/*<![CDATA[*/var$oldValues = newArray();var changeNum = function($m,$gid){ //alert($gid); var$num = $("#num_"+$gid); var$val = parseInt($num.val()); if(isNaN($val)) {$val=1;alert("商品數(shù)量必須輸入數(shù)字"); } $oldValues['old'+$gid] = $val; if($m=='+'){ $val++ $num.val($val); }elseif($val>1&&$m=='-'){ $val-- $num.val($val); }else{ $num.val(1); returnfalse; } $num.change();}varupdateCount = function($e,$gid){ //alert('updategoods[ID:'+$gid+']'); var$count = parseInt($("#num_"+$gid).val()); if(isNaN($count)){$number=1;alert("商品數(shù)量必須輸入數(shù)字"); $num.val($val);} if($count<=0){ $count=1; $($e).val($count); returnfalse; } AS.ajax({ url : "flow.php?step=update_count" , type : 'post' , dataType: 'json' , data : {rec_id:$gid,chang_to:$count}, success : function($json){ if($json.status=='not'){ alert('庫存不夠!'); $($e).val($oldValues['old'+$gid]); }else{ var$marketprice = $("#marketprice"+$gid).val(); var$price = $("#price"+$gid).val(); var$priceNum = parseFloat($price.substr(1)); $("#priceLabel"+$gid).html('¥'+($priceNum*$count)+'元'); var$prices = $(".prices"); var$totalPrice = 0.00; var$totalmarketPrice = 0.00; $prices.each(function(){ var$price_ = parseFloat(($(this).val()).substr(1)); var$parent = $(this).parents('.gww_xg'); var$count_ = parseInt($(".gwwu_ee",$parent).val());//alert($price_); $totalPrice += $price_*$count_; }); var$marketprices = $(".marketprices"); $marketprices.each(function(){ var$marketprice_ = parseFloat(($(this).val()).substr(1)); var$parent = $(this).parents('.gww_xg'); var$count_ = parseInt($(".gwwu_ee",$parent).val()); $totalmarketPrice += $marketprice_*$count_; }); $("#totalmarketPrice").text("比市場(chǎng)價(jià)"+$marketprice.substr(0,1)+$totalmarketPrice+".00"); $("#totalPrice").text("購物金額小計(jì)"+$price.substr(0,1)+$totalPrice+".00"); $("#diffPrice").text("節(jié)省了¥"+($totalmarketPrice-$totalPrice)+"元"); } } });}/*]]>*/</script>(2)以下內(nèi)容的<!--{if$goods.goods_idgt0&&$goods.is_gifteq0&&$goods.parent_ideq0}普通商品可修改數(shù)量--><inputtype="text"name="goods_number[{$goods.rec_id}]"id="goods_number_{$goods.rec_id}"value="{$goods.goods_number}"size="4"class="inputBg"style="text-align:center"onkeydown="showdiv(this)"/><!--{else}-->{$goods.goods_number}<!--{/if}-->后面修改為以下內(nèi)容,并把上面的input也就是輸入框刪掉<imgsrc="images/sub_one.jpg"width="13"height="12"style="cursor:pointer;"onclick="changeNum('-',{$goods.rec_id});"/> <inputtype="text"name="num[{$goods.goods_id}]"id="num_{$goods.rec_id}"class="inputBg"value="{$goods.goods_number}"maxlength="4"onchange="updateCount(this,{$goods.rec_id})"/> <imgsrc="images/add_one.jpg"width="13"height="12"style="cursor:pointer;"onclick="changeNum('+',{$goods.rec_id});"/></div> <divclass="gwwu_bottom"style="display:none;">供貨緊張</div>把sub_one.jpg和add_one.jpg拷貝到模板目錄下的images目錄里把jqueyry.js復(fù)制到模板目錄的js文件里面(3)找到<tdalign="center"bgcolor="#ffffff">{$goods.subtotal}</td>修改為<tdalign="center"bgcolor="#ffffff"id="priceLabel{$goods.rec_id}">{$goods.subtotal}</td>找到<tdalign="center"

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論