存档

文章标签 ‘ecshop’

用iphone、安卓等智能手机打开ecshop可以正常显示,屏蔽wap功能

2011年9月27日 果果 294 条评论

用手机打开ecshop网店,就会被重定向到mobile文件夹,如果打开wap功能,就能看到wap版的网站。但现在智能手机横行,iphone、安卓可以跟电脑一样浏览和购物,这个wap功能就有点鸡肋。现在把它屏蔽掉

编辑index.php,注释或者删除掉以下代码

$ua = strtolower($_SERVER['HTTP_USER_AGENT']);

$uachar = "/(nokia|sony|ericsson|mot|samsung|sgh|lg|philips|panasonic|alcatel|lenovo|cldc|midp|mobile)/i";

if(($ua == '' || preg_match($uachar, $ua))&& !strpos(strtolower($_SERVER['REQUEST_URI']),'wap'))
{
    $Loaction = 'mobile/';

    if (!empty($Loaction))
    {
        ecs_header("Location: $Loaction\n");

        exit;
    }

}
分类: ecshop 标签: , ,

ecshop把搜索页面url的乱码修改为正常链接

2011年6月20日 果果 686 条评论

由于要在Google Analytics里面跟踪用户搜索,但ecshop的搜索url都是转义过的一些乱码,修改search.php使用原本的搜索链接
有兴趣能力的朋友还可以直接做成伪静态,参考文章
http://www.phpsir.com/tag/ecshop-search-%E6%90%9C%E7%B4%A2

我这里不做伪静态,只需要修改search.php即可
注释掉search.php行18-行66
然后加入

1
2
3
$string["keywords"]=addslashes($_GET["keywords"]);
$string["page"]=addslashes($_GET["page"]);
$string["search_encode_time"] = $_SERVER["REQUEST_TIME"];

为ecshop模板添加属性组合搜索~

2011年5月3日 果果 1,551 条评论

可以在分类页面根据商品属性进行筛选,打开模板category.dwt,在合适位置添加以下代码

<!--组合搜索 开始-->
<!--{/foreach}-->
</div>
</div
<div></div
<!-- {/if} --
<!--组合搜索 结束-->
<!--组合搜索 开始--> <!--{if $brands.1 || $price_grade.1 || $filter_attr_list}--> <div class="box"> <div class="box_1"> <h3><span>{$lang.goods_filter}</span></h3> <!--{if $brands.1}--> <div class="screeBox"> <strong>{$lang.brand}:</strong> <!--{foreach from=$brands item=brand}--> <!-- {if $brand.selected} --> <span>{$brand.brand_name}</span> <!-- {else} --> <a href="{$brand.url}">{$brand.brand_name}</a>&nbsp; <!-- {/if} --> <!--{/foreach}--> </div> <!--{/if}--> <!--{if $price_grade.1}--> <div class="screeBox"> <strong>{$lang.price}:</strong> <!--{foreach from=$price_grade item=grade}--> <!-- {if $grade.selected} --> <span>{$grade.price_range}</span> <!-- {else} --> <a href="{$grade.url}">{$grade.price_range}</a>&nbsp; <!-- {/if} --> <!--{/foreach}--> </div> <!--{/if}--> <!--{foreach from=$filter_attr_list item=filter_attr}--> <div class="screeBox"> <strong>{$filter_attr.filter_attr_name|escape:html} :</strong> <!--{foreach from=$filter_attr.attr_list item=attr}--> <!-- {if $attr.selected} --> <span>{$attr.attr_value}</span> <!-- {else} --> <a href="{$attr.url}">{$attr.attr_value}</a>&nbsp; <!-- {/if} --> <!--{/foreach}--> </div> <!--{/foreach}--> </div> </div> <div class="blank5"></div> <!-- {/if} --> <!--组合搜索 结束-->
分类: ecshop 标签:

ecshop让用户名、email均可登录

2011年4月18日 果果 28 条评论

更改了integrate.php文件里面的login()函数为:


function login($username, $password, $remember = null)
{
if(is_email($username))
{
$sql = "select ".$this->field_name." from ".$this->table($this->user_table)." where ".$this->field_email."='".$username."'";
$username = $this->db->getOne($sql);
if(!$username) return false;
//echo $sql;exit;
}
if ($this->check_user($username, $password) > 0)
{
if ($this->need_sync)
{
$this->sync($username,$password);
}
$this->set_session($username);
$this->set_cookie($username, $remember);
return true;
}
else
{
return false;
}
}
分类: ecshop 标签:

如何删除mysql表中指定行之后的数据

2011年4月15日 果果 20 条评论

如何删除mysql表中指定行之后的数据

因为不懂mysql命令,要删除ecshop表里的一些无用数据折腾了很久,mark一下

我要删除student表中sno字段前四位为0212的数据,命令如下

delete from 'student' where left('sno',4) = '0212'

