I am sure you have heard this a thousand times, but I have tried searching the forums on this and cannot find anything to help. I am looking for a way to upload and add my pictures to my products, but not have to do them one by one as I will have many hundreds.
I found this post that looked promising, but the original poster never replied with the code/instructions - https://www.nopcommerce.com/boards/t/200/import-products.aspx
I have been editing my database directly to add and configure categories and manufacturers and this works really well. Also, I have been adding my products via an xls import, and this too works really well. I also noticed that even if I want to modify any or all of my product details all I have to do is modify the original xls sheet and re-import. Works really well!
So just automating the pictures now. If I can get this down my store will work a treat. As the guy mentions in the above post, he managed to get the pictures in by naming them the same as the sku + .jpg. I have actually already done this as I thought it would be a good way of identifying what picture belongs to what product if I have to manually add each picture to each product.
sorry for being such a nob at this, but I have no experiencing when it comes to this type of coding.
1. What exactly do I need to do with your code? I have found
var productVariant = ProductManager.GetProductVariantBySKU(SKU); if (productVariant != null)
But where do I copy your code to, I am thinking just replace "null" with it?
2. The file that contains this, importManager.cs is not on my website. But I found it in the source files on my computer, but the one with source code. I uploaded the "no source code" files to my server when I installed. Where should I put this file on my server?
3. lastly! There is no Images directory in my Admin folder on my site, should I just create one?
1. What exactly do I need to do with your code? I have found
var productVariant = ProductManager.GetProductVariantBySKU(SKU); if (productVariant != null) But where do I copy your code to, I am thinking just replace "null" with it?
Don't replace. You should put the code inside this "if" block. The block starts with if (productVariant != null){ .... and ends with }. you should put the code just before the closing }
glennlawr wrote:
2. The file that contains this, importManager.cs is not on my website. But I found it in the source files on my computer, but the one with source code. I uploaded the "no source code" files to my server when I installed. Where should I put this file on my server?
You need to compile the application and then upload the Nop.BusinessLogic.dll, Nop.BusinessLogic.pdb and Nop.BusinessLogic.xml located in the bin folder to you bin folder website.
glennlawr wrote:
3. lastly! There is no Images directory in my Admin folder on my site, should I just create one?
You need to create the folder.
Also you can change the part of the code that says png to jpg to suport you files.
when you say "compile the application" I gather this is done in Visual Basic. I am not using this, as I have no knowledge of this application whatsoever. I have created this store just via my web server. Is there another way to sort these files?
Also, I put the code from the ImportManager file here - http://www.test25.net/myimportmanager.html
The "if" block checks for a condition. In this case it is checking if the product already exists in the database. The first part of the if is the case where the product exists, and will update the product with the new values. If you put the code in this first part every time you update a product, it will insert the picture of the product... So you need to put the code in the "else" part of the "if" block... also don't forget the try at the beginning.
And you need visual studio (express is free.) to compile.
If you are using nop 1.6 or less you can use Microsoft Visual Web Developer 2008 Express Edition
If using 1.7 or grater you need Microsoft Visual Web Developer 2010 Express.
so does this mean I need to start from scratch with my website, or can I just download the files from my webserver and compile these in Visual Web Developer?
I am on v1.8
And code like this then - http://www.test25.net/myimportmanager.html
No you don't need to start the site again, just download the nop version with source code and open in visual studio. make the changes, compile, and upload Nop.BusinessLogic.dll, Nop.BusinessLogic.pdb and Nop.BusinessLogic.xml from the bin folder to the bin folder in you site.