1.includes/lib_goods.php 288行修改成,(红色是添加内容)
$sql = 'SELECT b.brand_name,g.goods_id,g.goods_sn, g.goods_name, g.goods_name_style, g.market_price, g.shop_price AS org_price, g.promote_price,' .
"IFNULL(mp.user_price, g.shop_price * '$_SESSION[discount]') AS shop_price, ".
"promote_start_date, promote_end_date, g.goods_brief, g.goods_thumb, g.goods_img, RAND() AS rnd " .
'FROM ' . $GLOBALS['ecs']->table('goods') . ' AS g ' .
'LEFT JOIN ' . $GLOBALS['ecs']->table('brand') . ' AS b ON b.brand_id = g.brand_id ' .
"LEFT JOIN " . $GLOBALS['ecs']->table('member_price') . " AS mp ".
"ON mp.goods_id = g.goods_id AND mp.user_rank = '$_SESSION[user_rank]'";
2..includes/lib_goods.php 中 $goods[$idx]['brief'] = $row['goods_brief'];下面添加一行
$goods[$idx]['brand_name'] = $row['brand_name'];
3.首页index.dwt中 用{$goods.brand_name}调用
效果如下。可以连品牌一起调用出来咯
Ecshop修改商品分类页的排序方式为推荐排序
正则表达式(regular expression)是一个描述字符模式的对象。使用正则表达式可以进行强大的模式匹配和文本检索与替换功能。
打开,includes/lib_common.php
大家可以看到,上面是没有显示产品型号的,如何显示产品型号呢,请看下面操作步骤
一、ecshop后台->商品管理->商品上传->商品属性,添加产品型号
如果这个步骤不会的童鞋,请看Ecshop基础教程,关于后台编辑那块,网上很多的,我就不再重复
二、更改文件,根目录/category.php 大概第447行代码
源代码:
一、数据库结构修改
1、用phpMyAdmin打开mysql数据库
2、选择表“ecs_users ”
3】添加你想要加的字段
二、修改模板文件
修改themes/你所选模板目录下/user_transaction.dwt文件
<tr>
<td width="28%" align="right" bgcolor="#FFFFFF">{$lang.other_mobile_phone}:</td>
<td width="72%" align="left" bgcolor="#FFFFFF"><input name="other[mobile_phone]" type="text" value="{$profile.mobile_phone}" class="formBorder" />
</td>
</tr>
<tr>
<td width="28%" align="right" bgcolor="#FFFFFF">{$lang.other_family_birthday}:</td>
<td width="72%" align="left" bgcolor="#FFFFFF"><input name="extend_field6" type="text" value="{$profile.family_birthday}" class="formBorder" />
</td>
</tr>
1、修改 includes/lib_order.php ,找到 order_goods 函数部分,大概在467行左右,代码如下
$sql = "SELECT rec_id, goods_id, goods_name, goods_sn, market_price, goods_number, " .
"goods_price, goods_attr, is_real, parent_id, is_gift, " .
"goods_price * goods_number AS subtotal, extension_code " .
"FROM " . $GLOBALS['ecs']->table('order_goods') .
" WHERE order_id = '$order_id'";
/includes/lib_clips.php文件中搜索如下代码
将ECSHOP会员注册页面的email修改成非必填项”,注意是 email , 那个"会员注册项设置"里是不包括EMAIL的
Ecshop 在网店信息增加自定义字段并调用的方法
1、首先登陆Phpmyadmin,找到ecs_shop_config 表,插入新的字段;
在wap开发中,获取文章内容的时候,里面的图片都设置宽和高,这样在手机里就不会等比缩小,那怎么用php代码过滤img的宽高呢?其中 style="max-width:100%" 为自适应屏幕宽度
指定条目,指定栏目的代码
{pc:get sql="SELECT * FROM PRE_category where parentid=1225 order by listorder DESC" num="8" cache="3600"}
解决方法:
1.根目录建立文件夹 admpub,在 admpub 文件夹里新建一个文件 index.php,内容为:
define('PHPCMS_PATH', realpath(dirname(__FILE__) . '/..') . '/');
include PHPCMS_PATH . '/phpcms/base.php'; // pc_base::creat_app();
$session_storage = 'session_' . pc_base :: load_config('system', 'session_storage');
pc_base :: load_sys_class($session_storage);
session_start();
$_SESSION['right_enter'] = 1;
unset($session_storage);
header('location:../index.php?m=admin');
2.然后在phpcms/modules/admin/文件夹里新建一个文件MY_index.php,内容为:
defined('IN_PHPCMS') or exit('No permission resources.');
class MY_index extends index {
public function __construct(){
if(empty($_SESSION['right_enter'])){
header('location:./');
exit;
}
parent :: __construct();
}
public function public_logout(){
$_SESSION['right_enter'] = 0;
parent :: public_logout();
}
}
3.修改完后你只能通过 localhost/phpcms/admpub 访问后台,而用 localhost/phpcms/admin.php 后跳转到前台页面.
首先在数据库 v9_category 添加字段
然后在 phpcms\modules\admin\templates 目录找到category_add.tpl.php和category_edit.tpl.php然后在里面添加代码: <tr>
<th><?php echo L('自定义字段名')?>:</th>
<td><input type="text" name="info[自定义字段名]" id="自定义字段名" class="input-text" value=""></td>
</tr>
注意:(字段名与数据库添加的字段同步)
内容页当前栏目同级栏目名称
{loop subcat($CAT[parentid]) $v}
<< 向左走,向右走 >>