如何在ecshop首页调用指定分类的热销、推荐、新

最新的ECshop代码分享 最新的ECshop代码分享,android代码,ECShop是一款经典的B2C开源商城系统,源码开放,适合企业及个人 按需自定义,且快速构建个性化线上商城。 立即下载

 找到ecshop的includes/lib_goods.php,修改方法如下

以把SQL语句改一下,与category表关联即可将

  1. $sql =  'SELECT g.goods_id,g.goods_name, g.goods_name_style,
  2. g.market_price, g.shop_price AS org_price, g.promote_price, ' .
复制代码
改为
  1.   $sql =  'SELECT g.goods_id,g.cat_id,c.parent_id,g.goods_name, g.goods_name_style, g.market_price, g.shop_price AS org_price, g.promote_price, ' .
复制代码
再在
  1. 'LEFT JOIN ' . $GLOBALS['ecs']->table('brand') . ' AS b ON b.brand_id = g.brand_id ' .
复制代码
下加一句
  1. 'LEFT JOIN ' . $GLOBALS['ecs']->table('category') . ' AS c ON c.cat_id = g.cat_id ' .
复制代码
然后将
  1. if (!empty($cats))
  2.     {
  3.         $sql .= " AND (" . $cats . " OR " . get_extension_goods($cats) .")";
  4.     }
复制代码
改为
  1. if (!empty($cats))
  2.     {
  3.         $sql .= " AND (c.parent_id =" . $cats. " OR " . get_extension_goods($cats) .")";
  4.     }
复制代码
这个是和分类表建立关联,调出商品所在分类的上级分类
然后在index.php中 smarty
  1. $smarty->assign('chot_goods_35',   get_category_recommend_goods('hot','35'));     //指定分类下的热销商品
复制代码
注意这个35是一级分类的ID,然后在模板中调用即可
<!--{foreach from=$chot_goods_35 item=goods}-->
         <div style="padding-top: 8px;" class="new-tr">
           <a target="_blank" href="{$goods.url}"><img width="116" height="130" border="0" alt="{$goods.name|escape:html}" src="{$goods.thumb}"></a>
          <div class="right">
          <a target="_blank" href="{$goods.url}">{$goods.name|escape:html}</a><br>
          <span style="color: rgb(102, 102, 102); text-decoration: line-through;">市场价:{$goods.market_price}</span><br>
          特卖价:<span style="color: rgb(255, 0, 0);">{$goods.shop_price}</span><br>
          <span class="font-gmm"><a  href="javascript:addToCart({$goods.id})">立即抢购</a></span>
          </div>
          <span class="new-line"></span>
          </div>
           <!--{/foreach}-->
同理,新品,推荐都可以调,只要把hot改为new 或者best就可以了
ECSHOP 后台手动添加推荐人 在后台,按用户名改变用户的推荐人。新手第一发,不足之处望多多指点! 立即下载

相关推荐

ecshop 推荐分成插件

ecshop 分成

ecshop 在商品列表页添加类似于精品、热销的功能

效果: 在商品列表页添加自定义字段 1、首先要修改数据表结构,给表 ecs_goods 增加新字段:is_top_sellers, 进入ECSHOP后台 》数据库管理 》SQL查询,输入下面SQL语句,提交。注意如果你的数据表前缀不是ecs_ 请自行修改之 alter table ecs_goods add column is_top_sellers is_top_sell

lcw2007101的专栏 2324

Ubuntu 22.04 “软件与更新”装了NVIDIA驱动,WiFi等设备不见了

在Win10装了Ubuntu22.04的双系统,台式机里面有NVIDIA 3080Ti的独立显卡,Ubuntu默认使用的nouveau驱动,需要更换成NVIDIA相应的驱动,在软件和更新里面一键安装了NVIDIA-driver-535-server之后,发现wifi、蓝牙等设备消失了。这个问题的根源据说跟这个nouveau驱动有关,希望linux社区可以解决这个问题。命令安装后 sudo reboot就可以重新看到WiFi以及蓝牙等设备图标了。然后用U盘拷贝到不能上网的Ubuntu22.04系统上,利用。

me_ysd的博客 5852

EcShop 中关于注册推荐 填写推荐人的功能实现

前几天有人提出这个注册推荐功能,我和他说针对EC来说是有推荐注册提成提积分的功能的,他说想在注册时使用这个。发现网上是有这方面的论述的,但是很遗憾貌似是有问题的所以今天把这个重新修改下在这里记录下希望以后能用的上。1、修改注册页面文件 themes/模板/ user_password.dwt查找代码 ... 在其下加入输入框(当然这里你也可以写成if判断形势,这样有利于整体的管理更傻瓜){$lang.label_rec_user}这里涉及到语言变量的加入不多说了。

