Conditional on PROD Page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mark462
    Mini Mivite

    • Jan 2008
    • 15

    #1

    Conditional on PROD Page

    I'm using 5.5 with Toolkit. I've tried many different functions, but can't get a conditional to display correctly on the PROD (product) page.

    What I want to do is display link A if the category is A, but display link B if category does not equal A.

    Obviously, more complicated than that. But, I want to display a link to women's size chart if the product does not equal the menswear category.

    Any suggestions?

    I've tried many variations to no avail:

    Code:
    <mvt:item name="toolkit" param="childof|parentfound|g.Category_Code" />
    <mvt:if expr="g.parentfound EQ 'menswear'">
            <li><a href="images/howtomeasure_men.jpg" data-lightbox="image-1" title="For Him - How to Measure">How to Measure</a><br />
        <mvt:else>
            <li><a href="images/howtomeasure_women.jpg" data-lightbox="image-1" title="For Her - How to Measure">How to Measure</a><br />
        </mvt:if>
  • Brennan
    Super Moderator









    • Jun 2009
    • 3481

    #2
    Re: Conditional on PROD Page

    The code you have there is looking at the current categories parent category. Is that what you want tot do?

    If you just want to test for the current category you could do something like this:

    Code:
    <mvt:if expr="g.Category_Code EQ 'menswear' ">
      //the current category is menswear
    <mvt:else>
     // the current category is not menswear
    </mvt:if>

    Since a product can be part of multiple categories, a better way to do this would be to create a custom product field to determine if the how to measure link should be displayed, and if it should be mens or womens.
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment

    • nottheusual1
      Mega Mivite


      • Jul 2008
      • 1124

      #3
      Re: Conditional on PROD Page

      Brennan ::

      What about reading the canonical category code for the product?

      Comment

      Working...
      X