zencart批量插入TEXT文本属性attributes
有时候上传的产品与多级分类比较多,在后台添加文本属性如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的更多相关文章
- 给iOS开发新手送点福利,简述文本属性Attributes的用法
给iOS开发新手送点福利,简述文本属性Attributes的用法 文本属性Attributes 1.NSKernAttributeName: @10 调整字句 kerning 字句调整 2.NSF ...
- IOS开发UI基础文本属性Attributes
文本属性Attributes 1.NSKernAttributeName: @10 调整字句 kerning 字句调整 2.NSFontAttributeName : [UIFont systemFo ...
- iOS- 详解文本属性Attributes(转)
iOS- 详解文本属性Attributes 1.NSKernAttributeName: @10 调整字句 kerning 字句调整 2.NSFontAttributeName : [UIFont s ...
- 关于html与css的标签及属性(text文本属性、背景background属性、表格标签table、列表、)
text文本属性1.颜色 colorcolor:red: 2.文本缩进text-indant属性值 num+px text-indant:10px:3.文本修饰 text-decoration属性值: ...
- HTML+css基础 Text文本属性
Text文本属性: 1.颜色 color color:red 2.文本缩进 text-indent 属性值 数字+px: text-indent:10px: 3.文本修饰 text-decorati ...
- text——文本属性大全
一.文字颜色(color:red;) <style> body {color:red} h1 {color:greenyellow} p.color {color:blue} </s ...
- 文本属性Attributes
1.NSKernAttributeName: @10 调整字句 kerning 字句调整 2.NSFontAttributeName : [UIFont systemFontOfSize:_fontS ...
- iOS- 详解文本属性Attributes
1.NSKernAttributeName: @10 调整字句 kerning 字句调整 2.NSFontAttributeName : [UIFont systemFontOfSize:_fontS ...
- iOS之文本属性Attributes的使用
1.NSKernAttributeName: @10 调整字句 kerning 字句调整 2.NSFontAttributeName : [UIFont systemFontOfSize:_fontS ...
随机推荐
- SpringBoot使用AOP获取请求参数
最近试了下拦截controller方法查看请求参数,方式如下: package com.*.aop; import com.alibaba.fastjson.JSON; import com.alib ...
- Linux服务知识点总结
一.firewalld防火墙 1.firewalld简述 firewalld:防火墙,其实就是一个隔离工具:工作于主机或者网络的边缘.对于进出本主机或者网络的报文根据事先定义好的网络规则做匹配检测,对 ...
- 阅读《C Primer Plus》收获
190927 知识内容: 1.了解到C语言混乱代码大赛.评选谁的程序最有创意但又让人难以理解 2.了解最初的c语言的规则,所有编译器依照规则而设计. 3.编程前先要确定好目标对象,并且在纸上大概写出流 ...
- [python] 初识 PyQt5
昨天想着用 Python 写个展示的 demo,之前打算熟悉一下 PyQt ,正好边学边做,学以致用. 主要的流程是在 cmd 下运行 .exe 并读取输出结果,运到的困难是如何实时回传数据以及修改图 ...
- Java list 转树tree的三种写法
- 版本管理工具svn(转)
这种操作类的文章就不自己再写了,感觉浪费时间. 找了一个写的不错的文章转载. 文中流程有些变动,但是问题不大,可能是版本原因. SVN服务器的本地搭建和使用 http://www.2cto.com/o ...
- 怎样在 Linux 上查看某个端口的相关信息?
比如 TCP端口 / UDP端口 / 端口占用程序的进程号 等, 这些信息都可以使用: netstat -atunlp | grep 端口号 来进行获取. 比如我们想获取 22 端口的相关信息: 这里 ...
- vs 2017创建类时的默认模板修改
思路:找到vs 2017安装目录---->找到模板文件---->修改 一般安装目录: C:\Program Files (x86)\Microsoft Visual Studio\2017 ...
- sftp上传文件(Renci.SshNet)和代理上传
引用Renci.SshNet这个 封装的sftp类 public class SFTPHelper { #region 字段或属性 private SftpClient sftp; /// <s ...
- STL之Deque的使用方法
STL 中类 stack 实现了一个栈 1)push 能够插入元素 2)pop 移除栈顶元素 使用的时候,需要包含头文件 #include <stack>,stack 被声明如下: nam ...