Product Import Error/issue

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
I've imported the product in the back office manually, exported it and it re-imports fine as a stand alone product once I've changed the image path back to the file location.  The problem is when I copy and paste it exactly as it is, i get the following error with nothing in the log:

This www.cbauto-solutions.com page can’t be found
No web page was found for the web address: http://www.cbauto-solutions.com/Admin/Product/ImportExcel
Search Google for cb auto solutions Admin Product Import Excel
HTTP ERROR 404

The products then actually appear, but none of the images are generated with them.  The only difference to this product compared to the others is that this one doesn't have any 'product attributes' with it where products with both 'product attributes' & 'Specification attributes' import just fine.  There is also no system log error generated with this.

Tried clearing the pictures database, reseeding to 0, cleared all the images off the server and googling the issue all to no avail.

Thanks, Paul
6 years ago
see this settings https://ibb.co/kE0DoH


Please check your settings for saving pictures whether to DB or File System.That might be the reason that affecting your import.
5 years ago
[email protected] wrote:
I've imported the product in the back office manually, exported it and it re-imports fine as a stand alone product once I've changed the image path back to the file location.  The problem is when I copy and paste it exactly as it is, i get the following error with nothing in the log:

This www.cbauto-solutions.com page can’t be found
No web page was found for the web address: http://www.cbauto-solutions.com/Admin/Product/ImportExcel
Search Google for cb auto solutions Admin Product Import Excel
HTTP ERROR 404

The products then actually appear, but none of the images are generated with them.  The only difference to this product compared to the others is that this one doesn't have any 'product attributes' with it where products with both 'product attributes' & 'Specification attributes' import just fine.  There is also no system log error generated with this.

Tried clearing the pictures database, reseeding to 0, cleared all the images off the server and googling the issue all to no avail.

Thanks, Paul


Hi Paul/all,

Just an update on this error. This fix is for V4 of NOP, I have not tested it in earlier versions.

I found the problem occurs when you are importing multiple items using an excel spreadsheet where some or all the Products have Product Attributes or Specification Attributes.

It actually fails at the point it tries to write the Product Attribute Mapping record.

If you are running the import, Products with no Attributes or specification attributes import with no error, the first product found with Attributes or specification attributes also imports with no errors.

It is any subsequent products that have Attributes or specification attributes that causes the error.

For anyone needing a fix for this go to NOP.Services/ExportImport/ImportManager.cs

Find the ImportProductsFromXlsx method at line 718 then go down to line 950.

At line 950 the loop that writes the import starts with line 952 the beginning of the code that manages the attribute & specification attribute import, at the end of the 'if' statement line 984 is the line that reads the spreadsheet row for a product.


     manager.ReadFromXlsx(worksheet, iRow);


I found that by adding code that reinitialized the "typeOfExportedAttribute" variable either before or after the product read fixes it error and results in the excel import with product attributes & specification attributes working as it should.


     typeOfExportedAttribute = ExportedAttributeType.NotSpecified;
     manager.ReadFromXlsx(worksheet, iRow);


Hope this helps

Garry
5 years ago
Thanks Garry,

Only just seen your reply.  I did actually get the import feature from an excel file to work so didn't have to implement the code, however, I've since started another site which exhibits exactly the same as your'e describing - I just can't find the NOP.Services/ExportImport/ImportManager.cs file.  Was this for nop 4.2?

I'm not a webdev in any sense, just someone that's self taught from trial and error, but somethings elude me!  It's kind of a miracle my first site:   https://www.cbauto-solutions.com/ works at all!

Thanks, Paul
5 years ago
[email protected] wrote:
...can't find the NOP.Services/ExportImport/ImportManager.cs file...


You need the Source Code.  Look in folder \Libraries\Nop.Services
5 years ago
[email protected] wrote:
Thanks Garry,

Only just seen your reply.  I did actually get the import feature from an excel file to work so didn't have to implement the code, however, I've since started another site which exhibits exactly the same as your'e describing - I just can't find the NOP.Services/ExportImport/ImportManager.cs file.  Was this for nop 4.2?

I'm not a webdev in any sense, just someone that's self taught from trial and error, but somethings elude me!  It's kind of a miracle my first site:   https://www.cbauto-solutions.com/ works at all!

Thanks, Paul


Hi Paul/New York,

When I did it I was working with NOP V4, I haven't downloaded V4.2 so will go with New York's location for the source file for it (TA for future reference).

FYI I also needed to use Attribute Combinations which you can not do with the Excel import ATM so have done my own import/write stuff that does all that.

Its only a proto type atm for a client here in Aust but the next revision will be an application that in effect integrates and Australian Point Of Sale app called Retail Manager (from MYOB) with NOP.

Soz I can't help with V4.2 atm.

Cheers
Garry
5 years ago
Is there a way to fix this without the source code?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.