douiwn6941 2018-09-17 16:55
浏览 64

magento 1.9通过sql查询插入产品

I want to insert a product using sql directly, these are the table I've filled with the relative queries, the categories 1 is root and 19 already exists:

INSERT INTO etpq_catalog_product_entity ( entity_type_id, attribute_set_id, type_id, sku, has_options, required_options, created_at, updated_at ) VALUES ( 4, 4, 'simple', 'SKUPRO', 0, 0, NOW(), NOW() );  

//category
INSERT INTO etpq_catalog_category_product ( category_id, product_id, position ) VALUES ( 1, 23425, 2 ), ( 19, 23425, 2 ); 

//quantity
INSERT INTO etpq_cataloginventory_stock_item ( product_id, stock_id, qty, is_in_stock, cfg_manage_stock, manage_stock, min_sale_qty, max_sale_qty ) VALUES ( 23425, 9, 1, 1, 1, 1, 1 ); 

INSERT INTO etpq_cataloginventoty_stock_status ( product_id, website_id, stock_id, qty, stock_status ) VALUES ( 23425, 1, 1, 9, 1 ); 

//name
INSERT INTO etpq_catalog_product_entity_varchar ( entity_type_id, attribute_id, store_id, entity_id, value ) VALUES( 4, 71, 4, 23425, :value );

//description
INSERT INTO etpq_catalog_product_entity_text ( entity_type_id, attribute_id, store_id, entity_id, value ) VALUES( 4, :attribute_id, 4, 23425,, :entity_id, :value );
//weight 
INSERT INTO etpq_catalog_product_entity_decimal ( entity_type_id, attribute_id, store_id, entity_id, value ) VALUES( :entity_type_id, :attribute_id, :store_id, :entity_id, :value );


//price
INSERT INTO etpq_catalog_product_entity_decimal ( entity_type_id, attribute_id, store_id, entity_id, value ) VALUES( :entity_type_id, :attribute_id, :store_id, :entity_id, :value );


//visibility
INSERT INTO etpq_catalog_product_entity_int ( entity_type_id, attribute_id, store_id, entity_id, value ) VALUES( 4, 102, 4, 23425, 4 );

INSERT INTO etpq_catalog_product_website ( website_id, store_id ) ) VALUES( :website_id, :store_id );

The product is not listed into the manage products of magento, is it missing something?

  • 写回答

2条回答 默认 最新

  • doumen6532 2018-09-17 18:58
    关注

    You can download the current database from phpmyadmin and add the product information to sql file and then upload. You have many queries that need to execute to upload product. Or download only the Data Structure from phpmyadmin if you have large database. I think, this is the shortest way in this case to upload your products.

    评论

报告相同问题?

悬赏问题

  • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
  • ¥50 我撰写的python爬虫爬不了 要爬的网址有反爬机制
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥120 计算机网络的新校区组网设计
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等