zencart通过产品id 批量添加推荐产品
2014-08-20 14:48
253 查看
1.修改 admin/featured.php
查找 pre_add_confirmation
将 pre_add_confirmation 与 break; 之间的代码,用下面的代码替换即可
2.admin\includes\functions\general.php
查找 函数 zen_set_field_length
在这个函数下面 增加以下函数即可
3. 做完上面2步后 就可以 通过后台 Catalog --> Featured Products --> 点击右边的 Product ID to be Manually Added as a Featured按钮
然后在文本框中输入产品的id, 产品id之间用英文逗号隔开,列如 21,55,23,89
查找 pre_add_confirmation
将 pre_add_confirmation 与 break; 之间的代码,用下面的代码替换即可
<?php case 'pre_add_confirmation': // check for blank or existing featured $pre_add_products_id=$_POST['pre_add_products_id']; $pre_add_products_id2=explode(',',$pre_add_products_id); foreach($pre_add_products_id2 as $key=>$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
相关文章推荐
- 批量恢复zencart产品表所属分类master_categories_id为0的产品
- Zencart产品属性批量添加
- 批量上传图片,产品ID自动生成
- Exchange 2003 实战5- 批量添加用户 推荐
- Eexjs 通过数组在节点上添加孩子节点,并重设孩子节点的id
- magento按分类批量添加up-sell产品
- zencart 批量删除产品的方法
- 利用CSVDE命令实现域用户账户的批量添加示例 推荐
- 通过命令行的方式在ESXi中批量添加连续端口组
- 通过产品ID得到collection!!!
- 通过产品ID得到collection!!!
- windows客户端通过脚本文件添加信任站点 推荐
- 通过游标添加主健唯一ID
- zencart产品批量上传说明
- asp中通过addnew添加内容后取得当前文章的自递增ID的方法
- 通过VMM2008控制台添加及管理Vmware Esx 3.5 推荐
- zencart 如何添加产品分类与产品
- JDBC通过反射机制批量的把List里面的对象添加到数据库中
- zencart产品批量维护系统--视频教程