• 欢迎访问苗景云的博客

 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}调用

效果如下。可以连品牌一起调用出来咯
\

发布:苗景云 | 查看全文 | 浏览(1436) | 分类:IT技术&设计 | 评论(0) | 2015年08月06日

 

Ecshop修改商品分类页的排序方式为推荐排序

  要 修改Ecshop商品分类页图片的排序方式,我们只需要修改Ecshop里category.php的$default_sort_order_type 默认的排序方式,Ecshop默认的排序方式是以商品的goods_id商品的序号来排序的,我这里呢就改为推荐排序sort_order来排序了,这就 是Ecshop后台商品列表页的热销和库存中间的推荐排序,修改这里的数字就可以让商品分类页的商品按照这个来排序了!

发布:苗景云 | 查看全文 | 浏览(1247) | 分类:IT技术&设计 | 评论(0) | 2015年08月06日

 

ECSHOP留言板添加字段虽然有点繁锁,但也不是很难,操作方法如下(本人已经实现过):
步骤 1. 更改文件message_board.dwt
<tr>
<td align="right">{$lang.message_board_qq}</td>
<td><input name="msg_qq" type="text" class="inputBg" size="20" value=""/></td>
</tr>
<script type="text/javascript">
        {foreach from=$lang.message_board_js item=item key=key}
        var {$key} = "{$item}";
        {/foreach}
        {literal}
       
        function submitMsgBoard(frm)
        {
            var msg = new Object;
             msg.user_email  = frm.elements['user_email'].value;
      msg.msg_qq  = frm.elements['msg_qq'].value;         
             msg.msg_title   = frm.elements['msg_title'].value;
             msg.msg_content = frm.elements['msg_content'].value;
             msg.captcha     = frm.elements['captcha'] ? frm.elements['captcha'].value : '';
   
   
            var msg_err = '';
            if (msg.user_email.length > 0)
            {
               if (!(Utils.isEmail(msg.user_email)))
               {
                  msg_err += msg_error_email + '\n';
                }
             }
             else
             {
                  msg_err += msg_empty_email + '\n';
             }
            if (msg.msg_title.length == 0)
            {
                msg_err += msg_title_empty + '\n';
            }
            if (frm.elements['captcha'] && msg.captcha.length==0)
            {
                msg_err += msg_captcha_empty + '\n'
            }
            if (msg.msg_content.length == 0)
            {
                msg_err += msg_content_empty + '\n'
            }
   
   if (msg.msg_qq.length == 0)
            {
                msg_err += 'QQ不能为空\n';
            }
   
            if (msg.msg_title.length > 200)
            {
                msg_err += msg_title_limit + '\n';
            }
            if (msg_err.length > 0)
            {
                alert(msg_err);
                return false;
            }
            else
            {
                return true;
            }
        }
        {/literal}
        </script>
 
步骤 2. 更改文件message.php
 $message = array(
        'user_id'     => $user_id,
        'user_name'   => $user_name,
        'user_email'  => isset($_POST['user_email']) ? htmlspecialchars(trim($_POST['user_email']))     : '',
        'msg_qq'   => isset($_POST['msg_qq']) ? trim($_POST['msg_qq'])     : '', 
        'msg_type'    => isset($_POST['msg_type']) ? intval($_POST['msg_type'])     : 0,
        'msg_title'   => isset($_POST['msg_title']) ? trim($_POST['msg_title'])     : '',
        'msg_content' => isset($_POST['msg_content']) ? trim($_POST['msg_content']) : '',
        'order_id'    => 0,
        'msg_area'    => 1,
        'upload'      => array()
     );
 
步骤 2. 更改文件lib_clips.php
 $message['msg_area'] = isset($message['msg_area']) ? intval($message['msg_area']) : 0;
    $sql = "INSERT INTO " . $GLOBALS['ecs']->table('feedback') .
            " (msg_id, parent_id, user_id, user_name, user_email,msg_qq, msg_title, msg_type, msg_status,  msg_content, msg_time, message_img, order_id, msg_area)".
            " VALUES (NULL, 0, '$message[user_id]', '$message[user_name]', '$message[user_email]', ".
            " '$message[msg_qq]','$message[msg_title]', '$message[msg_type]', '$status', '$message[msg_content]', '".gmtime()."', '$img_name', '$message[order_id]', '$message[msg_area]')";
    $GLOBALS['db']->query($sql);