chamtianjiao的专栏 6351

KEPServer EX6的Modbus、MQTT和REST Server一站式配置整理说明

KEPServer EX6的Modbus、MQTT和REST Server一站式配置整理说明

syqenter的专栏 8960

灰度发布、蓝绿部署、双活架构与数据同步/备份/迁移

本文系统介绍了现代互联网系统的核心部署策略与数据管理技术体系。主要内容包括:1)三种服务发布策略(灰度发布、蓝绿发布、滚动发布)的原理、实现方式和适用场景对比;2)高可用架构设计(同城双活、异地双活、异地多活)的技术方案;3)数据同步机制、备份策略与迁移方案的设计要点。文章通过架构图、流程图和配置示例详细展示了各类技术的实施方法,并分析了不同方案的优劣及风险控制措施,为构建高可用、高可靠的分布式系统提供了完整的技术指南。

zane的博客 515

ECSHOP商品页调用热销商品的教程

在goods.php里面加了$smarty->assign('hot_goods', get_recommend_goods('hot')); // 获取热销商品。 在goods.dwt加入了如下代码, <!--{foreach from=$hot_goods item=hotgoods}--&gt...

weixin_33895016的博客 191

C#海康威视摄像头控制,将IntPtr转换成Bitmap图片

C#通过skd控制海康威视摄像头,获取bitmap格式图片

ReflexMechanism的博客 6584

php刷新热销商品,ecshop首页如何调用指定分类下的推荐热销最新商品

其实这个在ecshop中预留这个函数,不知道是不是开发者特意留下,但不想让所有人知道而已,函数在includes/lib_goods.php里面。下面开始教你如何添加指定分类的下热销产品:1.在首页index.php中找到/* 页面中的动态内容 */assign_dynamic('index');2.在上面添加如下代码$children = get_children(1);$smarty->...

weixin_33859931的博客 213

13. MIC配置

恒玄BES2700,支持3个MIC。

雪飞_海 924

【经验&技巧】IBIS AMI模型眼图仿真问题探讨

在ADS的仿真环境中,不论发送和接收的AMI模型是否为true或者false,都可以将通道仿真设置为统计模式,但是,如果有一方的Init函数为false,在统计模式下,处于false状态的模型将不能执行其自带的后处理功能,如下图所示,左边的统计模式和右边的逐比特模式眼图存在明显的差异,原因在于,接收端的init函数为false导致在统计模式中不能对眼图进行DFE处理,换言之,此时统计模式下的眼图就是未经任何处理的“生图”。

一只豌豆象的博客 1765

熱銷商品查詢php,ecshop首页调用指定商品分类下推荐热销最新商品

其实这个在ecshop中预留这个函数,不知道是不是开发者特意留下,但不想让所有人知道而已,函数在includes/lib_goods.php里面。下面开始教你如何添加指定分类的下热销产品:1.在首页index.php中找到/* 页面中的动态内容 */assign_dynamic('index');2.在上面添加如下代码$children = get_children(1);$smarty->...

weixin_32049085的博客 180

SAP-ABAP:SAP采购业务核心表关联关系详解

MM(核心)、FI(财务)、SD(计划协议):PR → PO → GR → MIRO → FI过账。

baidu_35680696的博客 930

EcShop首页显示特定分类的精品新品热销特价等推荐商品

