how to upload an image by excel file in nopcommerce
For those of y'all interested, I have successfully integrated a bulk file upload into the Excel Import function of NopCommerce v1.8.
* The code will import up to 3 pictures per Production and volition insert the default picture into the ProductVariant.
* It will also (finally) import the item name into the ProductVariant.
* Information technology will set the ProductVariant "Published" to false for an Inventory number 1 or 0 to reduce backorder hassles.
* The import office will update whatever record that yous have already placed into the database (without changing the flick)... This is a quick and easy way to update pricing and stock quantity without having to build a custom Web Service.
There are two requirements for the excel spreadsheet (and I haven't updated the excel export yet):
ane. You must include the file location for the 3 images that you lot would like to upload.
I have created a script to automatically create the image url based on the sku.
You lot can automatically identify the url for the 3 images equally the script will check to see if the paradigm exists...
two. You should proper noun your production photos with the same sku as your particular. This is a naming convention... and makes administration so much easier. Since the Excel sheet needs a sku anyway all you have to do is create a script to assign the url based on the product sku and add together the directory and file extension.
I would like to share this with everyone so please let me know how I can do this.
I would like to run across if I tin can showtime some collaboration in getting this every bit a permanant part of the program and expand on it.
For example, though this works perfectly for each item having its own sku and substantially being its own production... the logic of the shopping cart does not make it easy. For instance, I have an item that comes in three colors. Each color has its own sku and its ain Stock Quantity. This is all tracked inside the ProductVarient. The product is like the Parent for the three colors. Because of this logic and the mode that the warehouses proper name the items (ex. Pen / Bluish, Pen / Black, Pen / Red, etc.) it is incommunicable to generate a script to seperate 17,000 items into a parent grouping and assign the correct Item Template. That means that I would have to get in and manually assign the first item has a Product and then alter the rest to ProductVarients... Non Desired.
The good thing is that the bulk upload solitary has estimated to save me over v YEARS of work (estimated by bookkeeping for the time to upload one pic per item).
I'm very interested seeing how you did this and will send you a PM for more info. Promise I tin help you with this.
I also would beloved to use your script. I have been asking how to do this but have not had much luck. Probably due to me non having a clue how to utilise VWD or code in C# though!
Hopefully you tin transport me a copy of your script and also that information technology won't be to circuitous for me to implement...!
Will send you PM.
Thanks
Thanks to ajhvdb's detailed request, I have placed all the required files in a bureaucracy (simply similar in the program) of folders to be placed in the appropriate location. I have also included a copy of the excel spreadsheet with the 3 actress spots for pictures and test data inserted. Finally, I included the bodily photos for each production.
Instead of emailing everyone directly... I have placed all the files into a zero folder which tin be downloaded from:
http://brettspencer.proper noun/files/nopCommerce_Products_Images_Import.zip
Make certain to save a copy of your original .cs files before overwriting them, merely in case yous want to return to the default build.
Also, if you DO Non Accept VISUAL STUDIO 2010 (you don't take admission to the Library directory/folder), I have included the bin folder to supplant yours within your website. This should work with no issues as it has been compiled with new script. Delight permit me know if information technology doesn't.
<img src="http://brettspencer.name/files/nopCommerceEXcelUploadFileExampleImg.JPG" alt="Excel Image Example" />
Sad if this sounds dumb! merely what am I supposed to modify the images location to?
I accept uploaded the bin folder and pictures binder to my web server root and imported your xls to my site. However the images are non populating. I have tried "pictures" in place of your "j:\"
Please help...!
Thanks
Thank you very much for the sample. I'thousand new to nop but it seems to be designed very modulair.
I think i tin can create a bulk import and export with the im/export of pictures files.
Could y'all help me (and others) with some statements..! (the numbers 3 and vii are random)
1.
A product has at to the lowest degree 1 variant.
1a.
The variant code tin can be empty
2.
A product can have 3 or more variants
three.
A product tin can have 7 or more than pictures
4.
1 of those vii picturesid's is filled into the 1st variant
v.
3 pictureid'southward filled into the 3 variant records are from the 7 pictures from the product
six.
I promise at that place is only 1 or a few getpictures methods..which ones?
Glenn...
The pictures should be located at a location on your local bulldoze. NopCommerce automatically grabs those pictures and either sends them to the database or the spider web directory ("images") depending on what you lot chose for your media in the "All Settings" in your Assistants portal.
So Say... you have pictures on your c drive, in a folder called pictures. You would utilize the excel file - where you lot see that I have "j:\" and you would identify c:\pictures in that spot. The excel formula will automatically generate the correct location for the three pictures in the excel file.
ajhvdb
I didn't read this post in total simply saw the "random number of pictures to import - ie 7". I take an idea for this already only will need a lilliputian fourth dimension to code and implement before sharing. This could exist every bit easy as getting a user input for the max number of pictures to import and then sending the url as a string formula with the directory that the pictures are located at and the max number of photos. The way I currently have it, it will check to see if pictures exist, and so theoretically, this could be an like shooting fish in a barrel update.
I will study the rest of your response shortly and post in detail. Thanks.
Could you help me (and others) with some statements..! (the numbers 3 and 7 are random)
i.
A production has at to the lowest degree i variant.
nopCommerce already does this automatically. Each product is its own variant - that is why I updated the import to include the production name in the varient name.
1a.
The variant lawmaking can be empty
Non certain what you mean here... this is impossible as the varient holds crucial information for the product such as sku, pice, and stock.
ii.
A product tin can have iii or more variants
This is already true. A product tin take an infinite amoutn of varients. But when y'all import using Excel or XML there is no way to assign a varient to a product. You would have to go in and manually assign each production varient to a product ID for them to become a varient. I am currently working on a script to this with my 20,000 products then that I can reduce the amount of time I need to this manually. Unfortunately I will not exist able to share the script as information technology manipulates strings with specific words that are pertinent to my products. Unless the whole structure of Products and Varients changes, I don't believe in that location will always be an like shooting fish in a barrel way to exercise this.
iii.
A production can have 7 or more than pictures
This is possible - see my previous post.
iv.
Ane of those 7 picturesid's is filled into the 1st variant
My script already does this. It inserts the default picture into the varient.
5.
3 pictureid's filled into the 3 variant records are from the 7 pictures from the product
In club to do this, there will accept to exist some major changes to the nopCommerce program. 1. a new picture show viewer will have to be built. I do run across where this could be handy though. For instance I have a Production that has three sizes (which would be the three varients). Each varient or size has three colors. So theoretically I could have the 3 pictures for each varient. This isn't impossible, simply would take quite a flake of work.
two. a new column volition have to exist inserted into the product_picture tabular array to include a production varient id mapping.
3. all of the datatable and datagrids will take to updated every bit well as all of the insert, and update scripts.
6.
I hope there is only 1 or a few getpictures methods..which ones?
Aye. and if nosotros went to a variable number of pictures to import it would be a loop through each picture using only 1 insert method.
Practiced input, thank you.
My statements were written down, from looking at your lawmaking. I do non want to modify anything in nop. Thanks for your time helping me agreement the structure of nop.
ane.
Q.
The variant code can be empty
A.
Not sure what you mean here... this is incommunicable every bit the varient holds crucial information for the product such as sku, pice, and stock.
Q.
The value of the variant code tin exist empty? There is alway a ane to 1 relation from product to variant. And if at that place are 10 products, there are exactly ten variant records? or more of course, if a product has 2 variants
2.
Q.
A product can have three or more variants
A.
This is already true. A product can take an space amoutn of varients. Merely when you import using Excel or XML there is no manner to assign a varient to a production. Y'all would take to go in and manually assign each product varient to a product ID for them to become a varient.
Q.
The variant has a productid and variantid
Product with id = 1, has variant id = 100, and product id = 1
Product with id = 2, has variant id = 101, and product id = two
Production with id = 2, has variant id = 102, and product id = 2
isn't this how it's working now?
four.
Q.
Ane of those 7 picturesid's is filled into the 1st variant
A.
My script already does this. It inserts the default picture into the varient.
Q.
How do you know what'due south the default?
Source: https://www.nopcommerce.com/en/boards/topic/6262/ive-integrated-an-excel-bulk-file-upload-w-pictures-images
0 Response to "how to upload an image by excel file in nopcommerce"
Post a Comment