ecshop batch upload (add custom attributes)_PHP tutorial

WBOY
Release: 2016-07-21 15:19:56
Original
770 people have browsed it

The following is the idea and implementation process of batch uploading (adding custom attributes).

1. Add attributes
The reason why only specific attributes can be uploaded is that the fixed attributes uploaded in batches all come from one table. esc_goods table.
So we think that if we have our own attributes, we must add our own attributes to esc_goods. For example, the field added this time adds
specifications: goods_guige
Code: sql statement: alter table ecs_goods add goods_guige varchar(255) not null after goods_desc;

2. Page modification
Location: admin/templates/goods_info.htm Add custom fields according to its form
Here I am Line 174 inserted:



3. Add fields for reading and updating the product table (not related to batch upload but easy to view)
Location: admin/goods.php
Add at the update location:
$sql=" update ecs_goods set goods_guige='".$_POST['goods_guige']."' where goods_id= ".$_REQUEST['goods_id'];
$db->query($sql);
Here The attributes of the product can be updated

4. Add fields for batch upload
language/admin/goods_batch.php
Add fields:
//Customized Batch upload field
$_LANG['upload_goods']['goods_guige']='Specification';

OK! At this point, as long as you export the cvs of the product, you can upload customized attributes in batches.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/325242.htmlTechArticleThe following is the idea and implementation process of batch uploading (adding custom attributes). 1. Add attributes. The reason why only specific attributes can be uploaded should be that the fixed attributes uploaded in batches come from...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template