資源描述:
《Ecshop 最小起訂量插件》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。
1、第一步,商品表必須有個字段??代表某個商品最小訂購數(shù)量->min_number??打開goods表??在最后字段添加一個min_number??tinyint類型默認值為0??代表沒有最小起訂量sql:altertable`goods`addcolumn`min_number`tinyint(3)UNSIGNED??DEFAULT'0'NOTNULL??after`warn_number`第二部,在后臺添加商品的時候必須有個text文本框??設(shè)置最小起訂量admin/goods.php在'warn_nu
2、mber'=>1,?代碼行后插入'min_number'=>0,?在$warn_number=isset($_POST['warn_number'])?$_POST['warn_number']:0;后添加代碼$min_number=isset($_POST['min_number'])?$_POST['min_number']:0;第三部修改添加商品sql語句修改代碼????if($is_insert){????????if($code==''){????$sql="INSERTINTO".$ecs-
3、>table('goods')."(goods_name,goods_name_style,goods_sn,".??????"cat_id,brand_id,shop_price,market_price,is_promote,promote_price,".????????"promote_start_date,promote_end_date,goods_img,goods_thumb,original_img,keywords,goods_brief,".????????"seller_note
4、,goods_weight,goods_number,warn_number,min_number,integral,give_integral,is_best,is_new,is_hot,".????????"is_on_sale,is_alone_sale,goods_desc,add_time,last_update,goods_type,rank_integral)".????????"VALUES('$_POST[goods_name]','$goods_name_style','$goods
5、_sn','$catgory_id',".????????"'$brand_id','$shop_price','$market_price','$is_promote','$promote_price',".????????"'$promote_start_date','$promote_end_date','$goods_img','$goods_thumb','$original_img',".????????"'$_POST[keywords]','$_POST[goods_brief]','$
6、_POST[seller_note]','$goods_weight','$goods_number',".????????"'$warn_number','$min_number','$_POST[integral]','$give_integral','$is_best','$is_new','$is_hot','$is_on_sale','$is_alone_sale',".????????"'$_POST[goods_desc]','".gmtime()."','".gmtime()."','$
7、goods_type','$rank_integral')";????}else{????$sql="INSERTINTO".$ecs->table('goods')."(goods_name,goods_name_style,goods_sn,".??????"cat_id,brand_id,shop_price,market_price,is_promote,promote_price,".????"promote_start_date,promote_end_date,goods_img,good
8、s_thumb,original_img,keywords,goods_brief,".????"seller_note,goods_weight,goods_number,warn_number,min_number,integral,give_integral,is_best,is_new,is_hot,is_real,".????"is_on_sale,is_alone_sale,goods_desc,add_time,last_up