Magento Expert Forum - Improve your Magento experience

Results 1 to 2 of 2

Help with Atributes and output.

  1. #1
    New member
    Join Date
    Sep 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help with Atributes and output.

    Hello,

    We made some custom attributes that house extra descriptions that we display on our product pages.



    We are using jquery and .accordion :
    Code:
    				<li>
    					<div class="handle">
    						<h3><?php echo $this->__('Measuring') ?></h3>
    						<span></span>
    					</div>
    					<div class="panel loading">
    						<?php echo $this->__($_product->getData('usak_measuring')); ?>
    					</div>
    				</li>
                                    <li>
    					<div class="handle">
    						<h3><?php echo $this->__('Availability') ?></h3>
    						<span></span>
    					</div>
    					<div class="panel loading">
    						<?php echo $this->__($_product->getData('usak_avil')); ?>
    					</div>
    				</li>
    What we would like to do is, if the the attribute "usak_avil" is not populate in for that product, it would not show <li> for that section. Example: For our kilts, we have measuring instructions, but for a kilt pin, we don't have measuring instructions, so we would like to have it hidden.

    View more threads in the same category:


  2. #2
    Junior Member arunthomas203's Avatar
    Join Date
    Oct 2014
    Posts
    16
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Hi Robsch

    Can you try with the following

    PHP Code:
    <li>
        <div class="handle">
            <h3><?php echo $this->__('Measuring'?></h3>
            <span></span>
        </div>
        <div class="panel loading">
            <?php echo $this->__($_product->getData('usak_measuring')); ?>
        </div>
    </li>


    <?php $usak_avil $_product->getData('usak_avil'); ?>

    <?php if(trim($usak_avil) != ""): ?>
    <li>
        <div class="handle">
            <h3><?php echo $this->__('Availability'?></h3>
            <span></span>
        </div>
        <div class="panel loading">
            <?php echo $usak_avil?>
        </div>
    </li>

    <?php endif; ?>
    Cheers
    Arun

Bookmarks

Posting Permissions

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