Page 1 of 1
Gold R9 Import Products question
Posted: Thu Oct 23, 2014 4:10 am
by AbleMods
I'm trying to update the catalog using a CSV that includes only the Sku and the field I want to update.
I've selected to match using Sku instead of matching with ProductId.
But the import stops telling me that 'Name' is a required field.
I don't understand why product "Name" is a required field? Technically, the only "required" field should be the field I selected for matching, no?
Looking at the source code, I don't see any obvious dependency on the product name being a part of the import CSV.
Re: Gold R9 Import Products question
Posted: Thu Oct 23, 2014 6:09 am
by Naveed
The name field is required for new products (inserts). However for update it should not be required technically, so you are right.
As a workaround, you can download the CSV data and include the name field in it, you do not need to change the name, and you can select a combination of sku and name as match fields.
Re: Gold R9 Import Products question
Posted: Thu Oct 23, 2014 6:55 am
by AbleMods
Thanks Naveed. I wrapped the required-fields check in an if() statement to check for the update-only mode. That seems to do the trick.
Re: Gold R9 Import Products question
Posted: Fri Dec 05, 2014 12:57 pm
by meer2005
I agree, I really don't like the requirement of the name field with updates only. What did you change to fix this?
Re: Gold R9 Import Products question
Posted: Fri Dec 05, 2014 1:04 pm
by rmaweb
I've recently been doing a lot of work with product exports/imports to get my catalog ready to use Google Shopping feed. So I've been doing a lot of updates to the products. I too dont understand why the name is required on the import if all Im doing is updating products. To me, its just an unnecessary load to the server when Im updating several thousand products and the name field has to get updated.
Re: Gold R9 Import Products question
Posted: Fri Dec 05, 2014 1:05 pm
by AbleMods
The modification requires full source code.
In Gold R9, open /DataExchange/ProductImportManager.cs and around line 206 locate this code:
Code: Select all
// ENSURE REQUIRED FIELDS
foreach (string requiredField in this.RequiredFields)
{
if (!csvToStandardFieldDic.ContainsValue(requiredField))
{
messages.Add("Required field \"" + requiredField + "\" is missing.");
}
}
And replace it with this code:
Code: Select all
// BEGIN MOD: AbleMods.com
// DATE: 10/23/2014
// only require fields if import is able to insert new products
// ENSURE REQUIRED FIELDS
if (importMode != ImportMode.UpdateOnly)
{
foreach (string requiredField in this.RequiredFields)
{
if (!csvToStandardFieldDic.ContainsValue(requiredField))
{
messages.Add("Required field \"" + requiredField + "\" is missing.");
}
}
}
// END MOD: AbleMods.com
Re: Gold R9 Import Products question
Posted: Fri Dec 05, 2014 1:10 pm
by meer2005
Too bad, don't have the source code. Maybe they'll release a patch. The import does default to "Match using ProductId only." only to throw an error after you start the import requiring the name field.
Re: Gold R9 Import Products question
Posted: Fri Sep 23, 2016 4:44 pm
by meer2005
What version was this fixed in? Any way to patch with R10? Or GoldR11SR1? I've tested in both and it's still requiring the NAME field even when "Match using ProductId only" is selected. Please advise as I need to update products using ProductId only.
Required field "Name" is missing.
Re: Gold R9 Import Products question
Posted: Sat Sep 24, 2016 3:25 am
by Katie
Hello,
This was fixed in Gold R12. The fix is in the source file - CommerceBuilder/DataExchange/ProductImportManager.cs
If you are unable or unwilling to upgrade, then it is a great idea to purchase the source code. I'd be happy to furnish the code changes, but you will need to make the change in the source code.
Thanks,
Katie