EcShop首页显示特定分类的精品新品热销特价等推荐商品 很多大型的B2C商城都有特定分类专区,该分类下的【分类名称】、【推荐子分类 或 推荐品牌】、【大图片/推荐单品】、【推荐商品】、【促销商品】、【推荐商品/热销排行】等,这是基于SEO及用户体验来开发的。ECSHOP虽然有类似的功能,并且推荐商品还分[精品]、[新品]、[热销]三类,但灵活性不是很好,首页第一次加载的时候,无论是[精品]、[新...

weixin_30437337的博客 354

农业生产AI决策系统架构设计解密:数据层-模型层-应用层核心逻辑

想象一下,在一个炎热的夏日,传统农田里的农民伯伯正满头大汗地检查每一株玉米是否缺水;而几公里外的智慧农场里,一位年轻农民正在空调房里滑动手机屏幕,看着AI系统自动生成的灌溉计划——这就是农业生产AI决策系统带来的改变。本文的目的,就是要揭开这个"智能农业大脑"的面纱,详细讲解它的"身体构造"(架构设计)和"工作原理"(核心逻辑)。我们将聚焦系统最核心的三个部分:数据层(收集农田信息)、模型层(分析信息并思考决策)和应用层(将决策告诉农民)。

AI智能探索者的博客 1325

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

ecshop 调用指定分类下的精品、新品、热销

在模板页里首页写上代码:           $children = get_children(16);//此处为产品分类ID $this->assign( 'bestGoods16',get_category_recommend_goods('best', $children)); ?> 第二步在调用产品的时候循环类似下面的代码                   {if $sm

ximo's blog 1696

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

ecshop3 调用指定分类下推荐/热卖/新品商品,可指定调用数量

第一步:--------------------------------------------------------------------------------------/** * 取指定分类ID及类型的商品信息 * @access public * @param string $cat_id 分类ID * @param string $num 显示商品数量 * @param ...

ampg7191的博客 308

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

ECSHOP首页调用指定分类推荐商品/热卖商品/新品商品

ECSHOP网站首页调用最新商品、热门商品、推荐商品默认都是调用全部商品分类的。 通过以下方法可以调用指定分类下的热门、推荐、最新商品。 1、打开ecshop的includes/lib_goods.php 查找: 1 2 $sql = 'SELECT g.goods_id,g.goods_name, g.goods_name_style, g.m...

weixin_34059951的博客 881

ecshop首页调用指定分类下的推荐、热卖、新品

默认情况下ECSHOP首页的推荐、热卖和新品三个板块的商品都是从所有商品里读取出来的。 如果要“在ecshop首页调用指定分类的推荐、热卖、新品?”该怎么办呢?   下面教你一种方法. 找到 ecshop 的 includes/lib_goods.php, 把SQL语句改一下,与category表关联即可   将 --------------------------...

weixin_34006965的博客 206

Ecshop模板在首页调用指定分类的热销、推荐、新品商品

在首页调出指定分类下的精品或新品或热销,分别在不同地方调用,使用下面的函数 $children = get_children(你要调用的分类ID); $smarty->assign( 'bestGoods', get_category_recommend_goods('best', $children)); $smarty->assign( 'newGoods',...

weixin_34026276的博客 164

php商品链接地址,ECSHOP首页商品列表调用该商品所属分类名称及链接地址修改方法...

使用ecshop开发过程中要求在首页循环调用新品、精品、热销的商品列表,同时调用该商品的所属于的那个分类,点击这个分类,可以链接到该分类。所用ecshop版本为v2.7.2 RELEASE 20100604,修改方法如下:在文件includes/lib_goods.php约289行修改成如下:?复制代码代码如下://取出所有符合条件的商品数据,并将结果存入对应的推荐类型数组中$sql='SELEC...

weixin_27374911的博客 381

ecshop生成带分类的html商品链接,ECSHOPv2.7.2如何在首页商品列表调用该商品所属分类名称及链接地址...

无忧主机小编为大家介绍下ecshopv2.7.2如何在首页循环调用新品、精品、热销的商品列表,同时调用该商品的所属于的那个分类,点击这个分类,可以链接到该分类。所用ecshop版本为v2.7.2 RELEASE 20100604,修改方法如下:在文件includes/lib_goods.php约289行修改成如下://取出所有符合条件的商品数据,并将结果存入对应的推荐类型数组中$sql='SELE...

weixin_42298415的博客 312

ecshop商品页面改成html,ECSHOPv2.7.2首页商品列表调用该商品所属分类名称及链接地址修改方法...

使用ecshop开发过程中要求在首页循环调用新品、精品、热销的商品列表,同时调用该商品的所属于的那个分类,点击这个分类,可以链接到该分类。所用ecshop版本为v2.7.2 RELEASE 20100604,修改方法如下:在文件includes/lib_goods.php约289行修改成如下:复制代码代码如下://取出所有符合条件的商品数据,并将结果存入对应的推荐类型数组中$sql='SELECT...

weixin_39917894的博客 189

php商品状态精品 热销,ecshop商品列表,商品页,热销,精品,搜索列表页调用商品销售量(已销售数量)-ECSHOP教程网...

ecshop各个页面调用商品销售量方法(原创可用)ECSHOP模板首页的推荐商品包括热销推荐和促销三个文件只对热销商品为例第一步:打开根目录/includes/lib_goods.php文件。在文件末尾添加方法function selled_count($goods_id){$sql= "select sum(goods_number) as count from ".$GLOBALS['ecs'...

weixin_39737831的博客 170

ECSHOP首页的精品/新品/热销里显示商家备注

  ECSHOP首页的精品/新品/热销里显示商家备注,如图   1、修改 /includes/lib_goods.php 查找 "promote_start_date, promote_end_date, g.goods_brief, g.goods_thumb, g.goods_img, RAND() AS rnd " . 修改为 "promote_start_dat...

weixin_33696822的博客 241
上一篇: ecshop详细页增加运费查询
下一篇: ECSHOP商品页加入购物车弹出仿淘宝效果
cloudday
博客等级 码龄19年 112粉丝 37原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值