Copied to clipboard

Flag this post as spam?

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


  • John Perryn 71 posts 182 karma points
    Feb 20, 2013 @ 08:36
    John Perryn
    0

    SubmitForm.aspx usage

    I'm working with Umbraco 4.11.4, TeaCommerce 1.4.4.2, jQuery 1.7.2 and attempting to build a shop using TeaCommerce Starterkit 1.4.4.4. So far I have added some products, the MiniCart and an Add-to-Cart button.

    Yes, I have changed /tcbase/ to /base/ everywhere.

    When I hit Add-to-Cart I get errors. (see below).

    Also where is /base/teacommerce/SubmitForm.aspx hiding?

    Thanks

    John P

    <error><![CDATA[MESSAGE:
    Exception has been thrown by the target of an invocation.
    
    STACKTRACE:
       at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
       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 Umbraco.Web.BaseRest.RestExtensionMethodInfo.Invoke(String[] parameters)
    
    INNEREXCEPTION:
    System.InvalidOperationException: Nullable object must have a value.
       at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
       at TeaCommerce.Base.FormAddOrderLine(Dictionary`2 fieldKeyValues)
       at TeaCommerce.Base.ParseAction(IDictionary`2 vars)
       at TeaCommerce.Base.SubmitForm()]]></error>
  • Rune Grønkjær 1371 posts 3102 karma points
    Feb 20, 2013 @ 08:51
    Rune Grønkjær
    0

    Hi John,

    Looks like the add to cart call does not recieve all necessary parameters.

    Is the failing call made by JavaScript or simply the form posting?
    Have you changed the html output of the product? If so what does it look like now? You might have removed/changed some important stuff.

    The Tea Commerce base is located in our c# code. It's a extension using Umraco base http://our.umbraco.org/wiki/reference/umbraco-base

    /Rune

  • John Perryn 71 posts 182 karma points
    Feb 20, 2013 @ 10:26
    John Perryn
    0

     

    Thanks Rune

    I mostly a beginner in this environment - and not liking xslt very much.

    My project uses exactly the calling sequence set up by products-products.xslt from the tea commerce starter site - so a <form> post.

    Yes, I have likely removed some important stuff - my the html is somewhat simpler than the starter site - but I don't know what defines "important stuff" or "necessary parameters".

    Is there a way to get more information about what may be missing?

    I could send you the whole project - it runs as localhost under webmatrix. MSSQL 2012.

    Thanks

    John P
    tag [at] qfhs.org.au

     

  • Rune Grønkjær 1371 posts 3102 karma points
    Feb 20, 2013 @ 10:44
    Rune Grønkjær
    0

    Well, yes, what is important. :)

    First of all the input/select fields used in the starter kit are all important as they are the ones that hold the information the server needs.

    Secondly you might be getting a JavaScript error before the form is posted. Otherwise the standard starter kit JavaScript would be doing the adding to cart for you. The JavaScript is using the standard html, classes and id's to findt the information it needs and the the correct calls. This JavaScript might need to be changed according to your new markup. Most of it is in the teaCommerce_Advanced.js and some of it is in the teaCommerce_Simple.js. The code you need to find is in the teaCommerce_Advanced.js around line 206 and starts something like this:
    jQuery('.productAddToCart').live('click', function () {

    If I where you I would start out by making sure that the standard markup works, and then work your way forward.

    As for your dislike of xslt we are currently working all we can to finish a release candidate of Tea Commerce 2 and the starter kit for that. The new starter kit is 100% razor and much more simple to change. Currently we are setting up a couple of our own customers e-commerce solutions on a beta version and it's going great.

    Tea Commerce 2 might be more the thing for you.

    /Rune

  • John Perryn 71 posts 182 karma points
    Feb 20, 2013 @ 14:54
    John Perryn
    0

    Thanks Rune, I'll work through it all again.I'm finding it hard to visualize how the core and the javascript interact during Add-to-Cart.

    The razor version sounds great! The uncertain time scale meant that I have had to proceed using xslt. I'm learning but slowly.

    John P

     

  • Rune Grønkjær 1371 posts 3102 karma points
    Feb 20, 2013 @ 14:58
    Rune Grønkjær
    0

    Yeah sorry about the time scale. Too many great features we want and only 24 hours earth cycle :(

    /Rune

  • John Perryn 71 posts 182 karma points
    Feb 20, 2013 @ 15:22
    John Perryn
    100

    Hi Rune

    Fixed now - my error. I had entered

    /scripts/teaCommerce/Advanced.js

    instead of

    /scripts/teaCommerce_Advanced.js

    Your prompt support was much appreciated.

    Moving forwards again...

    John P

Please Sign in or register to post replies

Write your reply to:

Draft