Copied to clipboard

Flag this post as spam?

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


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Nauman 98 posts 118 karma points
    Sep 21, 2010 @ 15:01
    Nauman
    0

    Product report

    Hi,

    I have setup a store in uCommerce and added different products in different categories.

    My question is how I can generate a report of product details (including prices and variant prices). Is this possible through XSLT or I have to write .NET code for this?

    Any sample of XSLT or .NET code is appreciated.

    Nauman

  • Sean Mooney 131 posts 158 karma points c-trib
    Sep 21, 2010 @ 15:21
    Sean Mooney
    1

    Hello Nauman,

    You can use the following xslt extension that is part of the CommerceLibrary:

    <xsl:variabl name="product" select="CommerceLibrary:GetProduct('Catalog Name','Product Sku')" />

    This will create a variable of the product, I would then suggest outputting a copy of it so you can see the xml behind it.

    <xsl:copy-of select="$product" />

    Once you see the xml you should be able to query it using xpath and display the information the way you want to.

    Hope that helps.

  • Søren Spelling Lund 1797 posts 2786 karma points
    Sep 21, 2010 @ 19:16
    Søren Spelling Lund
    0

    If you need to generate a reports of all your products you can put them all in a single category and load that using:

    CommerceLibrary:GetCategory('Catalog name', 'Name of Category Containing All Products')
  • Nauman 98 posts 118 karma points
    Sep 27, 2010 @ 11:26
    Nauman
    0

    Soren

    Thanks for your help, I have started writing xslt, following is the code

    <xsl:variable name="prod" select="CommerceLibrary:GetCategory('CatalogName', CategoryName')" />
    <xsl:copy-of select="$prod/product/@displayName" /> // this does not display anything
    <xsl:value-of select="$prod/@displayName" /> // this also does not display anything

    Please guide me, how can I display the values of products using "prod" variable?

    Regards

    Nauman

  • Søren Spelling Lund 1797 posts 2786 karma points
    Sep 27, 2010 @ 13:41
    Søren Spelling Lund
    0

    A helpful trick to view the XML structure produced by our XSLT extensions is to do the following:

    <textarea>
      <xsl:copy-of select="$prod"/>
    </textarea>

    This is will output the XML which will give you a better idea of how to get at the values.

    Please let me know if this helps or if you need additional information. You can take a look at the uCommerce Store for some examples of how to put together the XSLT. 

  • Nauman 98 posts 118 karma points
    Sep 27, 2010 @ 14:43
    Nauman
    0

    Soren

    this was really helpfull

    but I am unable to get the nodes from xsl with followind code.

    <xsl:copy-of select="$prod"/>
    <xsl:for-each select="category/childProducts">
    inside for each
    </xsl:for-each>

    further help required please.

    Nauman

  • Sean Mooney 131 posts 158 karma points c-trib
    Sep 27, 2010 @ 14:47
    Sean Mooney
    0

    Your for each loop should be this:

    <xsl:copy-of select="$prod"/> 
    <xsl:for-each select="$prod/category/childProducts"> 
    inside for each 
    </xsl:for-each>
  • Nauman 98 posts 118 karma points
    Sep 27, 2010 @ 15:01
    Nauman
    0

    Thank you Soren

    It was a great help. Resolved my problem.

Please Sign in or register to post replies

Write your reply to:

Draft