Copied to clipboard

Flag this post as spam?

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


  • phil 58 posts 78 karma points
    Mar 28, 2012 @ 15:39
    phil
    0

    refresh the page

    I have products adding the the cart and adjusting the quantity in each orderline in the cart working fine but I have to refresh the page to see the updated results how do I get this do happen automatically so the results are show straight away

  • Anders Burla 2560 posts 8256 karma points
    Mar 28, 2012 @ 18:05
    Anders Burla
    0

    Hi Phil

    You will have to use the success function for addOrderLine in the javascript API. This blog post should give you a great idea of the way to use the javascript API and its features. It also gives example of the owerwriteQuantity method and the event subscribeToOnCartUpdated

    http://rune.gronkjaer.dk/en-US/2010/11/24/tea-commerce-javascript-xslt-examples/

    Kind regards
    Anders

  • phil 58 posts 78 karma points
    Mar 29, 2012 @ 13:41
    phil
    0

    HI thank I have had a look through the link which has helped but when i got to the invokeXSLT code as I have written the code in a razor script I wondered if there was a similar command i need to use for this or what code I need to write to get this to work with my razor script

     

    //If there is a cart on the page we can update that
    58       if (cart[0]) {
    59         //Fetch the new cart html with invokeXSLT and update the UI
    60         var cartJqHtml = jQuery(TeaCommerce.invokeXSLT('cartStep01.xslt', _nodeId, falsenullnull));
    61         cart.after(cartJqHtml);
    62         cart.remove();
    63       }

     

  • Anders Burla 2560 posts 8256 karma points
    Mar 29, 2012 @ 15:30
    Anders Burla
    0

    We don't have an invokeRazor - so you will have to do it a little more basic here and make the UI update using the data you get back using the javascript api. You always get the order and can use all the data to update your UI.

    Kind regards
    Anders

  • phil 58 posts 78 karma points
    Mar 29, 2012 @ 17:28
    phil
    0

    Cheers I have most of it working now except for the orderline totalprice in the cart when changing the quantity level as i'm calling from the order class not the orderline class how can i get to the orderline properties from the order 

  • Anders Burla 2560 posts 8256 karma points
    Mar 29, 2012 @ 17:29
    Anders Burla
    0

    Tried order.OrderLines in your javascript?

  • phil 58 posts 78 karma points
    Mar 29, 2012 @ 17:31
    phil
    0

    i have tried order.orderlines.TotalPriceFormatted but it doesn't work

     

  • Anders Burla 2560 posts 8256 karma points
    Mar 29, 2012 @ 17:33
    Anders Burla
    0

    He he - thats because its an array of orderLines - so you have to loop them. Try use firebug and type TeaCommerce.getOrder() and click the object in the console. Then you can see that JSON structure in a more structured way

    Kind regards
    Anders

  • phil 58 posts 78 karma points
    Mar 30, 2012 @ 10:09
    phil
    0

    Is there a way to pass the orderlineId to teh subscribeToOnCartUpdated method so I can work out which orderline to update or should i just update them all

     

  • Anders Burla 2560 posts 8256 karma points
    Mar 30, 2012 @ 16:25
    Anders Burla
    0

    The subscribeToOnCartUpdateddoesnt tell you was has changed - but if you have a success function for addOrderLine you will get what orderlines was added and also the id so you can update using that.

    Kind regards
    Anders

Please Sign in or register to post replies

Write your reply to:

Draft