Copied to clipboard

Flag this post as spam?

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


  • Michael 63 posts 211 karma points
    Sep 11, 2012 @ 14:03
    Michael
    0

    uWebshop custom project details view xslt

    Hi guys

    I am currently working with the uWebshop package. I am trying to modify the ssws-xslt-productdetailsview.xslt so that it shows the extra fields I added on the doctype.

     

    I can't seem to get the thing right. Something is wrong in the select I guess. But i can't figure out what. Tried a bunch of different thing with the select without luck.

    The code looks like this:

    <xsl:param name="currentPage"/>
        <!-- GET THE BASKETNODE -->
        <xsl:variable name="basketId" select="$currentPage/ancestor-or-self::*/sswsOrderProcessNode/@id"/>

        <xsl:variable name="currentCategoryUrlName" select="umbraco.library:RequestQueryString('category')"/>
        <xsl:variable name="currentProductUrlName" select="umbraco.library:RequestQueryString('product')"/>
        <xsl:variable name="currentProduct" select="SSWS.Catalog:GetProductFromUrlName($currentCategoryUrlName, $currentProductUrlName)"/>


        <xsl:template match="/">
            <h2>
                <xsl:value-of select="$currentProduct/title"/>
            </h2>
            <!-- Produkt specs box -->
            <div class="produktSpecs">
              <p><xsl:value-of select="$currentPage/specsOverskrift"/></p>
              <div class="graaSpecsBox">
                <div><p>Varenr.</p><xsl:value-of select="productNumber"/></div>
                <div><p>Mål:</p><xsl:value-of select="specsMaal"/></div>
                <div><p>Tykkelse:</p><xsl:value-of select="tykkelse"/></div>
                <div><p>Farve:</p><xsl:value-of select="farve"/></div>
                <div><p>Overflade:</p><xsl:value-of select="overflade"/></div>
                <div><p>Bund:</p><xsl:value-of select="specsBund"/></div>
                <div><p>Pakning:</p><xsl:value-of select="pakning"/></div>
                <div><p>Vægt:</p><xsl:value-of select="specsVgt"/></div>
                <div><p>Lager:</p><xsl:value-of select="lagerStatus"/></div>
                <div><p>Levering:</p><xsl:value-of select="levering"/></div>
              </div>
              <div class="vejledendePris">Vejl. pris: Kr. <xsl:value-of select="vejledendePris"/>,-</div>
              <div class="inproPris">Inpro pris: <xsl:value-of select="inproPris"/>,- kr. pr. m2 inkl. moms</div>
            </div>
            <!-- Produkt specs box SLUT -->

    ..... and so on :)

     

    Any help or pointers would be much appreciated :)

     

    /Michael

  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 7x admin c-trib
    Sep 11, 2012 @ 14:12
    Chriztian Steinmeier
    0

    Hi Michael,

    You probably just need to prefix all the fieldnames with $currentProduct, e.g.:

    <xsl:value-of select="$currentProduct/infoPris" />

    Etc.

    /Chriztian

  • Michael 63 posts 211 karma points
    Sep 11, 2012 @ 14:14
    Michael
    0

    Tried that. Did not do the trick :(

    And a totally unrelated question. How do I paste my code so it looks like your code. With that colors etc. ? :)

  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 7x admin c-trib
    Sep 11, 2012 @ 14:25
    Chriztian Steinmeier
    0

    Hmm - I don't know whay kind of XML you get from the SSWS.Catalog extensions, so you might need to do some debugging, i.e.:

    <textarea cols="80" rows="30"><xsl:copy-of select="$currentProduct" /></textarea>

    This will give you the output from $currentProduct so you can see how you need to address it with XPath.

    Regarding the code formatting, I've found this to get the best results:

    * Copy code as plain text from Notepad or a texteditor (if you copy from somewhere else, paste in a texteditor first and copy from there)

    * Put the cursor  on a blank line

    * Select "Preformatted" in the style dropdown

    * Paste the code (in Safari I need to Undo then paste again to fix some linebreak issues)

    /Chriztian

  • Michael 63 posts 211 karma points
    Sep 11, 2012 @ 14:32
    Michael
    0

    Will give it a go and get back :)

    Thx for the tip on formatting the code. Did not even think to look there :P

     

    /Michael

  • Michael 63 posts 211 karma points
    Sep 11, 2012 @ 15:59
    Michael
    0

    When I try it I get this:

    <product id="1193" parentId="1182" sortOrder="1" createDate="10-09-2012 11:37:21" 

    updateDate="11-09-2012 11:00:23" nodeName="Altivo skifer" urlName="Altivo-skifer"

    path="-1,1117,1118,1182,1193">

    <path>-1,1117,1118,1182,1193</path>

    <number></number>

    <urlName></urlName>

    <title></title>

    <shortDescription></shortDescription>

    <longDescription></longDescription>

    <tags />

    <images></images>

    <files />

    <pricings />

    </product>

    1117 is the ID for the shop and 1118 is for the catalog. Do I need to make a variable similar the basketId variable to get the data to display? I can't quite see how to go about it.

    So it would be something like :

    <xsl:value-of select="$newVariableHere/title"/>

     

    /Michael


     

  • Michael 63 posts 211 karma points
    Sep 19, 2012 @ 13:32
    Michael
    0

    Finally found a solution here: http://blog.uwebshop.com/2011/06/01/custom-properties-in-uwebshop/

    I needed to add the word custom in front of my custom property aliases.

    Thx for your help Chriztian Steinmeier :)

     

    /Michael

     

Please Sign in or register to post replies

Write your reply to:

Draft