Copied to clipboard

Flag this post as spam?

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


  • Matt 91 posts 237 karma points
    Jan 22, 2013 @ 16:42
    Matt
    0

    Error adding product to cart (on product page)

    I've been using the Starter Kit to develop our ecommerce website, which has been going fairly well. However somewhere during development a problem with the cart has come up.

    When I try to add a product to the cart (on the individual product page - product_product.xslt) an error is given:

    <![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 TeaCommerce.Presentation.TeaCommerceBase.RequestModule.invokeMethod(restExtension myExtension, Object[] paras) INNEREXCEPTION: System.InvalidOperationException: Nullable object must have a value. at TeaCommerce.Base.FormAddOrderLine(Dictionary`2 fieldKeyValues) at TeaCommerce.Base.ParseAction(IDictionary`2 vars) at TeaCommerce.Base.SubmitForm()
    ]]>

    I've tried adding a product via Javascript in the console and also using the button. I've also tried reverting all of the XSLT file back to the original in the starter kit.

    I've seen some other threads with similar issues but the solutions did not work.

    The site is running Umbraco 4.7.2

    Any help is much appreciated.

  • Matt 91 posts 237 karma points
    Jan 22, 2013 @ 17:50
    Matt
    0

    EDIT: I can add a product to the cart via the console using AddOrderLine(productID, quantity).

  • Rune Grønkjær 1371 posts 3102 karma points
    Jan 23, 2013 @ 08:17
    Rune Grønkjær
    0

    Hi Matt,

    Can you replicate the problem from the console? Have you checked alle the parameter data you add to the FormAddOrderLine post? It might be the node id or the quantity that cannot be parsed. My guess is the node id. It should be in an input field in your form.

    /Rune

  • Matt 91 posts 237 karma points
    Jan 25, 2013 @ 10:22
    Matt
    0

    Hi Rune,

    In the console when I use AddOrderLine function it adds to the cart successfully.

    I've reverted back to the starter kit XSLT for that page (product_product.xslt) so I'm using the same form - I can see the correct nodeid on each product in the html. So I'm assuming it's something outside of the xslt that has gone wrong? The variants functionality does not seem to work currently, could this be related? We are following the same format as the starter kit for variants (copied them across). 

  • Matt 91 posts 237 karma points
    Jan 25, 2013 @ 10:55
    Matt
    0

    After looking further I think this is definitely related to the variants - when I copy an entire product and its variants from the original products in the starter kit (Product A1) and paste it into my category, it adds to the cart and the variants functionality works. However when I create my own product under the same category/add variants it does not. The products are using the same Document Type and template. 

  • Rune Grønkjær 1371 posts 3102 karma points
    Jan 25, 2013 @ 19:34
    Rune Grønkjær
    0

    Could you paste your xslt markup.

    Just the <form> tag part. Something must be wrong there i think.

    Otherwise you could maybe post a link to a test site where we can help debugging it?

    /Rune

  • Matt 91 posts 237 karma points
    Jan 28, 2013 @ 13:49
    Matt
    100

    Hi Rune,

    Thanks for the help - turns out we were using the latest version of Jquery rather than 1.7.1, and so the .live functions used in Teacommerce_advanced.js did not work. Rolled back to the older version and now everything works again.

  • Anders Burla 2560 posts 8256 karma points
    Feb 11, 2013 @ 10:18
    Anders Burla
    0

    Hi Matt

    Could you mark the right answer as a solution? :)

    Kind regards
    Anders

  • John Perryn 71 posts 182 karma points
    Mar 13, 2013 @ 15:05
    John Perryn
    0

    Alternatively, see http://jquery.com/upgrade-guide/1.9/#live-removed

    "To exactly match $("a.foo").live("click", fn), for example, you can write $(document).on("click", "a.foo", fn)."

    Anders - do you have an upgraded version of Teacommerce_advanced.js available for the starter kit? I count 13 instances.

    Rgds

    John P

  • Anders Burla 2560 posts 8256 karma points
    Mar 13, 2013 @ 15:29
    Anders Burla
    0

    Hi John

    We dont have a updated advanced script that supports jQuery 1.9. We are using the new starter kit for Tea Commerce 2.0 and that is the one that will be updated from now on.

    Kind regards
    Anders

  • John Perryn 71 posts 182 karma points
    Mar 13, 2013 @ 15:47
    John Perryn
    0

    Thanks Anders. Its an easy fix anyway. Just replace all instances of .live with .on in Teacommerce_advanced.js and it works.

    Will there be an upgrade pathway from V1.4.4.4 to V2.0?

    Rgds

    John P

  • Anders Burla 2560 posts 8256 karma points
    Mar 13, 2013 @ 15:55
    Anders Burla
    0

    At the moment we have choosen that there is no upgrade path because there so many changes to the DB and API. Even if we did a upgrade path for the DB then all the API methods has changed so you would need to go change all the method calls anyway. So that is why :)

Please Sign in or register to post replies

Write your reply to:

Draft