Trying to implement add to cart functionality with Razor but getting the following error when clicking add to cart
Cart Error: <error><![CDATA[MESSAGE: Input string was not in a correct format. STACKTRACE: at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) at System.String.System.IConvertible.ToInt32(IFormatProvider provider) at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) at TeaCommerce.Presentation.TeaCommerceBase.RequestModule.invokeMethod(restExtension myExtension, Object[] paras) INNEREXCEPTION: ]]></error>
Earlier today we found a bug in the starter kit that in IE9 it didnt select the variant in the dropdown list - that bug has been fixed - was both a thing in an xslt and in the javascript of the starter kit. Could you try and not use variants and see if that helps?
Razor script add to cart issue
Trying to implement add to cart functionality with Razor but getting the following error when clicking add to cart
Here is the Razor script
Any ideas?
Using IE9?
Using Google Chrome and Firefox, will check IE now - same with IE. In case it helps, currently running Umbraco locally
Earlier today we found a bug in the starter kit that in IE9 it didnt select the variant in the dropdown list - that bug has been fixed - was both a thing in an xslt and in the javascript of the starter kit. Could you try and not use variants and see if that helps?
I removed the variant code but still experiencing the same issue.
Noticed in the starter kit product.xslt, product price is stored with the following line
Does this make a difference? If so, how can that be converted into Razor script?
Could it be that the nodeId input field isnt outputtet?
Found the reason - product.xslt has this code <div class="product" productId="{@id}"> - which I didn't have
So added the following to the Razor code - <li class="product" productid="@item.Id"> - problem solved.
Thanks for your assistance Anders - helped point me in the right direction.
is working on a reply...