AbanteCart Community

Shopping Cart Operations => Support => Topic started by: castigous on May 26, 2017, 10:30:52 AM

Title: products not showing after CSV import (But AC says it imported OK)
Post by: castigous on May 26, 2017, 10:30:52 AM
Hi!

I've worked extensively on our list of products so it would be readable by AbanteCart (all folollowing the documentation on  and the CSV that are there as examples). I also checked that the [product_id] column was empty for every product.

Now after many hours, I did the procedure and the message AC was that the process was completed succesfully:
Total loaded: 3560. Updated: 0. Created: 3560. Errors: 0

But I return to the products list and I see no update, it's the same short old list.

So I eliminated the first column that says [action] and has [insert] in all the the cells below so I could try it as an update.

It also tells me it was OK:
Total loaded: 3560. Updated: 3560. Created: 0. Errors: 0

But the products still don't appear.

I checked the database with PhpMyAdmin and it seems they're there (table: abc_products) so I don't get get what is happening and I' getting frustrated after so many hours.

I cleaned AC's cache (System/Cache) and even deactivated it on the options.

Please help! I'm on a deadline and the professional support of AC is not even contacting after repeated attempts.

I don't know what to to do

Thanks!
Title: Re: products not showing after CSV import (But AC says it imported OK)
Post by: eCommerce Core on May 26, 2017, 02:36:56 PM
Did you assign products to any category?

Do you mind sharing a short sample of your file (2-3 first lines)?
Title: Re: products not showing after CSV import (But AC says it imported OK)
Post by: castigous on May 27, 2017, 09:49:02 AM
Hi!

Thanks for your response!

Right now I can't access the spreadsheet but is true that I didn't include the variable(s)/column(s) referring to categories and brands (the one I imported had about 10 columns) as I intend to insert/update this list in phases because the spreadsheet requires still some cleaning and editing, besides the mapping of the variables I had done already.

I think it would help greatly to know which variables/columns must be filled and are indispensable to make the import work, and which are optional and can be filled later as an update.

Later I'll try to produce those first three lines!

Thank you!!
Title: Re: products not showing after CSV import (But AC says it imported OK)
Post by: abantecart on May 27, 2017, 10:57:32 PM
If you see "Created: 3560" in the report, products are created.

Do you see new products in admin?

Make sure that your cache is actually working. Go to system/cache/ and delete all files and directories.


Title: Re: products not showing after CSV import (But AC says it imported OK)
Post by: castigous on May 28, 2017, 03:06:41 PM
Thanks for your input!

If you see "Created: 3560" in the report, products are created.

Do you see new products in admin?

Make sure that your cache is actually working. Go to system/cache/ and delete all files and directories.

1- I got:
Total loaded: 3560. Updated: 3560. Created: 0. Errors: 0

So I guess they were not created (although they seem to be there according to phpMyAdmin)

2- No I don't see them in admin, that's the whole point of this post.

3- I cleared the whole AC's cache, re-tried with same result, then I deactivated the AC's cache.


Thanks, but I think it would help greatly to know which variables/columns must be filled and are indispensable to make the import work, and which are optional and can be filled later as an update.

Title: Re: products not showing after CSV import (But AC says it imported OK)
Post by: castigous on May 29, 2017, 03:11:01 PM
Did you assign products to any category?

Do you mind sharing a short sample of your file (2-3 first lines)?

Hello and thanks for your response!!

I attach a sample (3 frist lines) file derived from the one used to do the import.

It is true that I didn't include the variable(s)/column(s) referring to categories and brands (the one I imported had about 10 columns) as I intend to insert/update this list in phases because the spreadsheet requires still some cleaning and editing, besides the mapping of the variables I had done already.

I think it would help greatly to know which variables/columns must be filled and are indispensable to make the import work, and which are optional and can be filled later as an update.

I appreciate any comments after seeing the attached sample file.

Thanks!!
Title: Re: products not showing after CSV import (But AC says it imported OK)
Post by: Basara on May 30, 2017, 10:06:04 AM
I think it would help greatly to know which variables/columns must be filled and are indispensable to make the import work, and which are optional and can be filled later as an update.

Hello. See my answer to you in another post http://forum.abantecart.com/index.php/topic,5678.msg24451.html#msg24451
Try to export your existing products and you will see correct format to update/insert product.

In the file you attached missing important columns for example store id. Without it your products loaded to database but not assigned to any store and in result when you visit admin to see Default store's products they are not show up  ;)
Title: Re: products not showing after CSV import (But AC says it imported OK)
Post by: castigous on May 30, 2017, 10:29:43 AM
Thank you!

I did that last week for just a sample of 4 products, but doing that I get a CSV file which has columns that go up to [HJ] wich according to my calculations more than 200 variables/fields/columns.

I have analyzed some of them that includes dates and similar stuff that I guess are not required and that AC can fill later automatically?

That's why I've been asking for a list of the required variable/fields/columns that are INDISPENSABLE to fill to import succesfully, and the rest that would be OPTIONAL/blank.

You just mentioned the store_id variable and someone else mentioned categories --which are 2 that i can see: products_to_categories[0].category_id & products_to_categories[1].category_id both have different values which I guess the 1st one is the main category and 2nd one is a sub-category?

What If have more categories? would they go in different columns:
products_to_categories[2].category_id
products_to_categories[3].category_id
products_to_categories[4].category_id and so on?

I guess only the 1st one products_to_categories[0].category_id is indispensable and the other(s) can be updated later after I have mapped them correctly?

Any other(s) that are indispensable?

Thanks
Title: Re: products not showing after CSV import (But AC says it imported OK)
Post by: eCommerce Core on May 30, 2017, 10:55:53 AM
For Admin visibility:

products_to_stores[0].store_id will be important. For most cases it is 0 (unless you have multiple stores)
products.model
product_descriptions[0].name

If you update, you need to have products.product_id

For Storefront, there are many conditions that can cause product to be visible.

products_to_categories[0].category_id is required to show product on a storefront.

Other related to your stock settings, status, etc.
Title: Re: products not showing after CSV import (But AC says it imported OK)
Post by: castigous on May 30, 2017, 01:25:53 PM
Hi!

So I added this columns that were missing:

products_to_stores[0].store_id (0 in all)
products.model (empty in all)
product_descriptions[0].language_id (1 in all)

But now I'm getting a message "Missing relation ID language_id for update_or_insert action in table product_descriptions. Skipping." at importing which mentions the 3rd column I just described.

Also the column products.product_id I'm leaving it empty because it seems AC don't like to be told which ID to use and prefer to assign it itself?

Still stuck even after all suggestions.

Title: Re: products not showing after CSV import (But AC says it imported OK)
Post by: Basara on May 31, 2017, 01:56:36 AM
Hello, castigous.
Each product in AbanteCart have a lot of configuration settings, options, option values, half of the configs are multilanguage supported that's why if export everything about product you will see so many columns.

Please see attached very minimum working Tab delimeted CSV file with only 18 columns allowing you to insert product with basic settings like name, weight, price, description, blurb, category id to assign, store id, tax class, quantity etc

Please note it is Example!
Title: Re: products not showing after CSV import (But AC says it imported OK)
Post by: castigous on June 01, 2017, 05:56:04 PM
Hi!

Thank you all and specially Basara for the attached product csv file. Yesterday after adpating it to a very small subset of my product list the CSV data was inserted fine and without issues.

Now I'm having trouble trying to update this same subset of products. It seems AC is expecting the columns to be in a pre-determined order and if one tries to reorganize columns, AC gives error at updating.

So I created an update file with the columns in the exact same order of Basara's example file --changing the first 2 columns:
- action   - with all cells [update]
- products.product_id    - with the corresponding id for the product files I imported.

But now AC is giving this message after uploading the file:
Total loaded: 1. Updated: 0. Created: 0. Errors: 1
There are some errors. Show details
Incorrect structure of main Array node. Only table nodes are expected


I attach the file to have a look

Many many thanks!
Title: Re: products not showing after CSV import (But AC says it imported OK)
Post by: castigous on June 01, 2017, 06:18:58 PM
Hi!

A new question!

Of all the columns in Basara's example file I get where everything goes in each product's edit page except for the column products.subtract. What is its function?

Thanks!
Title: Re: products not showing after CSV import (But AC says it imported OK)
Post by: Basara on June 02, 2017, 01:32:34 AM

But now AC is giving this message after uploading the file:
Total loaded: 1. Updated: 0. Created: 0. Errors: 1
There are some errors. Show details
Incorrect structure of main Array node. Only table nodes are expected



Hello. Please set correct CSV delimiter when you import. In the file attached you have TAB delimiter
Title: Re: products not showing after CSV import (But AC says it imported OK)
Post by: castigous on June 02, 2017, 03:27:50 PM
Thanks you´re correct.

All day I have been saving with commas and this file for some reason saved without it  :o :-[

Now, I´m trying to update the info for the already entered products.

To do that I exported the products I entered manually to check their variables and copy to the Update CSV file.

I guess in general to do an update only the action and products.product_id columns are required, right?

So I added the columns I wanted to modify and to add (images URLs)

But AC is giving this message spite that columns added are copied verbatim from the export:
There are some errors. Show details
Unknown table: "" requested in relation to table products. Exit this node

I add a sample CSV file of 3 lines to have a look.

UPDATE: I tried also a file without the images URL but with added categories but I get error too. These are the variables I used for that:
products_to_categories[0].category_id
products_to_categories[1].category_id
products_to_categories[2].category_id
products_to_categories[3].category_id


Should to add more variables to have multiple categories added to a product?

Thanks and have a nice weekend!
Title: Re: products not showing after CSV import (But AC says it imported OK)
Post by: castigous on June 05, 2017, 09:46:42 AM
BUMP!

Please someone answer my previous post from friday

Thanks!
Title: Re: products not showing after CSV import (But AC says it imported OK)
Post by: castigous on June 05, 2017, 05:45:35 PM
Hello!??? Anybody!?

I managed to read again the documentation about importing and found out that I was missing a lot columns when trying to import the references for the images of each product.

Turns out that for each image there are about 8 columns needed to include in the CSV file.

resource_map[0].resource_id              = leave empty
resource_map[0].object_name            = products
resource_library[0][0].type_id            = 1
resource_descriptions[0][0][0].language_id      = 1  (the id of installed language)
resource_descriptions[0][0][0].name             =    anyname (usually imagefile name)
resource_descriptions[0][0][0].title            =    leave empty or fill if you need title
resource_descriptions[0][0][0].description      =    leave empty or fill if you need description for the resource
resource_descriptions[0][0][0].resource_path    =    somefolder/product_image_1.jpg

So I added the correct 40 columns --differing in their ([0][0][0]) numbering ([1][0][0], [2][0][0]... and so on) for up to 5 images max-- but when uploading the CSV file I got a Gateway error:

Gateway Timeout

The gateway did not receive a timely response from the upstream server or application.


So I modified the php.ini variables like this:
session.gc_maxlifetime = 12000000
magic_quotes_gpc = Off
safe_mode = Off
memory_limit = 300M
max_execution_time = 259200
default_charset = "UTF-8"
upload_max_filesize = 200M
session.use_trans_sid = Off
session.use_cookies = On
register_globals = Off
mysql.connect_timeout = 20
zend_extension=/usr/local/php55/lib/php/extensions/ioncube.so
zend_extension=/usr/local/php55/lib/php/extensions/ZendOptimizer.so


But still got the same message. Is there something I'm missing?

Thanks!