Announcement

Collapse
No announcement yet.

Token for Parent Category?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Token for Parent Category?



    Hi All:

    I need to write a conditional for the category screen which is true only if
    the current category has child categories (IE: Is a parent category). Is
    there a token that identifies a parent category?

    Thank you

    Dave Hauser



    #2
    Conditional true if Parent Category?




    I almost have it, but not really and don't understand why. I can get the
    reverse of what I want to work perfectly, but when I reverse the
    conditional, which logically should work - it doesn't work.

    This seems strange and I hope someone will explain. If I want an expression
    to evaluate true if the category is a child category, this works with no
    problem:

    %IF(Categories.d.parent_id)%
    This category has a parent category - do this
    %IFEND%

    This works every time. But if I do this:

    %IF(Categories.d.parent_id)%
    This category has a parent category - do nothing
    %ELSE%
    This category has no parent category - do this
    %IFEND%

    The "ELSE" statement only works if the category is a top category. I can't
    figure out how to reverse what works to identify a child category to
    identify a parent category.

    Can someone please suggest a new tactic?


    Thank you

    Dave Hauser

    -----Original Message-----
    From: [email protected]
    [mailto:[email protected]]On Behalf Of Aquapro
    Sent: Thursday, May 05, 2005 6:40 PM
    To: Merchant-Users@Miva. Com
    Subject: [mru] Token for Parent Category?


    Hi All:

    I need to write a conditional for the category screen which is true only if
    the current category has child categories (IE: Is a parent category). Is
    there a token that identifies a parent category?

    Thank you

    Dave Hauser


    Comment


      #3
      Conditional true if Parent Category?



      Found this in the archives some time ago. Maybe this helps.

      %IF(Categories.d.parent_id)%
      %IF(%EXPR(Category_Find_ID(Categories.d.parent_id) )%)%

        
      Home » 
      <a
      href="merchant.mvc?Screen=CTGY&Category_Code=%VAR( Categories.d.code)%">
      %VAR(Categories.d.name)%</a>
      %IFEND%
      %IFEND%

      Andreas Toman
      PCINET, LLC
      Miva Development, Installation & Upgrade
      "E-commerce is the next step in the evolution ..."
      www.pcinet-llc.com


      -----Original Message-----
      From: [email protected]
      [mailto:[email protected]] On Behalf Of Aquapro
      Sent: Friday, May 06, 2005 10:11 AM
      To: Merchant-Users@Miva. Com
      Subject: [mru] Conditional true if Parent Category?


      I almost have it, but not really and don't understand why. I can get the
      reverse of what I want to work perfectly, but when I reverse the
      conditional, which logically should work - it doesn't work.

      This seems strange and I hope someone will explain. If I want an expression
      to evaluate true if the category is a child category, this works with no
      problem:

      %IF(Categories.d.parent_id)%
      This category has a parent category - do this
      %IFEND%

      This works every time. But if I do this:

      %IF(Categories.d.parent_id)%
      This category has a parent category - do nothing
      %ELSE%
      This category has no parent category - do this
      %IFEND%

      The "ELSE" statement only works if the category is a top category. I can't
      figure out how to reverse what works to identify a child category to
      identify a parent category.

      Can someone please suggest a new tactic?


      Thank you

      Dave Hauser

      -----Original Message-----
      From: [email protected]
      [mailto:[email protected]]On Behalf Of Aquapro
      Sent: Thursday, May 05, 2005 6:40 PM
      To: Merchant-Users@Miva. Com
      Subject: [mru] Token for Parent Category?


      Hi All:

      I need to write a conditional for the category screen which is true only if
      the current category has child categories (IE: Is a parent category). Is
      there a token that identifies a parent category?

      Thank you

      Dave Hauser


      Comment

      Working...
      X