Hi all,
hopefully i can seek some assistance here, this may sound like a simple issue but i cant seem to get it right.
here goes....
i have a e-commerce site that is based on virtuemart, i am building a template for a category page that lists all the products in the desired category, the problem i am having is getting the image in the product box right.
what i want it to do is resize the image to an maximum off 200px height and width but maintain the image constraint. the problem have is that all the product images vary in dimension so if i resize by width only the height will overflow and vice versa.
hope this makes sense, an example of mycode is bellow,not sure if i might have to use a java querry etc.......
Quote:
<?php if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
<?php if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
mm_showMyFileName(__FILE__);
?>
<div style="width:290px; height: 366px; padding: 0px 3px 3px 3px; background-image:url(http://www.easyfireplace.co.uk/compo...s/PB-BG1.jpg); background-repeat: no-repeat;">
<div align="center">
<div style="width: 270px; height: 50px; padding-left: 10px; padding-top: 10px; text-align:center; font-family:Verdana, Geneva, sans-serif; font-size:14px; font-weight: bold; text-decoration:none;">
<a href="<?php echo $product_flypage ?>"><?php echo $product_name ?></a>
</div>
<div class="iwd_prod_hol">
<div style="float:left;width:290px; height: auto; " >
<a href="<?php echo $product_flypage ?>">
<!-- inset image contenthere --------------------->
<div style="width: 270px; padding-left: 10px;">
<?php echo ps_product::image_tag( $product_thumb_image, 'class="browseProductImage" border="0" title="'.$product_name.'" Width="270px" alt="'.$product_name .'"' ) ?></div>
</a>
</div>
<div style="float:left; width:250px; height:40px; color: #EF531F; padding-left: 30px; padding-top: 10px; text-align:center; font-family:Verdana, Geneva, sans-serif; font-size: 14px; font-weight: bold;"><?php echo $product_s_desc ?></div></div>
<div style="width: 270px; height: 56px; padding-left: 10px;">
<div style="float:left;width:100px; height:55px;">
<div style="Width: 100px; height: 20px; ">
<img src="http://www.domain.co.uk/components/com_virtuemart/themes/default/images/ourprice.png" width="100" height="20">
</div>
<div style="Width: 100px; height: 35px; ">
<h3> <?php echo " $product_price" ?></h3>
</div>
</div>
</div>
<div style="width: 70px; height:55px; float: left;"></div>
<div style="float: left; width: 100px; height:55px;">
<?php //echo $form_addtocart ?><div align="right">
<a href="<?php echo $product_flypage ?>"><img src="http://www.easyfireplace.co.uk/components/com_virtuemart/themes/default/images/moreInfoIcon.png" width="100" height="55"></a></div>
</div>
</div>
</div>
</div>
|