magento1.9通过sql查询插入产品

lmvvr0a8  于 2021-06-21  发布在  Mysql
关注(0)|答案(3)|浏览(299)

我想直接使用sql插入一个产品,这是我用相关查询填充的表,类别1是根目录,类别19已经存在:

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 );

产品未列入magento的管理产品,是否有遗漏?

yx2lnoni

yx2lnoni1#

有必要将产品属性插入store\u id=0(admin)以及所需商店的store\u id,以使其显示在产品列表管理器中。

zujrkrfu

zujrkrfu2#

您可以从phpmyadmin下载当前数据库,并将产品信息添加到sql文件中,然后上载。您需要执行许多查询才能上载产品。如果您有大型数据库,也可以只从phpmyadmin下载数据结构。我认为,这是最短的方式在这种情况下上传您的产品。

cyej8jka

cyej8jka3#

对于这一点,您只能在magento管理面板上看到产品。如果在目录\类别\产品\索引中插入值,则可以通过ui查看产品。

相关问题