您现在的位置是:首页 > cms教程 > Ecshop商城教程Ecshop商城教程
ecshop二次开发教程开发手册详解
语芙2024-03-15Ecshop商城教程已有人查阅
导读ecshop文件结构名称手册ecshop开发手册,ecshop使用手册,ECSHOP数据库结构参数表1:如何统计ecshop商品在订单中出现的次数
ecshop文件结构名称手册ecshop开发手册,ecshop使用手册,ECSHOP数据库结构参数表
1:如何统计ecshop商品在订单中出现的次数
回答:
回答:
3:如何用js去验证手机号码.
回答:
回答:local_mktime(0,0,0,date("m"),0,date("Y"));使用ecshop的local_mktime函 数.
5:ecshop如何直接关闭窗口而不弹出提示
回答:
6:如何统计ecshop某商品下被审核过的评论数量。
回答:
回答:
回答:
回答:
回答:utf下面
回答:ecshop的goods.php
回答:Fatal error: Cannot redeclare,意思是你运行的程序中,某函数重新申明了两次,要删除其中一个同名函数.
14:ecshop如何判断是否当天登陆,并赠送积分.
回答:
回答:
回答:
回答:类似以下代码
1:如何统计ecshop商品在订单中出现的次数
回答:
$count = $db -> getOne("select sum(goods_number) from ".$ecs->table('order_goods')." where goods_id = '$goods[goods_id]'");
2:ecshop详细页面如何通过onclick点击事件来控制购买,特别用在批发,批发存在一个很小购买量控制.回答:
3:如何用js去验证手机号码.
回答:
var reg =/^[1]([3][0-9]{1}|50|53|59|58|56|86|80|89|87|88|85|86|55|51|52|57)[0-9]{8}$/;
4:ecshop中如何取得每个月的1号时间?回答:local_mktime(0,0,0,date("m"),0,date("Y"));使用ecshop的local_mktime函 数.
5:ecshop如何直接关闭窗口而不弹出提示
回答:
6:如何统计ecshop某商品下被审核过的评论数量。
回答:
$ccount = $db -> getOne("select count(*) cc from ".$ecs->table('comment')." where id_value = '$goods_id' and comment_type = '0' and status = '1' and parent_id = '0'");
7:ecshop中js如何将时间格式互转回答:
date1 = new Date();
var b = Date.UTC(date1.getYear(),date1.getMonth()+1,date1.getDate(),0,0,0)
time1 = frm.elements['best_time'].value;
y = time1.substring(0,4);
m = time1.substring(5,7);
d = time1.substring(8,10);
var b2 = Date.UTC(y,m,d,0,0,0)
8:如何解析ecshop flash的xml回答:
$str = @file_get_contents("data/flash_data.xml");
if($str){
preg_match_all("/item_url=\"(.*?)\"/",$str,$url);
preg_match_all("/text=\"(.*?)\"/",$str,$text);
preg_match_all("/link=\"(.*?)\"/",$str,$link);
$ar_flash = array();
if(sizeof($url[1])){
for($i=0;$i $ar_flash[$i]['url'] = $url[1][$i];
$ar_flash[$i]['text'] = $text[1][$i];
$ar_flash[$i]['link'] = $link[1][$i];
}
$smarty->assign('ar_flash',$ar_flash);
}
}
9:ecshop中如何正则提取中文回答:
preg_match("/[".chr(0xa1)."-".chr(0xff)."]+/",ecs_iconv("UTF-8","GBK",$v['brand_name']),$cn);
10:ecshop如何取得订单中所属区域
$p = $GLOBALS['db']->getOne("select region_name from ".$GLOBALS['ecs']->table('region')." where region_id = '".$re1['province']."'");
$c = $GLOBALS['db']->getOne("select region_name from ".$GLOBALS['ecs']->table('region')." where region_id = '".$re1['city']."'");
$d = $GLOBALS['db']->getOne("select region_name from ".$GLOBALS['ecs']->table('region')." where region_id = '".$re1['district']."'");
11:ecshop中如何分别提取中文和英文回答:utf下面
$pregstr = "/[\x{4e00}-\x{9fa5}]+/u";
preg_match($pregstr,$v['brand_name'],$ch);
gbk下面
$strtest = “yyg中文字符yyg”;
$pregstr = "/([".chr(0xb0)."-".chr(0xf7)."][".chr(0xa1)."-".chr(0xfe)."])+/i";
if(preg_match($pregstr,$strtest,$matchArray)){
echo $matchArray[0];
}
12:如何控制ecshop商品总价格只有ecshop会员特殊等级才能查看回答:ecshop的goods.php
$is_spe = $GLOBALS['db'] -> getOne("select special_rank from ".$GLOBALS['ecs']->table('user_rank')." where rank_id = '".$_SESSION['user_rank']."'");
if($is_spe){
$res['result'] = price_format($shop_price * $number);
}else{
$string = "请联系客服";
$res['result'] = $string;
}
13:调试ecshop程序出现以下错误Fatal error: Cannot redeclare是什么意思?回答:Fatal error: Cannot redeclare,意思是你运行的程序中,某函数重新申明了两次,要删除其中一个同名函数.
14:ecshop如何判断是否当天登陆,并赠送积分.
回答:
/* 赠送积分 */
$day = local_mktime(0,0,0,date("m"),date("d"),date("Y"));
$last_time = $db -> getOne("select last_login from ".$ecs->table('users')." where user_name = '".$username."'");
if($last_time < $day){
log_account_change($_SESSION['user_id'], 0, 0, 0, 10, '每天登陆送积分', ACT_OTHER);
}
15:如何在ecshop订单列表中列表出订单中所包含的商品编号.回答:
function get_user_orders($user_id, $num = 10, $start = 0)
{
/* 取得订单列表 */
$arr = array();
global $ecs;
global $db;
$sql = "SELECT order_id, order_sn, order_status,consignee, shipping_status, pay_status, add_time, " .
"(goods_amount + shipping_fee + insure_fee + pay_fee + pack_fee + card_fee + tax - discount) AS total_fee ".
" FROM " .$GLOBALS['ecs']->table('order_info') .
" WHERE user_id = '$user_id' ORDER BY add_time DESC";
$res = $GLOBALS['db']->SelectLimit($sql, $num, $start);
while ($row = $GLOBALS['db']->fetchRow($res))
{
if ($row['order_status'] == OS_UNCONFIRMED)
{
$row['handler'] = "".$GLOBALS['_LANG']['cancel']."";
}
else if ($row['order_status'] == OS_SPLITED)
{
/* 对配送状态的处理 */
if ($row['shipping_status'] == SS_SHIPPED)
{
@$row['handler'] = "".$GLOBALS['_LANG']['received']."";
}
elseif ($row['shipping_status'] == SS_RECEIVED)
{
@$row['handler'] = ''.$GLOBALS['_LANG']['ss_received'] .'';
}
else
{
if ($row['pay_status'] == PS_UNPAYED)
{
@$row['handler'] = "<a href=\"user.php?act=order_detail&order_id=" .$row['order_id']. '">' .$GLOBALS['_LANG']['pay_money']. '';
}
else
{
@$row['handler'] = "<a href=\"user.php?act=order_detail&order_id=" .$row['order_id']. '">' .$GLOBALS['_LANG']['view_order']. '';
}
}
}
else
{
$row['handler'] = ''.$GLOBALS['_LANG']['os'][$row['order_status']] .'';
}
$row2 = $db -> getAll("select goods_id ,goods_sn from ".$ecs->table('order_goods')." where order_id = '".$row['order_id']."'");
$row['shipping_status'] = ($row['shipping_status'] == SS_SHIPPED_ING) ? SS_PREPARING : $row['shipping_status'];
$row['order_status'] = $GLOBALS['_LANG']['os'][$row['order_status']] . ',' . $GLOBALS['_LANG']['ps'][$row['pay_status']] . ',' . $GLOBALS['_LANG']['ss'][$row['shipping_status']];
$arr[] = array('order_id' => $row['order_id'],
'order_sn' => $row['order_sn'],
'order_time' => local_date($GLOBALS['_CFG']['time_format'], $row['add_time']),
'order_status' => $row['order_status'],
'consignee' => $row['consignee'],
'total_fee' => price_format($row['total_fee'], false),
'goodslist' => $row2,
'handler' => $row['handler']);
}
return $arr;
}
16:如何取得ecshop会员一天内的评论条数回答:
function get_day_count_comment($user_id = ''){
global $db;
global $ecs;
$pre = local_mktime(0,0,0,date("m"),date("d"),date("y"));
$next = local_mktime(0,0,0,date("m"),date("d")+2,date("y"));
$count = $db -> getOne("select count(*) from ".$ecs->table('comment')." where user_id = '$user_id' and add_time > '$pre' and add_time < '$next' ");
if($count > 5){
return false;
}else{
return true;
}
}
17:ecshop中js是如何验证radio选择.回答:类似以下代码
/*
var businesstype = false;
var job_title = false;
var number_of_employees = false;
for (i = 0; i < frm.elements.length; i ++ )
{
if (frm.elements[i].name == 'businesstype' && frm.elements[i].checked)
{
businesstype = true;
}
if (frm.elements[i].name == 'job_title' && frm.elements[i].checked)
{
job_title = true;
}
if (frm.elements[i].name == 'number_of_employees' && frm.elements[i].checked)
{
number_of_employees = true;
}
if (frm.elements[i].name == 'number_of_employees' && frm.elements[i].checked)
{
number_of_employees = true;
}
}
*/
本文标签:
很赞哦! ()
相关教程
图文教程
ecshop底部帮助文章条数怎么改成显示10条
大家都知道ecshop底部的竖排帮助,是在后台文章分类,系统帮助里设置的, 行的分类名称就是后台系统帮助的分类,分类下的就是文章,但是ecshop默认的帮
ecshop实现地区运费模板代码示例
1、Ecshop后台配送方式创建2、商品绑定配送方式的运费模板2.1 数据表“ecs_goods”增加一个字段,执行下面SQL语句:2.2 后台添加/编辑 商品 调出已经安装配送方式 "adm
ecshop删除Powered by ecshop版权实例
去掉头部TITLE部分的ECSHOP演示站 Powered by ecshop 前者在后台商店设置 - 商店标题修改 后者打开includes/lib_main.php
ecshop会员登陆后可见价格,ecshop会员登陆后显示价格实例
代码号之ecshop会员登陆后可见价格会员注册会员登陆才能显示价格修改教程。ecshop会员登陆后才可以看到商品价格,商城所有商品价格默认显示文字(登陆可见)
相关源码
-
(PC+WAP)绣花刺绣传统手工工艺pbootcms网站源码下载这款基于PbootCMS的网站模板为刺绣和传统手工艺行业设计,采用优雅的布局和精致的细节处理,能够呈现手工艺品的独特韵味和文化内涵。模板结构合理,功能完善,是手工艺从业者展示作品的理想选择。查看源码 -
响应式帝国cms7.5NBA黑色体育资讯模板下载本模板为体育新闻媒体、报道机构设计,采用帝国CMS7.5内核开发,具备完整的资讯发布、体育日历、数据展示功能。响应式布局确保在手机端呈现实时资讯和图文内容查看源码 -
(自适应响应式)英文外贸医疗科研耗材设备pbootcms网站模板为医疗设备和外贸企业设计的响应式网站模板,基于PbootCMS系统开发。突出医疗产品认证展示和国际化特性,通过专业化的产品参数展示模块和文档管理系统,满足医疗行业严格的信息披露要求。查看源码 -
(PC+WAP)蓝色新能源环保太阳能光伏模板pbootcms下载新能源环保行业网站解决方案为太阳能光伏系统企业打造的专业网站模板,助力新能源企业高效展示产品与服务PbootCMS内核开发,源码开放可修改PC与手机端自适应设计查看源码 -
(自适应响应式)超市仓储仓库货架展架网站pbootcms源码下载本模板为货架展架、仓储货架行业量身打造,采用PbootCMS内核开发,充分考虑了货架产品展示和企业形象展示的需求。模板设计简洁大方,突出产品特点,能够有效展示各类货架产品的规格参数和应用场景,帮助访客快速了解企业核心业务和产品优势。查看源码 -
(自适应响应式)pbootcms紫色美容整形机构企业模板下载基于PbootCMS内核开发的响应式网站模板,为医疗美容机构、整形医院等企业设计,提供完整的线上展示平台采用紫色系配色方案,整体风格专业大气。模板包含首页轮播、服务项目、专家团队、案例展示等核心模块,能够充分展示医疗美容机构的专业服务和特色优势。查看源码
| 分享笔记 (共有 篇笔记) |
