Developer forum

Forum » Integration » Add Group reference to Product by GroupNumber

Add Group reference to Product by GroupNumber

Anders Ebdrup
Anders Ebdrup
Reply

Hi Dynamicweb,

 

Will it be possible to have extended the below search in the EcomProvider with: or GroupNumber= '" + group + "':

 

private void AddGroupReferenceToProduct(string productID, string languageID, string group, string sorting, string primaryGroup)

        {
            bool isPrimary = (group == primaryGroup) ? true : false;
            group = group.Replace("'", "''");
            DataRow[] groupRows = ExistingGroups.Select("GroupID='" + group + "' or GroupName= '" + group + "'");
            if (groupRows.Length > 0)
            {
                AddGroupReferenceToProduct(productID, (string)groupRows[0]["GroupID"], sorting, isPrimary);
            }
            else
            {
                groupRows = DataToWrite.Tables["EcomGroups"].Select("GroupID='" + group + "' or GroupName = '" + group + "'");
                if (groupRows.Length > 0)
                {
                    AddGroupReferenceToProduct(productID, (string)groupRows[0]["GroupID"], sorting, isPrimary);
                }
                else
                {
                    LastGroupId = LastGroupId + 1;
                    var newGroup = DataToWrite.Tables["EcomGroups"].NewRow();

                    newGroup["GroupID"] = "ImportedGROUP" + LastGroupId;
                    if (string.IsNullOrEmpty(languageID))
                    {
                        newGroup["GroupLanguageID"] = _defaultLanguageId;
                    }
                    else
                    {
                        newGroup["GroupLanguageID"] = languageID;
                    }
                    newGroup["GroupName"] = group;
                    DataToWrite.Tables["EcomGroups"].Rows.Add(newGroup);
                    AddShopReferenceToGroup("ImportedGROUP" + LastGroupId, DefaultShop, 0);
                    AddGroupReferenceToProduct(productID, (string)newGroup["GroupID"], sorting, isPrimary);
                }
            }
        }

 

If possible, then please also add to the latest version of 8.9.

 

Thank you very much,

Anders


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Anders,
yes, tfs 42702 created.
Regards, Dmitrij

 
Anders Ebdrup
Anders Ebdrup
Reply

Sounds great - will it be released in: 8.9.2.16?

 
Anders Ebdrup
Anders Ebdrup
Reply

Hi Dynamicweb,

 

Is this released yet for 8.9.2.x?

 
Nicolai Pedersen
Reply
This post has been marked as an answer

It is in a 8.9.2 release with a release date after 06-12-2017 14:05:56, that would be 8.9.2.17

BR Nicolai

 

Votes for this answer: 1

 

You must be logged in to post in the forum