Copied to clipboard

Flag this post as spam?

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


  • Sebastian Dammark 583 posts 1407 karma points
    Dec 18, 2012 @ 02:07
    Sebastian Dammark
    0

    invokeXSLT doesn't return any HTML ...

    Link: http://teacommerce.sheriffone.com/products.aspx
    Script: http://teacommerce.sheriffone.com/scripts/Shop.js

    For some reason invokeXSLT doesn't get me any HTML.

    I'm pretty much using this example: http://rune.gronkjaer.dk/en-US/2010/11/16/tea-commerce-javascript-api/#invokeXSLT

    The product is added and when you do a manual refresh you will see a minicart in the bottom of the screen.
    But if you look in the console you'll see that the output is kinda odd.

    And yes, the minicart.xslt is allowed to be used with invokeXSLT :)

    My code looks like this:

    /* When we add product to cart */
    jQuery(".productAddToCart").live("click", function () {
    var nodeId = jQuery(this).attr('nodeid');
    /* Add orderline is called using the Tea Commerce javascript API */
    TeaCommerce.addOrderLine(nodeId, 1, false);
    return false;
    });
    TeaCommerce.subscribeToOnCartUpdated(function (data) {
    var cart = jQuery('#minicart');
    //Update the cart of the site
    //Fetch the new cart html with invokeXSLT and update the UI
    var cartJqHtml = jQuery(TeaCommerce.invokeXSLT('minicart.xslt', _nodeId, false));
    console.log(cartJqHtml);
    cart.after(cartJqHtml);
    //cart.remove();
    });
    Any ideas ?

  • Rune Grønkjær 1372 posts 3103 karma points
    Dec 18, 2012 @ 08:17
    Rune Grønkjær
    1

    Yep, I have an idea. you can't pass along false as settings. You must create your settings like this {async:false}.

    Same problem with your addOrderLine method. In that case it does'nt matter though. Nothing's happining after the servercall that you should wait for. So you could just do it like this:

    TeaCommerce.addOrderLine(nodeId,1);

    /Rune

  • Sebastian Dammark 583 posts 1407 karma points
    Dec 18, 2012 @ 09:27
    Sebastian Dammark
    0

    Awesome ... thanx alot.

Please Sign in or register to post replies

Write your reply to:

Draft