我要删除student表中年龄age字段小于18岁的数据,命令如下

delete from 'student' where 'age' < '18'
分类: ecshop 标签: ,

Ecshop去掉分类名20个字符限制

2011年3月13日 果果 11 条评论

Ecshop去掉分类名20个字符限制,其实很简单

打开 /admin/templates/category_info.htm 文件
将 maxlength=”20″ 删掉就可以了

分类: ecshop 标签:

Ecshop商品分类页实现自定义Title

2011年3月13日 果果 1,520 条评论

第1步、
修改 ecs_category 数据表的结构,新加一个字段
进入 后台 》数据库管理》SQL查询,执行下面SQL语句

ALTER TABLE `ecs_category` ADD `cat_title` VARCHAR( 255 ) NOT NULL AFTER `cat_desc` ;

第2步、
打开后台模板文件 admin/templates/category_info.htm (最好使用EDITPLUS打开)
找到下面代码

<tr>
<td>{$lang.keywords}:</td>
<td><input type=”text” name=”keywords” value=’{$cat_info.keywords}’ size=”50″>
</td>
</tr>

在它上面增加

<tr>
<td>自定义TITLE:</td>
<td>
<input type=”text” name=”cat_title” value=’{$cat_info.cat_title}’ size=”50″>
</td>
</tr>

第3步、
继续打开文件 admin/category.php
查找下面代码

$cat['cat_desc']     = !empty($_POST['cat_desc'])     ? $_POST['cat_desc']           : ”;

总共能找到两处,在每处的后边添加代码

$cat['cat_title']     = !empty($_POST['cat_title'])     ? $_POST['cat_title']           : ”;

第4步、
下面来修改前台程序文件 /category.php
找到

return $GLOBALS['db']->getRow(’SELECT cat_name, keywords, cat_desc, style, grade, filter_attr, parent_id FROM ‘ . $GLOBALS['ecs']->table(’category’) .

将之修改为

return $GLOBALS['db']->getRow(’SELECT cat_name, cat_title, keywords, cat_desc, style, grade, filter_attr, parent_id FROM ‘ . $GLOBALS['ecs']->table(’category’) .

第5步、
继续找到

$smarty->assign(’page_title’,       $position['title']);

将之修改为

$smarty->assign(’page_title’,       $cat['cat_title']);

使用方法:进入 后台 》商品管理 》商品分类,编辑某个分类即可。

分类: ecshop 标签: ,

ecshop发货时不考虑库存

2010年11月10日 果果 949 条评论

打开includes/lib_order.php,找到“商品购买数量”,将下面这部分注释掉

 if ($num > $goods['goods_number'])
        {
            $GLOBALS['err']->add(sprintf($GLOBALS['_LANG']['shortage'], $goods['goods_number']), ERR_OUT_OF_STOCK);

            return false;
        }
分类: ecshop 标签: ,

在ecshop中添加adwords转换跟踪代码

2010年8月20日 果果 46 条评论

转换是adwords优化很重要的参考数据,是比较准确的ROI数据来源,做adwords的各位不妨一试

你可以在adwords中设置转换跟踪,得到代码,对照做一下修改添加在模板目录flow.dwt的body标签内即可。

<!-- {if $step eq "done"} 订单提交成功-->
<!-- Google Code for order Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 1028991713;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "BHskCPzL4AEQ1NXU6gM";
var google_conversion_value = 0;
if (100) {
  google_conversion_value = 100;
}
/* ]]> */
</script>
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/1028991700/?value=100&amp;label=BHskCPzL4AEQ1NXU6gM&amp;guid=ON&amp;script=0"/>
</div>
</noscript>
<!-- {/if} -->

为ECSHOP后台添加通过快递单号搜索订单的功能

2010年8月15日 果果 10 条评论

RT,需要修改admin/order.php,admin/templates/order_list.htm两个文件

1,修改admin/order.php添加代码:

搜索“过滤信息”,在后面添加

$filter['invoice_no'] = empty($_REQUEST['invoice_no']) ? '' : trim($_REQUEST['invoice_no']);

找到

if ($filter['address'])
        {
            $where .= " AND o.address LIKE '%" . mysql_like_quote($filter['address']) . "%'";
        }

在后面添加:

if ($filter['invoice_no'])
        {
            $where .= " AND o.invoice_no LIKE '%" . mysql_like_quote($filter['invoice_no']) . "%'";
        }

2,修改后台模板文件:第八行{$lang.order_sn}下添加

发货单号<input name="invoice_no" type="text" id="invoice_no" size="15">

在搜索订单部分,listTable.filter['consignee']下添加一行

listTable.filter['invoice_no'] = Utils.trim(document.forms['searchForm'].elements['invoice_no'].value);

修改完成后就可以在订单列表也看到快递单搜索框了,注意备份源文件

分类: ecshop 标签: