Copied to clipboard

Flag this post as spam?

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


  • Doogie Talons 183 posts 318 karma points
    Jan 19, 2012 @ 10:20
    Doogie Talons
    0

    Self induced AJAX problem, I think.

    Hey Teacommerce 

    Once again I have chopped and changed your package so much I have chopped something out I needed..

     

    When you have a variant in the demo webshop and the price in the brown  changes automaticially as the variant drop down is selected...

     

     

    Which bit's doing this ? what does it rely on to work you can see an example of it working here on a demo webshop as first installed.

    http://www.lunch-break.co.uk/en/products/category-a/product-a1.aspx

    and not working here on a site I have built with the demo webshop but been a bit gung ho with my ammends...

    http://aitkens.voltagedev.co.uk/shop-online/shopcategory/shopsubcategory/shopproduct.aspx?n=1222

    What have I cut and shut out to stop this working ? (ignore the fact the price is different to in the drop down it's me messing about with a vat thing)

    Cheers

    Doogie

  • Rune Grønkjær 1372 posts 3103 karma points
    Jan 19, 2012 @ 10:33
    Rune Grønkjær
    0

    Hi Doogie,

    You are missing the _languageId variable in the MainMaster master template. It's used by the Tea Commerce invokeXslt method, that refreshes the UI.

    Try using the firebug console when changing the variant in the dropdown. It shows you the javascript error.

    /Rune

  • Doogie Talons 183 posts 318 karma points
    Jan 19, 2012 @ 11:08
    Doogie Talons
    0

    Ahh I think the problem is deeper then I have added the code and it errors in a whole new way.. I think I have changed the structure too much.

    Doogie

  • Rune Grønkjær 1372 posts 3103 karma points
    Jan 19, 2012 @ 11:15
    Rune Grønkjær
    0

    Yes, now your problem is that you rely on url parameters, which cannot be sent to the invokeXslt method. You can send a nodeId , which usually is the product variant node.

    Are your products and variants normal umbraco content nodes?

    /Rune

  • Doogie Talons 183 posts 318 karma points
    Jan 19, 2012 @ 11:20
    Doogie Talons
    0

    Hmmm this was a desision by the client to have two sections on his site, one with all his products and one with shop oninle which are basically products he added prices to. 

    This was to allow him at any time to put a product into the shop without adding new content ect.


    So the shop online section is a bunch of different templates that reply on a the querystring for the node so instead of $currentPage we use the querystring N

    It worked brilliantly till he then wanted vatrients....

    Doogie

  • Doogie Talons 183 posts 318 karma points
    Jan 19, 2012 @ 11:24
    Doogie Talons
    0

    I can ignore the AJAX bit feature the prices in the drop down and on the page if not varient... I was just trying to see if I could get it to work. So how could I get thatpage to ignore it without the javascript error ?

  • Rune Grønkjær 1372 posts 3103 karma points
    Jan 19, 2012 @ 11:25
    Rune Grønkjær
    1

    Ok. Then we just have to find a solution. It's Tea Commerce, so everything is possible ;-)

    One way would be to reload the page with a new querystring parameter. You would have to change the script that runs when the drop down is changed. This would be quite simple.

    /Rune

  • Doogie Talons 183 posts 318 karma points
    Jan 19, 2012 @ 11:30
    Doogie Talons
    0

    ha haa how simple. I have got this far I think i am too close to it.

    I am not the best developer in the world and have got this far by basically being lucky and the fact that teacommerce is fundamently easy to use with the way umbraco works.

    Doogie :)

  • Rune Grønkjær 1372 posts 3103 karma points
    Jan 19, 2012 @ 11:33
    Rune Grønkjær
    0

    Yeah, sometimes the simplest solutions eludes the developer. :)

    Looking forward to see the website up and running. Please mark my answer for others to see (If it's a good enough answer for you)

    /Rune

  • Doogie Talons 183 posts 318 karma points
    Jan 19, 2012 @ 11:43
    Doogie Talons
    0

    Yeah I don't know where I am looking at...what is causing the Not Enough parameters in url

     

    is it this bit ?

     

    function updatePageUI({
      /*
      All xslt's that can be invoked in this way have information in a div
      with the class "invokeXSLT". For every one of them we update the UI.
      */
      jQuery('div.invokeXSLT:not(div#products div.product div.invokeXSLT)').each(function ({
        var invokeXSLT jQuery(this),
            parent invokeXSLT.parent(),
            productid parent.attr('productid'|| _nodeId;
            htmlFromServer TeaCommerce.invokeXSLT(invokeXSLT.text()productid,
            {
              umbracoLanguageId_languageId,
              asyncfalse
            });
        parent.before(htmlFromServer).remove();
      });
    }

     

    I have put <input name="ReturnUrl" type="hidden" value="/shop-online/shopcategory/shopsubcategory/shopproduct.aspx?n={$fN/@id}" />

    so it returns to the right page but perhaps that's unessesary ?

  • Rune Grønkjær 1372 posts 3103 karma points
    Jan 19, 2012 @ 11:47
    Rune Grønkjær
    0

    You should change this piece in the teaCommerce_simple.js

    /*
    Will update one product element.
    We only do this because the variants have different stock
    and prices than the main product.
    */
    function updateProduct(productEle) {
      var variant = productEle.find('select.productVariants').val(),
          chosenProductId = variant ? variant : productEle.attr('productid'),
          xsltFile = productEle.children('.invokeXSLT').text(),
          htmlFromServer = TeaCommerce.invokeXSLT(xsltFile, chosenProductId,
          {
            umbracoLanguageId: _languageId,
            async: false
          });
      productEle.before(htmlFromServer).remove();
    }

  • Doogie Talons 183 posts 318 karma points
    Jan 19, 2012 @ 12:09
    Doogie Talons
    0

    dare I ask to what... so sorry :) Just head is screwed looking at it all again.

    I take it I need that code to incorporate the query.

     

     

  • Doogie Talons 183 posts 318 karma points
    Jan 20, 2012 @ 17:52
    Doogie Talons
    0

    I guess I am asking if there is not enough url parameters... what's missing :) and how do I send it.

    Doogie.

  • Rune Grønkjær 1372 posts 3103 karma points
    Jan 22, 2012 @ 10:52
    Rune Grønkjær
    0

    Hi Doogie,

    Sorry I couldn't get to answer your comment. Have you found out yourself or do you need a few pointers?

    /Rune

Please Sign in or register to post replies

Write your reply to:

Draft