Hi hrdfsique,
I have been using your script since we first spoke a while back, still with the first original files you posted. But I have a couple of questions if you don't mind.
1. Has there been any update to your files? I seen some posts you made advising about been able to add more than 3 pictures here -
hrdfsique wrote:ajhvdb...
here is updated code for the ImportManager to locate up to 11 pictures for each product and insert. You notice that I hard coded in the variables. It works like a charm.
Now if some could could code in the user input for the file location and the number of pictures to find while I try to find a solution for what's happining with Glenn and the hosted environment. We're Golden!
here is the code:
//Add the picture insert here so we can enter the default image (picture.PictureId) into Variant
string directory = "c:\\product_pics\\";
int i = 0;
int picID = 0; //set a variable when inserting picture and assign to productVariant
do
{
if (product != null)
{
string image = null;
if (i == 0)
{
image = directory + SKU + ".jpg";//create default image - which has no underscore and number.
}
else
{
image = directory + SKU + "_" + i + ".jpg";
}
if (image != null)
{
if (File.Exists(image))
{
Picture picture = PictureManager.InsertPicture(PictureManager.GetImageBytes(image), PictureManager.GetContentType(image), true);
if (picture != null)
{
ProductPicture productPicture = ProductManager.InsertProductPicture(product.ProductId, picture.PictureId, 1);
picID = picture.PictureId;
}
}
}
i++;
}
}
while (i <= 4); //Determines the amount of pictures to search for.
and one about mapping the product to the category here -
hrdfsique wrote:Hi,
I tried to use this (did my build using all files specified in the download). Getting an exception while importing a file
Column 'VendorID' does not belong to table Products.
I am using 1.80
You must have been missing the "Vendor" Column in your excel file. This allows you to "map" all of your products to their respected Manufacturer while inserting - and the code looks for it.
2. If I wanted to update my store to v1.9 do you think this will stil work?
The way I am using your script is, I still have all my original install files on my live web server. I copied these files to my local machine and replaced the relevant bin files with yours. Then when I want to do an upload I point my local connectionstrings file to my live database, load my site in VWD and login to the admin pannel and do the import. This then updates my live site.
Any help would be great...