博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
zencart通过产品id 批量添加推荐产品
阅读量:6879 次
发布时间:2019-06-26

本文共 1973 字,大约阅读时间需要 6 分钟。

1.修改 admin/featured.php

查找 pre_add_confirmation
将 pre_add_confirmation 与  break; 之间的代码,用下面的代码替换即可

$val) { $sql = "select products_id from " . TABLE_PRODUCTS . " where products_id='" . (int)$val . "'"; $check_featured = $db->Execute($sql); if ($check_featured->RecordCount() == 1) { $sql = "select products_id from " . TABLE_FEATURED . " where products_id='" . (int)$val . "'"; $check_featured = $db->Execute($sql); if ($check_featured->RecordCount() < 1) { // add empty featured $featured_date_available = ((zen_db_prepare_input($_POST['start']) == '') ? '0001-01-01' : zen_date_raw($_POST['start'])); $expires_date = ((zen_db_prepare_input($_POST['end']) == '') ? '0001-01-01' : zen_date_raw($_POST['end'])); $products_id = zen_db_prepare_input($val); $db->Execute("insert into " . TABLE_FEATURED . " (products_id, featured_date_added, expires_date, status, featured_date_available) values ('" . (int)$products_id . "', now(), '" . zen_db_input($expires_date) . "', '1', '" . zen_db_input($featured_date_available) . "')"); } } } break;?>

2.admin\includes\functions\general.php
查找 函数 zen_set_field_length
在这个函数下面 增加以下函数即可

function zen_set_field_length_1000($max=50, $override=false) {    $field_length= 1000;    switch (true) {      case (($override == false and $field_length > $max)):        $length= 'size = "' . ($max+1) . '" maxlength= "' . $field_length . '"';        break;      default:        $length= 'size = "' . ($field_length+1) . '" maxlength = "' . $field_length . '"';        break;    }    return $length;  }

 

3. 做完上面2步后 就可以 通过后台 Catalog --> Featured Products --> 点击右边的 Product ID to be Manually Added as a Featured按钮
然后在文本框中输入产品的id, 产品id之间用英文逗号隔开,列如 21,55,23,89

转载于:https://www.cnblogs.com/afish/p/3924590.html

你可能感兴趣的文章
【Python之旅】第七篇(三):使用Redis订阅服务
查看>>
linux远程桌面链接windows
查看>>
TrendMicro:新的APT***针对亚洲和欧洲政府组织,包括中国媒体机构
查看>>
C语言中sizeof与strlen区别2
查看>>
我的友情链接
查看>>
我的友情链接
查看>>
我的友情链接
查看>>
UIWebView加载html网页时使用缓存和清空缓存
查看>>
我的友情链接
查看>>
设计模式学习笔记(六)之策略模式(Strategy)
查看>>
python运行spark脚本程序
查看>>
我的友情链接
查看>>
通过libvirt使用ceph块设备
查看>>
优秀交互设计师成长指南
查看>>
SDN网络系统之MiniNet的安装与使用
查看>>
java的Iterator和listIterator的区别
查看>>
服务器虚拟化的好处
查看>>
AxureRP7.0基础教程系列 部件详解 表格Tabel
查看>>
ORACLE之sql语句优化
查看>>
一台机器同时启动多个tomcat
查看>>