Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    May 2006
    Posts
    313
    Plugin Contributions
    0

    Default Conditional Size Charts

    Hey everyone,

    thanks in advance for all the help as always...


    so i've got an image on my tpl_product_info_display.

    Code:
    <!--bof Size Chart - Women -->
    <br class="clearBoth" />
    <div id="sizechartWomen"><?php echo SIZECHART_WOMEN; ?></div>
    <!--eof Size Chart - Women -->

    now, i'd like to create an 'if' that says only show this image if it is in the "Women's Category" and create the same for "Men's" with an 'else' of nothing at all.

    please, forgive me, but i'm still trying to get a handle on the if's and but's.

    any advice?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Conditional Size Charts

    How do you determine whether it's Men's or Women's?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    May 2006
    Posts
    313
    Plugin Contributions
    0

    Default Re: Conditional Size Charts

    just by category...

    this particular site, only has women's and men's categories for now.


    thanks again,


    adam.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Conditional Size Charts

    You could try this:
    PHP Code:
    <?php if ($current_category_id == 1) { ?>
    <!--bof Size Chart - Women -->
    <br class="clearBoth" />
    <div id="sizechartWomen"><?php echo SIZECHART_WOMEN?></div>
    <!--eof Size Chart - Women -->
    <?php } elseif ($current_category_id == 2) { ?>
    <!--bof Size Chart - Men-->
    <br class="clearBoth" />
    <div id="sizechartMen"><?php echo SIZECHART_MEN?></div>
    <!--eof Size Chart - Men-->
    <?php ?>
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    May 2006
    Posts
    313
    Plugin Contributions
    0

    Default Re: Conditional Size Charts

    You absolutely nailed it...


    i now see how this works, and can probably apply it to several other things.


    thanks again.

  6. #6
    Join Date
    Sep 2004
    Posts
    335
    Plugin Contributions
    0

    Default Re: Conditional Size Charts

    let us see your mode in action.

  7. #7
    Join Date
    May 2006
    Posts
    313
    Plugin Contributions
    0

    Default Re: Conditional Size Charts

    definitely.

    its on a local server right now, but i should have the whole thing uploaded in a week or so...

    i'm probably going to throw something similiar onto a few of the other sites i have up and floating around right now.

    right when i do it, i'll let you know.



    take care.

 

 

Similar Threads

  1. My bandwidth usage is off the charts!
    By ams30gts in forum General Questions
    Replies: 6
    Last Post: 4 Dec 2010, 02:58 PM
  2. Conditional dropdowns
    By cslinux in forum General Questions
    Replies: 12
    Last Post: 31 Aug 2010, 10:29 PM
  3. Conditional Attributes
    By brandonturpin in forum General Questions
    Replies: 0
    Last Post: 15 Mar 2010, 09:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg