有时候上传的产品与多级分类比较多,在后台添加文本属性如Name,Number等需要顾客自定义的内容就比较费神了。现在只需将以下代码保存为insert_attributes.php,变量$options_id_array,$current_category_id修改为实际的值,上传到网站根目录运行即可一步到位。

<?php
//header("content-Type: text/html; charset=utf-8");
@set_time_limit(1800);
@ini_set('memory_limit','100M');
require('includes/application_top.php');
$options_id_array = array(2,3); //文本属性对应的ID数组
$current_category_id = 99; //要批量设置文本属性的产品分类ID $categories_products_list = zen_get_categories_products_list($current_category_id);
$plist_array = array();
foreach($categories_products_list as $key => $value){
$plist_array[] = $key;
}
//print_r($plist_array); foreach($plist_array as $pid){
foreach($options_id_array as $optid){
$db->Execute("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " (products_id, options_id, options_values_id, options_values_price, price_prefix, product_attribute_is_free, products_attributes_weight_prefix, attributes_display_only, attributes_default, attributes_discounted) values('" . (int)$pid . "', '" . (int)$optid . "', 0, '0.0000', '+', '1', '+', 0, 0, '1')");
}
} echo '<center style="color:#009900; font-size:14px;padding-top:50px;">Insert Attributes Success!</center>'; require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

打完收工!

zencart批量插入TEXT文本属性attributes的更多相关文章

  1. 给iOS开发新手送点福利,简述文本属性Attributes的用法

    给iOS开发新手送点福利,简述文本属性Attributes的用法   文本属性Attributes 1.NSKernAttributeName: @10 调整字句 kerning 字句调整 2.NSF ...

  2. IOS开发UI基础文本属性Attributes

    文本属性Attributes 1.NSKernAttributeName: @10 调整字句 kerning 字句调整 2.NSFontAttributeName : [UIFont systemFo ...

  3. iOS- 详解文本属性Attributes(转)

    iOS- 详解文本属性Attributes 1.NSKernAttributeName: @10 调整字句 kerning 字句调整 2.NSFontAttributeName : [UIFont s ...

  4. 关于html与css的标签及属性(text文本属性、背景background属性、表格标签table、列表、)

    text文本属性1.颜色 colorcolor:red: 2.文本缩进text-indant属性值 num+px text-indant:10px:3.文本修饰 text-decoration属性值: ...

  5. HTML+css基础 Text文本属性

    Text文本属性: 1.颜色  color color:red 2.文本缩进 text-indent 属性值 数字+px: text-indent:10px: 3.文本修饰 text-decorati ...

  6. text——文本属性大全

    一.文字颜色(color:red;) <style> body {color:red} h1 {color:greenyellow} p.color {color:blue} </s ...

  7. 文本属性Attributes

    1.NSKernAttributeName: @10 调整字句 kerning 字句调整 2.NSFontAttributeName : [UIFont systemFontOfSize:_fontS ...

  8. iOS- 详解文本属性Attributes

    1.NSKernAttributeName: @10 调整字句 kerning 字句调整 2.NSFontAttributeName : [UIFont systemFontOfSize:_fontS ...

  9. iOS之文本属性Attributes的使用

    1.NSKernAttributeName: @10 调整字句 kerning 字句调整 2.NSFontAttributeName : [UIFont systemFontOfSize:_fontS ...

随机推荐

  1. ParallelForTransform作业

    ParallelForTransform作业是另一种ParallelFor作业 ; 专为在变形上操作而设计. 注意:ParallelForTransform作业是Unity中用于实现IJobParal ...

  2. 【POJ - 1970】The Game(dfs)

    -->The Game 直接中文 Descriptions: 判断五子棋棋局是否有胜者,有的话输出胜者的棋子类型,并且输出五个棋子中最左上的棋子坐标:没有胜者输出0.棋盘是这样的,如图 Samp ...

  3. 奥比中光Astra Pro的使用(1)

    在ubuntu上的使用 首先下载SDK以及OpenNI安装包,下载地址: 解压两个安装包 切换目录到AstraSDK-Linux下的install目录,并输入命令:sudo sh ./install. ...

  4. AspxGridView 弹框选择器 JS

    function Dictionary() { this.data = new Array(); this.put = function (key, value) { this.data[key] = ...

  5. 关于Npoi+excel文件读取,修改文件内容的处理方式

    因最近有需求场景,实现对文件的读写操作,又不单独生成新的文件,对于源文件的修改,做了一个简单实现,如下↓ // 要操作的excel文件路径 string fileName = Server.MapPa ...

  6. Golang 匿名结构体及测试代码编写技巧

    转自: https://www.jianshu.com/p/901820e17ffb 结构体基础 结构体 (struct) 将多个不同类型的字段集中组成一种复合类型,按声明时的字段顺序初始化. typ ...

  7. [bzoj2597][Wc2007]剪刀石头布_费用流

    [Wc2007]剪刀石头布 题目大意:https://www.lydsy.com/JudgeOnline/problem.php?id=2597 题解: 发现直接求三元环不好求,我们考虑任选三个点不是 ...

  8. Centos7 安装部署 Airflow

    本人在centos7 的环境下部署,怎么在centos7 下配置静态 IP 关闭防火墙 以及安装jdk在这里不多赘述, centos7 配置静态ip可以参考:https://www.cnblogs.c ...

  9. Daily Temperatures

    Given a list of daily temperatures T, return a list such that, for each day in the input, tells you ...

  10. [转帖]中芯国际14nm秋季量产 7nm工艺或在2020年底问世

    中芯国际14nm秋季量产 7nm工艺或在2020年底问世 https://news.mydrivers.com/1/641/641087.htm 中芯正在发力.. 今年秋天 14nm两场 明年底 7n ...