nbrightproject / NBrightBuy

NBrightStore - E-Commerce for DNN (NBSv3)
http://www.nbrightproject.org/
21 stars 15 forks source link

Mods to get correct record when importing #123

Closed DNNMonster closed 7 years ago

DNNMonster commented 7 years ago

I was not getting any records returned from the NB3 clause. This should properly identify the PRD record during an import and allow for import updates.

leedavi commented 7 years ago

I don't think this is correct.

The idea of the import is that we link the products and identify them based on the product ref. This is the only way it will work if we're importing from a difference DB.

Also the GUIDKey cannot be linked to the product ref.

Normally all imported products will be created as new products. The only exception is when the product is matched by the product ref in both DB and import XML. But this is something the client must ensure is matching in their data.

DNNMonster commented 7 years ago

I believe the NB3 clause is failing because there is no language type being passed to the NBrightBuy_GetListLangNoPage proc during the import. Thus the change to an NB1 clause. Does the import work properly to update items for you? Wouldn't the ImportRecord method require passing the language type code to the ModCtrl.GetList in order to return records? It's not currently.

leedavi commented 7 years ago

OK I see what you mean. But using the GuidKey is not going to work for the "use case" of importing already existing products.

Maybe we can try using the data driectly.

NB1.XmlData.value('(genxml/textbox/txtproductref)[1]','nvarchar(max)')

Can you try that instead of NB1.GuidKey ?

DNNMonster commented 7 years ago

That should work. I tested it locally without problems.

leedavi commented 7 years ago

ok thx