Copied to clipboard

Flag this post as spam?

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


  • Dan 1288 posts 3921 karma points c-trib
    May 02, 2013 @ 12:44
    Dan
    0

    TeaCommerce Cart edit doesn't work after adding customer details

    Hi,

    My client has noticed what looks like a bug, which seems to be the same with the starter kit demo site.  If you add a product to cart, view cart, and check out all the way to cart step 4 (accept) but then go back to the cart, there's a javascript error when you try to change the quantity of the item in the cart.

    Any ideas how to patch this?

    Thanks

  • Rune Grønkjær 1372 posts 3103 karma points
    May 02, 2013 @ 12:50
    Rune Grønkjær
    0

    Hi Dan,

    How do you go back to the cart? Using the back button in the browser?

    /Rune

  • Dan 1288 posts 3921 karma points c-trib
    May 02, 2013 @ 12:51
    Dan
    0

    By clicking the cart step at the top.  Or in my implementation I have a button under the cart summary which is just a hyperlink to the 1st cart step.

  • Rune Grønkjær 1372 posts 3103 karma points
    May 02, 2013 @ 12:54
    Rune Grønkjær
    0

    Could you please check the browser console to see if there's and error?

    /Rune

  • Matt 91 posts 237 karma points
    May 02, 2013 @ 12:58
    Matt
    0

    Can also confirm this bug - going back to the cart at step 4 causes it to hang at "updating". There is no error in JS console.

    I am still running 2.0 though, I understand in 2.1 the orderline process was changed. 

  • Dan 1288 posts 3921 karma points c-trib
    May 02, 2013 @ 13:03
    Dan
    0

    Sure.  There are console errors.  When I go back to the cart on the starter kit website and click the plus button to increase the quantity of the item I get:

     

    POST http://starterkit.teacommerce.net/base/TC/FormPost.aspx 500 (Internal Server Error) jquery.min.js:3
    send jquery.min.js:3
    st.extend.ajax jquery.min.js:3
    $.fn.ajaxSubmit jquery.form.js:208
    (anonymous function)
    st.event.dispatch jquery.min.js:2
    y.handle jquery.min.js:2

     

    In my own implementation oddly the error is different:

     

    Uncaught TypeError: Cannot read property 'quantity' of null ecommerce.js:39
    (anonymous function) ecommerce.js:39
    TCService.fireEvent
    TCService.fireAfterEvent
    TCService.success
    settings.success
    options.success jquery.form.js:170
    c jquery-1.9.1.min.js:3
    p.fireWith jquery-1.9.1.min.js:3
    k jquery-1.9.1.min.js:5
    r jquery-1.9.1.min.js:5

     

     

    The line it's referring to is if (orderLine.quantity <= 0) { in the function below:

     

    TC.bind('afterAddOrUpdateOrderLine', function (orderLine, data, jQForm) {
      var updatingElement = jQForm.closest('.updating');
    
      if (updatingElement.hasClass('item')) {
        if (orderLine.quantity <= 0) {
          var deleteElement = jQuery('#orderLine' + orderLine.id);
          deleteElement.remove();
        } else {
          updateCartOrderLine(orderLine);
        }
        updateCart(data.order);
      }
    
    });

     

     

    I'm running 2.0.

  • Rune Grønkjær 1372 posts 3103 karma points
    May 02, 2013 @ 13:21
    Rune Grønkjær
    1

    Hi Matt and Dan,

    I can confirm the problem and it is something we can fix in the Tea Commerce engine.

    We will make a fix asap and get back to you guys.

    Thanks for your effort. It's much appreciated.

    /Rune

  • Dan 1288 posts 3921 karma points c-trib
    May 02, 2013 @ 13:23
    Dan
    0

    Cool, thanks Rune.

  • Matt 91 posts 237 karma points
    May 02, 2013 @ 13:24
    Matt
    0

    Thanks Rune,

    If its any help we also noticed the same problem when a transaction fails and goes to the failed URL, and then the customer tries to buy again by going through the cart process.

  • Rune Grønkjær 1372 posts 3103 karma points
    May 02, 2013 @ 13:26
    Rune Grønkjær
    0

    Hi Matt,

    Yes, That would create the same issue. It's related to a safty mechanic that kicks in when the user is about to pay for the order. Happens when the payment form is generated.

    /Rune

  • Rune Grønkjær 1372 posts 3103 karma points
    May 03, 2013 @ 13:18
    Rune Grønkjær
    100

    Hi guys,

    We have fixed the bug and released a new version of Tea Commerce. Remember to check the revision history for breaking changes:
    http://documentation.teacommerce.net/revision-history/

    Also note that I have added a few chars of code to the starter kit setup to make use of the fix in the UI as well. More specificly we have introduced a new property on orderlines called copiedFromOrderLineId, which can be used to update the UI.

    /Rune

  • Matt 91 posts 237 karma points
    May 08, 2013 @ 12:13
    Matt
    0

    I'm struggling to get the UI to update when applying this fix.

    I've updated to 3.1.1, copied the ecommerce.js from the updated starter kit, but when a product is added or updated in the cart after returning to the cart from beyond customer information (as described in previous posts), the cart UI hangs as "adding to cart". The order line has successfully been updated since when I refresh the page the correct quantity/price is shown. There is no error in the console either.

    This works fine before going past the customer information stages.

    Any ideas?

  • Rune Grønkjær 1372 posts 3103 karma points
    May 08, 2013 @ 12:44
    Rune Grønkjær
    0

    Hi Matt,

    Something must be wrong! :)

    Sounds like something goes wrong in the afterCartUpdated event. Have you tried debugging the JavaScript to see what happens in that event?

    Do you have anywhere where we can see your site not working?

    /Rune

  • Matt 91 posts 237 karma points
    May 08, 2013 @ 13:12
    Matt
    0

    Hi Rune, it seems so, it doesn't look like the afterCartUpdated event is firing at all (only when I go past the customer information it does not fire).

    I've sent an email to you with a link, a second opinion would be much appreciated! :) 

  • Rune Grønkjær 1372 posts 3103 karma points
    May 08, 2013 @ 13:52
    Rune Grønkjær
    0

    Hi Matt,

    I found the problem. Aparently the json returned from Tea Commerce is not valid because of the "comments" property on the order. More specifically it's because of some tabs that are automatically insertet. I guess you have some line breaks in your razor file. Try making the textarea as a one liner. That should do the trick.

    /Rune

  • Matt 91 posts 237 karma points
    May 08, 2013 @ 14:00
    Matt
    0

    Ahh, that was it! Thank you! :) I copied it from the Starter Kit template so maybe some line breaks got added somewhere. 

  • Rune Grønkjær 1372 posts 3103 karma points
    May 08, 2013 @ 14:10
    Rune Grønkjær
    0

    Your visual studio will add them automatically and if you have it set up for tabs instead of spaces it will f**k it up :)

    /Rune

Please Sign in or register to post replies

Write your reply to:

Draft