Copied to clipboard

Flag this post as spam?

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


  • Bryce Darling 2 posts 22 karma points
    Feb 23, 2012 @ 22:32
    Bryce Darling
    0

    InvokeXSLT using json dataType

    Hello fellow Umbracians,

    I am trying to use the TeaCommerce.invokeXSLT JavaScript API method to get back some json data from a parent node using xslt.

    The json that my xslt file returns looks correct when I call the base URL directly.

    However, when setting the dataType to 'json' it still seems to be fetching HTML:

    TeaCommerce.invokeXSLT("OrderLine.xslt", lines[i].NodeId, {
        dataType: 'json',
        successfn: function (data) {
            console.log(data);
        }
    });

    I was going to try modifying invokeXSLT but the teaCommerce file is packed. While looking at the TeaCommerce.invokeXSLT function in Chrome console I noticed the 'html' argument at the end of this function definition and thought that should maybe be using the settings.dataType instead:

    TeaCommerce.invokeXSLT
    function (a,b,c){c=l.fixSettings(c);return l.callBase('InvokeXSLT',[a,b,c.umbracoLanguageId],null,c.async,c.successfn,c.errorfn,'html')}

    Any help would be greatly appreciated!

    Thanks,

    Bryce Darling

     

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

    Hi Bryce,

    That's a fantastic idea. And actually you could call it a bug, that your "datatype" setting is ignoed. I made a very small change to the Tea Commerce script, allowing the datatype to be altered with the settings and still setting it to html as default. It will be released with the next big release of Tea Commerce, which will be sometime next week.

    BUT please write me at rg [at] teasolutions.dk and I will e-mail you the altered script files.

    By the way. Tea Commerce is always shipped with the unpacked version of the JavaScript, teaCommerce_unpacked.js.

    /Rune

  • Bryce Darling 2 posts 22 karma points
    Feb 24, 2012 @ 15:09
    Bryce Darling
    0

    Rune,

    It's great to know that the unpacked version is available, I must have overlooked it, oops!

    I would definitely high-five you but unfortunately I lack the necessary karma. :)

    Thank you so much,

    Bryce

  • Rune Grønkjær 1372 posts 3103 karma points
    Feb 24, 2012 @ 15:42
    Rune Grønkjær
    0

    The files are sent. Please let me know if it behaves correctly. Didn't have the time to test it properly.

    /Rune

Please Sign in or register to post replies

Write your reply to:

Draft