Gold R9 Import Products question

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Gold R9 Import Products question

Post by AbleMods » Thu Oct 23, 2014 4:10 am

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.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
Naveed
Rear Admiral (RADM)
Rear Admiral (RADM)
Posts: 611
Joined: Thu Apr 03, 2008 4:48 am

Re: Gold R9 Import Products question

Post by Naveed » Thu Oct 23, 2014 6:09 am

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.

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: Gold R9 Import Products question

Post by AbleMods » Thu Oct 23, 2014 6:55 am

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.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

meer2005
Captain (CAPT)
Captain (CAPT)
Posts: 245
Joined: Wed Feb 09, 2005 2:00 pm

Re: Gold R9 Import Products question

Post by meer2005 » Fri Dec 05, 2014 12:57 pm

I agree, I really don't like the requirement of the name field with updates only. What did you change to fix this?

rmaweb
Commander (CMDR)
Commander (CMDR)
Posts: 118
Joined: Fri Sep 10, 2010 9:41 am

Re: Gold R9 Import Products question

Post by rmaweb » Fri Dec 05, 2014 1:04 pm

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.
Ryan A.
Scott's Bait and Tackle
http://store.scottsbt.com
Work In Progress
Able Gold R10
Bootstrap 3.3

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: Gold R9 Import Products question

Post by AbleMods » Fri Dec 05, 2014 1:05 pm

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
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

meer2005
Captain (CAPT)
Captain (CAPT)
Posts: 245
Joined: Wed Feb 09, 2005 2:00 pm

Re: Gold R9 Import Products question

Post by meer2005 » Fri Dec 05, 2014 1:10 pm

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.

meer2005
Captain (CAPT)
Captain (CAPT)
Posts: 245
Joined: Wed Feb 09, 2005 2:00 pm

Re: Gold R9 Import Products question

Post by meer2005 » Fri Sep 23, 2016 4:44 pm

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.

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: Gold R9 Import Products question

Post by Katie » Sat Sep 24, 2016 3:25 am

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
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

Post Reply