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?
3
Answers
It is necessary insert the product attributes into the store_id=0 (Admin), as well as the store_id of your desired store, to let it show into the product list manager.
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.
For this point, you are able to see the product on magento admin panel only.
If you insert values on catalog_category_product_index then you can see the product through UI.