function addToCart(nodeId){ var orderLine = TeaCommerce.addOrderLine(nodeId, 1, false); if (orderLine != null) { alert('Item was added to cart successfully!'); window.location = "/online-shop/cart"; } else { alert('Item was not added to cart!'); } return false; }
The cart page uses the MiniCart.xslt in a macro, but nothing is returned.
The xslt calls teacommerce:GetOrderXml()... The result is blank.
This will show you the server error that no doubt is happening. Maybe print out the responseText to your page instead. Then you can post it here and we can handle it.
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at umbraco.presentation.umbracobase.requestModule.invokeMethod(restExtension myExtension, Object[] paras) in d:\TeamCity\buildAgent\work\75c63e4d2422667e\umbraco\presentation\umbracobase\baseHttpModule.cs:line 154
INNEREXCEPTION:
System.ArgumentNullException: Value cannot be null.
at System.Threading.Monitor.ReliableEnter(Object obj, Boolean& lockTaken)
at System.Threading.Monitor.Enter(Object obj, Boolean& lockTaken)
at TeaCommerce.Data.Controllers.OrderController.AddOrderLine(Order order, Int32 nodeId, Decimal quantity, Boolean overwriteQuantity)
at TeaCommerce.Base.AddOrderLine(Int32 nodeId, Decimal quantity)]]></error>
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at umbraco.presentation.umbracobase.requestModule.invokeMethod(restExtension myExtension, Object[] paras) in d:\TeamCity\buildAgent\work\75c63e4d2422667e\umbraco\presentation\umbracobase\baseHttpModule.cs:line 154
INNEREXCEPTION:
System.ArgumentNullException: Value cannot be null.
at System.Threading.Monitor.ReliableEnter(Object obj, Boolean& lockTaken)
at System.Threading.Monitor.Enter(Object obj, Boolean& lockTaken)
at TeaCommerce.Data.Controllers.OrderController.AddOrderLine(Order order, Int32 nodeId, Decimal quantity, Boolean overwriteQuantity) in D:\Dokumenter\Visual Studio 2010\Projects\Tea Commerce\TeaCommerce\TeaCommerce.Data\Controllers\OrderController.cs:line 286
at TeaCommerce.Data.Controllers.OrderController.AddOrderLine(Order order, Int32 nodeId, Decimal quantity) in D:\Dokumenter\Visual Studio 2010\Projects\Tea Commerce\TeaCommerce\TeaCommerce.Data\Controllers\OrderController.cs:line 282
at TeaCommerce.Base.AddOrderLine(Int32 nodeId, Decimal quantity) in D:\Dokumenter\Visual Studio 2010\Projects\Tea Commerce\TeaCommerce\TeaCommerce\Base\Base.cs:line 75
I didn't check your version number. Should have done that. We had them fix the error in the 4.6 Alpha, but first in a later version. Get the latest version and it will work:
By the way. We are working on how to fix umbraco 4.5, so that we can have it working in that version as well. Until then you guys have to upgrade to latest 4.6 Alpha.
Have you checked which fields Tea Commerce try's to add from the product node. Sounds like it's trying to fetch a node property that does not exist. You can check that in the admin section under general settings.
Remember that all products must have a price. And that price's alias must be the same in the Tea Commerce admin.
@zac - i think you found the first bug in Tea Commerce - the system dosen't check if the VAT group isn't used and thats making the error - try specify a VAT group property on the product document type and specify that property name in "general settings" in Tea Commerce and try again
yep that was it, thanks. Product looks good by the way. I think you have the "right sized lego pieces" for an umbraco plugin. Now just need a few additional features: variations, digital downloads, discounts, affiliates .... :)
@zac We will very soon implement the posibility to hook into some (Don't know wich, where and how many yet) events, that will enable you to manipulate the order at different stages. We want to sell Tea Commerce in a Tea Commerce solution obviously, so we will need to e-mail the license along with the confirmation e-mail.
Products not adding to cart
I am using umbraco v 4.6.0.Alpha (Assembly version: 1.0.3926.24556).
I followed the steps show here: http://anders.burla.dk/umbraco/i-installed-tea-commerce-whats-next/
This is my javascript:
function addToCart(nodeId){
var orderLine = TeaCommerce.addOrderLine(nodeId, 1, false);
if (orderLine != null)
{
alert('Item was added to cart successfully!');
window.location = "/online-shop/cart";
}
else
{
alert('Item was not added to cart!');
}
return false;
}
The cart page uses the MiniCart.xslt in a macro, but nothing is returned.
The xslt calls teacommerce:GetOrderXml()... The result is blank.
Am I doing something wrong?
Hi Daniel,
No, you are doing it just right.Looks like we pushed the release out to hard. (Never release anything on a friday :D)
Would you try pasting this into your javascript:
TeaCommerce.subscribeToOnCartUpdateError(function (error) {
alert("Cart Error: \n" + error.responseText);
});
This will show you the server error that no doubt is happening. Maybe print out the responseText to your page instead. Then you can post it here and we can handle it.
Sorry about the inconvenience.
/Rune
Thanks for the fast reply.... I'll post back the response.
This is the resulting message:
Cart Error:
<error><![CDATA[MESSAGE:
Exception has been thrown by the target of an invocation.
STACKTRACE:
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at umbraco.presentation.umbracobase.requestModule.invokeMethod(restExtension myExtension, Object[] paras) in d:\TeamCity\buildAgent\work\75c63e4d2422667e\umbraco\presentation\umbracobase\baseHttpModule.cs:line 154
INNEREXCEPTION:
System.ArgumentNullException: Value cannot be null.
at System.Threading.Monitor.ReliableEnter(Object obj, Boolean& lockTaken)
at System.Threading.Monitor.Enter(Object obj, Boolean& lockTaken)
at TeaCommerce.Data.Controllers.OrderController.AddOrderLine(Order order, Int32 nodeId, Decimal quantity, Boolean overwriteQuantity)
at TeaCommerce.Base.AddOrderLine(Int32 nodeId, Decimal quantity)]]></error>
Super
Going to bed now. It's night in Denmark. We'll get back to you, hopefully tomorrow. But we might first have a new release on monday.
/Rune
Is there a workaround in the meantime?
Sorry about the late answer this time. Had to sleep for a while.
I will talk to Anders Burla today and see what we can do. Cannot promise anything though.
/Rune
Hi Daniel,
I have a build here that works for me.
http://www.teacommerce.dk/build/teacommerce_bin.zip
/Rune
Could you try looking in the database. See if theres an order, and see if that order has an orderline.
/Rune
Just downloaded the build... I'll check for the orderlines and post back.
Here is the resulting error... now that you included the pdb files we can see the line numbers:
MESSAGE:
Exception has been thrown by the target of an invocation.
STACKTRACE:
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at umbraco.presentation.umbracobase.requestModule.invokeMethod(restExtension myExtension, Object[] paras) in d:\TeamCity\buildAgent\work\75c63e4d2422667e\umbraco\presentation\umbracobase\baseHttpModule.cs:line 154
INNEREXCEPTION:
System.ArgumentNullException: Value cannot be null.
at System.Threading.Monitor.ReliableEnter(Object obj, Boolean& lockTaken)
at System.Threading.Monitor.Enter(Object obj, Boolean& lockTaken)
at TeaCommerce.Data.Controllers.OrderController.AddOrderLine(Order order, Int32 nodeId, Decimal quantity, Boolean overwriteQuantity) in D:\Dokumenter\Visual Studio 2010\Projects\Tea Commerce\TeaCommerce\TeaCommerce.Data\Controllers\OrderController.cs:line 286
at TeaCommerce.Data.Controllers.OrderController.AddOrderLine(Order order, Int32 nodeId, Decimal quantity) in D:\Dokumenter\Visual Studio 2010\Projects\Tea Commerce\TeaCommerce\TeaCommerce.Data\Controllers\OrderController.cs:line 282
at TeaCommerce.Base.AddOrderLine(Int32 nodeId, Decimal quantity) in D:\Dokumenter\Visual Studio 2010\Projects\Tea Commerce\TeaCommerce\TeaCommerce\Base\Base.cs:line 75
BTW.. no order or orderlines in the database.
I decompiled the Teacommerce.dll and found the CurrentOrderId property.
public static long? CurrentOrderId
{
get
{
if ((HttpContext.Current.Session != null) && (HttpContext.Current.Session["TeaCommerce_OrderId"] != null))
{
long orderId = (long)HttpContext.Current.Session["TeaCommerce_OrderId"];
Order order = OrderController.GetOrder(orderId);
if (order.IsOrder)
{
CurrentFinalizedOrderId = new long?(order.Id);
CurrentOrderId = null;
}
return (long?)HttpContext.Current.Session["TeaCommerce_OrderId"];
}
return null;
}
set
{
HttpContext.Current.Session["TeaCommerce_OrderId"] = value;
}
}
It appears that if the session value is null then it returns null instead of creating a new order id.
Where is CurrentOrderId set?
Thanks for the information Daniel. Will look into it tomorrow. As usual it's allmost bedtime here :)
It just strikes me that your base may not have access to session state. Would you check if your web config has:
Because that MIGHT be causing it, as we don't have the same problem in our version.
/Rune
Thanks for the information Daniel. Will look into it tomorrow. As usual it's allmost bedtime here :)
It just strikes me that your base may not have access to session state. Would you check if your web config has:
Because that MIGHT be causing it, as we don't have the same problem in our version.
/Rune
Oups, posted that twice :)
Yes.. web.config has the follows:
<modules runAllManagedModulesForAllRequests="true">
Daniel, are you running on Juno nightly build? Earlier has problems with base and session.
/jesper ordrup
Screen grab of version below...
Yes, thats it Jesper. Of cause.
I didn't check your version number. Should have done that. We had them fix the error in the 4.6 Alpha, but first in a later version. Get the latest version and it will work:
http://nightly.umbraco.org/umbraco%204.6/4.6%20Alpha/
/Rune
Thanks.. Thought I had gotten the latest from codeplex... I'll give it a go.
Where the fixes in the assemblies only?
Will make it easier if I only need to copy the bin folder.
Yes the bin files should be enough
That did it... it's working as expected now!
Thank you for you assistance...
That's super.
By the way. We are working on how to fix umbraco 4.5, so that we can have it working in that version as well. Until then you guys have to upgrade to latest 4.6 Alpha.
1.0.3958.21661 and forward should do it.
Who the f*ck stole my solution karma :-) (just kidding)
/j
Seems like I did. ;)
Thanks Daniel
Sorry Jesper... I did give you a High Five...
It was be better to give the Solved to Rune since his post contained the link... it'll help other users.
No problem - if you fix the file manager for 4.5 then :-)
Ahh.. not yet... trying to finish up some client work before I can venture back to that one.
Has this been fixed for Umbraco 4.5.2?
I am trying to evaluate this product and getting an error adding a product, slightly different error message though:
Cart Error:
<error><![CDATA[MESSAGE:
Exception has been thrown by the target of an invocation.
STACKTRACE:
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at TeaCommerce.Presentation.TeaCommerceBase.RequestModule.invokeMethod(restExtension myExtension, Object[] paras)
INNEREXCEPTION:
System.Xml.XPath.XPathException: Expression must evaluate to a node-set.
at MS.Internal.Xml.XPath.XPathParser.ParseNodeTest(AstNode qyInput, AxisType axisType, XPathNodeType nodeType)
at MS.Internal.Xml.XPath.XPathParser.ParseStep(AstNode qyInput)
at MS.Internal.Xml.XPath.XPathParser.ParseRelativeLocationPath(AstNode qyInput)
at MS.Internal.Xml.XPath.XPathParser.ParseRelativeLocationPath(AstNode qyInput)
at MS.Internal.Xml.XPath.XPathParser.ParseRelativeLocationPath(AstNode qyInput)
at MS.Internal.Xml.XPath.XPathParser.ParsePathExpr(AstNode qyInput)
at MS.Internal.Xml.XPath.XPathParser.ParseUnionExpr(AstNode qyInput)
at MS.Internal.Xml.XPath.XPathParser.ParseMultiplicativeExpr(AstNode qyInput)
at MS.Internal.Xml.XPath.XPathParser.ParseRelationalExpr(AstNode qyInput)
at MS.Internal.Xml.XPath.XPathParser.ParseEqualityExpr(AstNode qyInput)
at MS.Internal.Xml.XPath.XPathParser.ParseOrExpr(AstNode qyInput)
at MS.Internal.Xml.XPath.QueryBuilder.Build(String query, Boolean allowVar, Boolean allowKey)
at System.Xml.XPath.XPathExpression.Compile(String xpath, IXmlNamespaceResolver nsResolver)
at System.Xml.XPath.XPathNavigator.SelectSingleNode(String xpath)
at TeaCommerce.Data.Controllers.OrderController.AddOrderLine(Order order, Int32 nodeId, Decimal quantity, Boolean overwriteQuantity)
at TeaCommerce.Data.Controllers.OrderController.AddOrderLine(Order order, Int32 nodeId, Decimal quantity)
at TeaCommerce.Base.AddOrderLine(Int32 nodeId, Decimal quantity)]]></error>
TeaCommerce is only working on the latest 4.6.alpha version.
Luckily that is wrong. This thursday we released the 1.0.0 version and that one runs on 4.5. So go and get it :)
We have set us up the DEMO site.
http://demo.teacommerce.dk/
We demoed it yesterday at the http://umbracodkfestival.dk
Brilliant! That'll make my client happy!
Hi zac
Have you checked which fields Tea Commerce try's to add from the product node. Sounds like it's trying to fetch a node property that does not exist. You can check that in the admin section under general settings.
Remember that all products must have a price. And that price's alias must be the same in the Tea Commerce admin.
/Rune
Yes the properties are all set according to the blog post by Anders.
I have productName and productNumber set in the Order Lines setttings and then productPrice set in the currency for USD, which is the default.
Using a fresh install of umbraco 4.5.2 and using the 1.0.0 version of teaCommerce.
@zac - i think you found the first bug in Tea Commerce - the system dosen't check if the VAT group isn't used and thats making the error - try specify a VAT group property on the product document type and specify that property name in "general settings" in Tea Commerce and try again
yep that was it, thanks. Product looks good by the way. I think you have the "right sized lego pieces" for an umbraco plugin. Now just need a few additional features: variations, digital downloads, discounts, affiliates .... :)
How are variations handled in TeaCommerce?
@zac We will very soon implement the posibility to hook into some (Don't know wich, where and how many yet) events, that will enable you to manipulate the order at different stages. We want to sell Tea Commerce in a Tea Commerce solution obviously, so we will need to e-mail the license along with the confirmation e-mail.
Variants are allready supported in a limited amount. Read about it here: http://rune.gronkjaer.dk/en-US/2010/11/10/umbraco-e-commerce-webshop/
Discounts and affiliates, we have no plan on implementing. We will though be open to suggestions but there is no budget for it at present.
/Rune
ill ask some more about lisencing in another thread.
is working on a reply...