有时候上传的产品与多级分类比较多,在后台添加文本属性如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. BUGKU (Mountain climbing)

    UPX壳,手脱后打不开,可能是在windows10脱壳的缘故吧.放在XP虚拟机上手脱可能会好,但是提示缺少dll.无奈,智能用工具了. 用的这个,感觉蛮好用的. 先打开程序.随便输入一个数,提示err ...

  2. 安装gnocchi

    在控制节点上执行 #!/bin/bash MYSQL_ROOT_PASSWD='m4r!adbOP' GNOCCHI_PASSWD='gnocchi1234!' CEILOMETER_PASSWD=' ...

  3. BiLSTM-CRF模型理解

    适用任务 中文分词.词性标注.命名实体识别是自然语言理解中,基础性的工作,同时也是非常重要的工作. 在很多NLP的项目中,工作开始之前都要经过这三者中的一到多项工作的处理. 在深度学习中,有一种模型可 ...

  4. kettle转换设置变量,校验输出新变量

    背景:有很多小的转换需要串联起来,如果前一个执行成功,后面继续接着执行,如果执行等待中,就让程序等一会再次获取数据分析,如果失败就中止,成功就进行下一个转换,以此类推.... 需求:通过job把参数传 ...

  5. Python +requests 关于post请求返回报错

    python+request 发送post请求:msg返回"Content type 'application/octet-stream' not supported" 一.问题源 ...

  6. oracle报:ORA-01034和ORA-27101的解决办法

    出现ORA-01034和ORA-27101的原因是多方面的:主要是oracle当前的服务不可用,shared memory realm does not exist,是因为oracle没有启动或没有正 ...

  7. 第一章 impala的安装

    目录 第一章 impala的安装 1.impala的介绍 imala基本介绍 impala与hive的关系 impala的优点 impala的缺点: impala的架构以及查询计划 2.impala的 ...

  8. sqlserver bcp命令导出数据

    原文:sqlserver bcp命令导出数据 版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn.net ...

  9. Redis 是怎么实现 “附近的人” 的?

    针对"附近的人"这一位置服务领域的应用场景,常见的可使用PG.MySQL和MongoDB等多种DB的空间索引进行实现. 而Redis另辟蹊径,结合其有序队列zset以及geohas ...

  10. 基于 CentOS 7 搭建 GitLab

    ⒈更新软件包 yum update -y ⒉安装 ssh服务并启动 yum install -y curl policycoreutils-python openssh-server systemct ...