Home >Backend Development >PHP Tutorial >welcometomyshop ecshop batch upload (add custom attributes)
The following is the idea and implementation process for 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 a 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
Specification: 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
I inserted line 174 here:
3. Add fields for reading and updating the product table (not related to batch upload but easy to view)
Location: admin/goods.php
At the update location Add:
$sql="update ecs_goods set goods_guige='".$_POST['goods_guige']."' where goods_id= ".$_REQUEST['goods_id'];
$db->query($sql);
The attributes of this product can be updated
4. Add fields for batch upload
language/admin/goods_batch.php
Add fields:
//Customized batch upload fields
$_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.
The above introduces welcometomyshop ecshop batch upload (adding custom attributes), including welcometomyshop content. I hope it will be helpful to friends who are interested in PHP tutorials.