Developer forum

Forum » Ecommerce - Standard features » Error when defining variants

Error when defining variants

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I have a plain vanilla 9.8.9 solution with clean Rapido, no data.

I have defined 2 Variant groups and their corresponding options.

I have tried defining variants manually (from PIM section) and I got a bunch of errors.

First, after I have added the first Variant group, I have received an Alert:

Cannot read property 'get_container' of null

After clicking OK, another error message was displayed. Unfortunately, I could not copy the message. It was something related to some AJAX call.

Unexpected character encountered while parsing value: P. Path '', line 0, position 0.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: P. Path '', line 0, position 0.

Source Error:

 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:
 

[JsonReaderException: Unexpected character encountered while parsing value: P. Path '', line 0, position 0.]
   Newtonsoft.Json.JsonTextReader.ParseValue() +1095
   Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, JsonContract contract, Boolean hasConverter) +100
   Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) +698
   Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) +276
   Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) +165
   Newtonsoft.Json.JsonConvert.DeserializeObject(String value, JsonSerializerSettings settings) +53
   Dynamicweb.Controls.EditableList.get_DataSource() +297
   Dynamicweb.Admin.eComBackend.EcomProductVariants.AddVariantOptions() +195
   Dynamicweb.Admin.eComBackend.EcomProductVariants.Save() +522
   Dynamicweb.Admin.eComBackend.EcomProductVariants.HandleCommands() +95
   Dynamicweb.Admin.eComBackend.EcomProductVariants.Page_Load(Object sender, EventArgs e) +799
   System.Web.UI.Control.OnLoad(EventArgs e) +106
   System.Web.UI.Control.LoadRecursive() +68
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3785

Unfortunately, this prevents me from being able to manually add Variants.

Anybody else experiencing similar behavior?

Thank you,
Adrian


Replies

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

One more notable mention. The Variant Groups and Variant options have been Imported and the IDs are not standard.

Instead of VARGRPXX I have used 6KTSKRDIAM and 6KTSKRLNGD and for Options I have used DIAM03 instead of VOXX.

It seems to work well with definitions defined through the interface but not with those imported.

I gave compared the records in the database for both VariantGroups and Variant options and they seem pretty fine. I don't see any difference between the imported ones and the manually added ones except for the rules used for defining the IDs of the Groups and Options.

Thank you,
Adrian

 
Morten Snedker Dynamicweb Employee
Morten Snedker
Reply

Hi Adrian,

Your error message states an invalid character at the very beginning (line 0, position 0). And if you have no trouble using the UI it would seem that some nitty-gritty has been imported. And based on the stack trace I would suggest reviewing the id's of your variant options.

Perhaps you could seek out one specific option, remove it from the database, and reimport just that one option. If it still fails then try and manipulate the id manually, and see if that makes a difference.

BR
Snedker

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Morten,

Thank you very much for your reply.

It is true there may have been some weird characters. However, they were not visible in the database nor in my excel file.

I was worried there might be some record of the manually added options and I was not aware of.

I have defined both of them manually and have reimported the options and now they seem pretty fine.

Thank you,
Adrian 

 

You must be logged in to post in the forum