Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Morten Christensen 61 posts 215 karma points
    Feb 01, 2012 @ 21:44
    Morten Christensen
    0

    Error in view order

    Hi!

    When I try to view a order in "New Orders" (by clicking on the ordername), I get a .net error:

    The '$' character, hexadecimal value 0x24, cannot be included in a name.

    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: System.Xml.XmlException: The '$' character, hexadecimal value 0x24, cannot be included in a name.

    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:

    [XmlException: The '$' character, hexadecimal value 0x24, cannot be included in a name.]
       System.Xml.XmlConvert.VerifyNCName(String name, ExceptionType exceptionType) +5154832
       System.Xml.Linq.XNamespace.GetName(String localName, Int32 index, Int32 count) +150
       System.Xml.Linq.XName.Get(String expandedName) +213
       TeaCommerce.Data.OrderProperty.GetXElement() +40
       System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +238
       System.Xml.Linq.XContainer.AddContentSkipNotify(Object content) +424
       TeaCommerce.Data.OrderLine.GetXElement() +2524
       System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +238
       System.Xml.Linq.XContainer.AddContentSkipNotify(Object content) +424
       System.Xml.Linq.XContainer.Add(Object content) +59
       TeaCommerce.Data.Order.GetXElement() +3435
       TeaCommerce.Data.Order.UpdateOrdersXmlCache() +239
       TeaCommerce.Data.Order.Save() +9717
       TeaCommerce.Admin.Umbraco.plugins.TeaCommerce.Orders.EditOrder.DoPaymentProviderAction(Func`3 callback) +480
       TeaCommerce.Admin.Umbraco.plugins.TeaCommerce.Orders.EditOrder.OnLoad(EventArgs e) +148
       System.Web.UI.Control.LoadRecursive() +71
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3048
    


    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

     

    I'am using Paypal as payment provider, and USD in currency. The only 2 properties I'am sending to paypal is productName, and productNumber.

    Have someone seen this error before?

    /Morten

  • Anders Burla 2560 posts 8256 karma points
    Feb 01, 2012 @ 21:48
    Anders Burla
    0

    Hi Morten

    Welcome to the Umbraco community! Could you try and check your orderline properties in your DB. Does any of them start with a $ - then you have the answer to your problem :) You can also try when you have added your product to your cart and say "TeaCommerce.getOrder()" in FireBug and see the output and see if any of the orderline properties isnt formatted correctly.

    Kind regards
    Anders

  • Morten Christensen 61 posts 215 karma points
    Feb 01, 2012 @ 22:00
    Morten Christensen
    0

    Hi Anders,

    Tak for hurtig respons! :)

    I've checked the DB, but can't find anything starting with $. But there are a Alias in OrderLineProperty called ctl00$ctl00$ContentPlaceHolder1$SignupMinicart1$TextboxCampaign. Could it be this?

    My order in firebug looks correct.

    Morten

  • Morten Christensen 61 posts 215 karma points
    Feb 01, 2012 @ 22:05
    Morten Christensen
    0

    Ok, I checked firebug again..

    The property TotalPriceFormatted has a value with  "$24.00", and  TotalVATWithoutFeesFormatted is "$0.00". Could it be this?

     

  • Anders Burla 2560 posts 8256 karma points
    Feb 02, 2012 @ 08:17
    Anders Burla
    0

    Hi Morten

    The problem is the ctl00$ctl00$ContentPlaceHolder1$SignupMinicart1$TextboxCampaign orderline property (the prices is no problem). How did you add these orderline properties? Do you use the Tea Commerce starter kit?

    Kind regards
    Anders

  • Morten Christensen 61 posts 215 karma points
    Feb 02, 2012 @ 08:34
    Morten Christensen
    0

    No I don't use the starter kit, becouse I had a complete umbraco site, before I installed tea commerce.

    Don't know why that property is there.. Somehow the loginbox is there too (ctl00$ctl00$LoginViewUser$LoginBox$Password).

    This is the test code I use:

    var props =
    {
    firstName: "morten",
    lastName: "chr",
    address: "New york",
    email: "[email protected]"
    };

    TeaCommerce.updateOrderProperties(props);
    TeaCommerce.setPaymentMethod(1, false);
    TeaCommerce.goToPayment();

  • Rune Grønkjær 1372 posts 3103 karma points
    Feb 02, 2012 @ 08:45
    Rune Grønkjær
    0

    Hi Morten,

    There's a few things to this problem! Might not be all of them in your specific case.

    1. You cannot have a ASP.NET form tag around your Tea Commerce code, for the JavaScript fallback to work.
    2. You cannot have ASP.NET fields in your Tea Commerce form (obviously because of the first one)
    3. What happens when you submit your form to the AddOrderLine url is, that ALL fields posted is treated as order line properties and thus added to the order line. Your .NET fields included, and their names will destroy the XML output of the order.

    To fix it you must clean your html for ASP.NET stuff. Also you might have a JavaScript error that makes the JavaScript fallback form post kick in.

    I hope I have written something that will help you in the right direction. Feel free to ask about any suplementary stuff. :)

    /Rune

  • Morten Christensen 61 posts 215 karma points
    Feb 02, 2012 @ 09:44
    Morten Christensen
    0

    Hi Rune,

    Thanks for your reply!

    I  can see the problem with the web form... The thing is that my button have to be in the webform. Is there anyway to "clean up" the html before post? I can see that viewstate is posted too. Or can I create a goToPaymant in codebehind?

     

    Morten

  • Rune Grønkjær 1372 posts 3103 karma points
    Feb 02, 2012 @ 13:10
    Rune Grønkjær
    0

    Hi Morten,

    The xslt extension method GetPaymentForm will create the form for you and the parameter string you send with it should be the html for the button you would like to use. You can do that in your code behind.

    Note that the method will return you a full form. You should still not have an ASP.NET form around.

    /Rune

  • Morten Christensen 61 posts 215 karma points
    Feb 03, 2012 @ 22:19
    Morten Christensen
    0

    Hi again,

    I found out that the goToPaymant() js function is creating a form element out side the default .net form. So the form post to paypal isn't nested in the .net form. But I can see that the login control, and viewstate is still captured, and saved in db.

    I'am not using any xslt on my site. It's only masterpages and usercontrols.

  • Anders Burla 2560 posts 8256 karma points
    Feb 06, 2012 @ 11:58
    Anders Burla
    0

    Hi Morten

    Do you have a test url where I can see your html and see how its structured?

    Kind regards
    Anders

  • Morten Christensen 61 posts 215 karma points
    Feb 06, 2012 @ 12:11
    Morten Christensen
    0

    Hi Anders,

    Do you have a mail that I can send the link to? The site is still in beta, so I can't post it here.

  • Anders Burla 2560 posts 8256 karma points
    Feb 06, 2012 @ 12:12
    Anders Burla
    0

    info(at)teacommerce.dk

  • Morten Christensen 61 posts 215 karma points
    Feb 06, 2012 @ 16:53
    Morten Christensen
    0

    Problem solved!

    I used an old/wrong way to add orderlines in C#.

    After some googling I found this: http://our.umbraco.org/projects/website-utilities/tea-commerce/tea-commerce-support/21953-Creating-an-order-and-adding-product-lines-Net-API-Getting-started?p=1

    Thanks for helping out with this Anders!

Please Sign in or register to post replies

Write your reply to:

Draft