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.

  • Frank Alunni 6 posts 26 karma points
    Mar 06, 2012 @ 00:14
    Frank Alunni
    0

    Filtering Categories by user defined fields

    Hello,

    I modified the default category definition and I added a user field called "Classification". The field is an enum which values can only be "By Brand" or "By Product Type". I am trying to create a catalog page where you may have all the categories marked "By Brand" in a slider and the categories marked "By Product Type" in a list.

    I cannot figure out how to look through all the categories marked as "By Brand", using an XSLT.

    Has anyone tried to do something similar before?

     

    Thank you 

  • Søren Spelling Lund 1797 posts 2786 karma points
    Mar 06, 2012 @ 09:50
    Søren Spelling Lund
    0

    Hi Frank,

    You can do something along the lines of:

    <xsl:variable name="category" select="CommerceLibrary:GetCategory("myCatalog", "myCategory", true())"/>
    <xsl:variable name="categoriesByBand" select="$category/category/childCategories/category[properties/classification = 'By Brand']"/>

    A trick is to output the XML structure using a xsl:copy-of in a textarea. It makes it much easier to figure out how to grab certain elements from the structure.

  • Frank Alunni 6 posts 26 karma points
    Mar 06, 2012 @ 14:54
    Frank Alunni
    0

    Hi Soren,

    I can't believe you find the time to answer everybody's questions. Thank you that did the trick.

Please Sign in or register to post replies

Write your reply to:

Draft