发布:苗景云 | 查看全文 | 浏览(1465) | 分类:IT技术&设计 | 评论(0) | 2015年08月06日

 正则表达式(regular expression)是一个描述字符模式的对象。使用正则表达式可以进行强大的模式匹配和文本检索与替换功能。

发布:苗景云 | 查看全文 | 浏览(1251) | 分类:IT技术&设计 | 评论(0) | 2015年08月03日

 

Ecshop 修改收货人信息 把电话改成选择填写 手机改为必填 (加强版)


发布:苗景云 | 查看全文 | 浏览(1411) | 分类:IT技术&设计 | 评论(0) | 2015年08月03日

打开,includes/lib_common.php

发布:苗景云 | 查看全文 | 浏览(1186) | 分类:IT技术&设计 | 评论(0) | 2015年08月03日

 \
大家可以看到,上面是没有显示产品型号的,如何显示产品型号呢,请看下面操作步骤
一、ecshop后台->商品管理->商品上传->商品属性,添加产品型号
\
如果这个步骤不会的童鞋,请看Ecshop基础教程,关于后台编辑那块,网上很多的,我就不再重复
二、更改文件,根目录/category.php 大概第447行代码
  源代码:

发布:苗景云 | 查看全文 | 浏览(1518) | 分类:IT技术&设计 | 评论(0) | 2015年07月31日

 一、数据库结构修改
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>

发布:苗景云 | 查看全文 | 浏览(1495) | 分类:IT技术&设计 | 评论(0) | 2015年07月28日

 

先上效果图吧

发布:苗景云 | 查看全文 | 浏览(1756) | 分类:IT技术&设计 | 评论(0) | 2015年07月26日

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'";
 

发布:苗景云 | 查看全文 | 浏览(1295) | 分类:IT技术&设计 | 评论(0) | 2015年07月26日

 

/includes/lib_clips.php文件中搜索如下代码

发布:苗景云 | 查看全文 | 浏览(1172) | 分类:IT技术&设计 | 评论(0) | 2015年07月21日

 

ECSHOP会员注册页面的email修改成非必填项”,注意是 email , 那个"会员注册项设置"里是不包括EMAIL的

发布:苗景云 | 查看全文 | 浏览(1260) | 分类:IT技术&设计 | 评论(0) | 2015年07月21日

 Ecshop 在网店信息增加自定义字段并调用的方法

1、首先登陆Phpmyadmin,找到ecs_shop_config 表,插入新的字段;

发布:苗景云 | 查看全文 | 浏览(1274) | 分类:IT技术&设计 | 评论(0) | 2015年07月17日

 在wap开发中,获取文章内容的时候,里面的图片都设置宽和高,这样在手机里就不会等比缩小,那怎么用php代码过滤img的宽高呢?其中 style="max-width:100%" 为自适应屏幕宽度

发布:苗景云 | 查看全文 | 浏览(1442) | 分类:IT技术&设计 | 评论(0) | 2015年07月13日

指定条目,指定栏目的代码

{pc:get sql="SELECT * FROM PRE_category where parentid=1225 order by listorder DESC" num="8" cache="3600"} 

发布:苗景云 | 查看全文 | 浏览(1255) | 分类:IT技术&设计 | 评论(0) | 2015年06月23日

解决方法:
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 后跳转到前台页面.

发布:苗景云 | 查看全文 | 浏览(1307) | 分类:IT技术&设计 | 评论(0) | 2015年06月06日

首先在数据库 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>

注意:(字段名与数据库添加的字段同步)

发布:苗景云 | 查看全文 | 浏览(1240) | 分类:IT技术&设计 | 评论(0) | 2015年05月24日

内容页当前栏目同级栏目名称

 

           {loop subcat($CAT[parentid]) $v}

发布:苗景云 | 查看全文 | 浏览(1197) | 分类:IT技术&设计 | 评论(0) | 2015年05月23日
« 之后的文章苗景云的博客
<< 向左走,向右走 >>
更早的文章 »