Help - Search - Members - Calendar
Full Version: Else/If Statement to Hide Enlarge Image Link
Avactis Shopping Cart Forums > Avactis Technical Issues > Graphic Design Help, Ideas and Fun Cart Tweaks
Lavern
Hello,

I need to be able to hide the enlarge image link on the product info page when there is no large product image.

Can anyone help me with this?

Here is the code I want to show when there is a large product image:

CODE
<a href="<?php ProductLargeImageSrc(); ?>" title="<?php ProductImageAltText(); ?> Richly Scented Candle" rel="lightbox"><img class="candle" src="<?php ProductSmallImageSrc(); ?>" alt="<?php ProductImageAltText(); ?> Richly Scented Candle" title="<?php ProductImageAltText(); ?> Richly Scented Candle" height="<?php ProductSmallImageHeight(); ?>" width="<?php ProductSmallImageWidth(); ?>" /></a><br /><a style="font-size: .8em; text-align: center; width: 99%;" rel="lightbox" href="<?php ProductLargeImageSrc(); ?>" title="<?php ProductImageAltText(); ?> Richly Scented Candle">Enlarge Image</a>


Here is the code to show when there is no large product image:

CODE

<img class="candle" src="<?php ProductSmallImageSrc(); ?>" alt="<?php ProductImageAltText(); ?> Richly Scented Candle" title="<?php ProductImageAltText(); ?> Richly Scented Candle" height="<?php ProductSmallImageHeight(); ?>" width="<?php ProductSmallImageWidth(); ?>" />


I would appreciate your help. My PHP knowledge is very limited and I am having some trouble getting this.
Alex Girin
Hello Lavern,

Thank you for your inquiry.

Try to replace
CODE
<a style="font-size: .8em; text-align: center; width: 99%;" rel="lightbox" href="<?php ProductLargeImageSrc(); ?>" title="<?php ProductImageAltText(); ?> Richly Scented Candle">Enlarge Image</a>

with
CODE
<a style="font-size: .8em; text-align: center; width: 99%; display: <?php (ProductLargeImageSrc()? "inline":"none";) ?>;" rel="lightbox" href="<?php ProductLargeImageSrc(); ?>" title="<?php ProductImageAltText(); ?> Richly Scented Candle">Enlarge Image</a>


Best Regards,
Alex Girin
Avactis Shopping Cart Team
Lavern
I changed my code and it still doesn't work. I want to totally remove the enlarge image text link. Also the image is a link and I want to remove the link on the image too.

Here is my code:

CODE
<a href="<?php ProductLargeImageSrc(); ?>" title="<?php ProductImageAltText(); ?> Richly Scented Candle" rel="lightbox"><img class="candle" src="<?php ProductSmallImageSrc(); ?>" alt="<?php ProductImageAltText(); ?> Richly Scented Candle" title="<?php ProductImageAltText(); ?> Richly Scented Candle" height="<?php ProductSmallImageHeight(); ?>" width="<?php ProductSmallImageWidth(); ?>" /></a><br /><br /><a style="font-size: .8em; text-align: center; width: 99%; display: <?php (ProductLargeImageSrc()? "inline":"none";) ?>;" rel="lightbox" href="<?php ProductLargeImageSrc(); ?>" title="<?php ProductImageAltText(); ?> Richly Scented Candle">Enlarge Image</a>
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Copyright © 2004-2006 Avactis Ecommerce Shopping Cart Software. All Rights Reserved.
Invision Power Board © 2001-2013 Invision Power Services, Inc.