Solved

Joomla - Virtuemart - set the image width for normal pictures

Posted on 2011-09-04
14
603 Views
Last Modified: 2012-05-12
Hello,

In the same way as I can set the "Thumbnail Image Width", I need to set the image width.

Reason: the pictures have different width and the Product detail the whole layout is different.
compare the two products:

http://www.egyediszoftverek.hu/ideig/joomla_ideig/index.php?page=shop.product_details&product_id=907&category_id=1&flypage=flypage_sts2.tpl&option=com_virtuemart&Itemid=60

and

http://www.egyediszoftverek.hu/ideig/joomla_ideig/index.php?page=shop.product_details&flypage=flypage_sts2.tpl&product_id=890&category_id=1&option=com_virtuemart&Itemid=60

Every picture should have the same width as the second (337 pixels).

Thank you
0
Comment
Question by:starhu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 6
14 Comments
 
LVL 12

Expert Comment

by:Panagiotis S
ID: 36480425
most of your problems in your site have to do with width!

you have to assign the width tag in the container (div or class) in order to have the results you want
0
 

Author Comment

by:starhu
ID: 36480458
"most of your problems in your site have to do with width!"
It is true, but the customer is the problem :-( at my previous webshop that customer said at first glance that everything was fine, this customer picks a quarrel every time, nothing is good for him.

By the way it is not only me who has this image size problem with VM, I found the same question many times in google, but there was no proper answer.

I modified the flypage like this (vm_detail_pict):

<?php  if( $this->get_cfg('showManufacturerLink') ) { $rowspan = 5; } else { $rowspan = 4; } ?>
        <td width="33%" rowspan="<?php echo $rowspan; ?>" valign="top"><br/>
          <div class="vm_detail_pict">
              <?php echo urldecode( $product_image ) ?><br/><br/><?php echo $this->vmlistAdditionalImages( $product_id, $images ) ?>
            </div>
            </td>

And the css:

div#vm_detail_pict
{
 width:337;

}

But it didn't work. In FireBug the result is:

<div class="vm_detail_pict">
              <a rel="lightbox[product907]" title="MARILYN 265" href="http://www.egyediszoftverek.hu/ideig/joomla_ideig/components/com_virtuemart/shop_image/product/239632.jpg"><img width="450" height="379" border="0" alt="MARILYN 265" src="http://www.egyediszoftverek.hu/ideig/joomla_ideig/components/com_virtuemart/shop_image/product/239632.jpg"><br>Teljes méretu kép megtekintése</a><br><br>            </div>
<a rel="lightbox[product907]" title="MARILYN 265" href="http://www.egyediszoftverek.hu/ideig/joomla_ideig/components/com_virtuemart/shop_image/product/239632.jpg"><img width="450" height="379" border="0" alt="MARILYN 265" src="http://www.egyediszoftverek.hu/ideig/joomla_ideig/components/com_virtuemart/shop_image/product/239632.jpg"><br>Teljes méretu kép megtekintése</a>
0
 
LVL 12

Expert Comment

by:Panagiotis S
ID: 36480468
ok but the div is inside a td of 33% width and that the problem
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:starhu
ID: 36480531
I deleted the td of 33% width but nothing has changed.

The img width="450" height="379"  is set in another file, not in the flypage (but I don't know where).
0
 
LVL 12

Expert Comment

by:Panagiotis S
ID: 36480539
look at the admin of virtuemart
0
 

Author Comment

by:starhu
ID: 36480545
I can set there only  "Thumbnail Image Width" and  "Thumbnail Image Height" but not "Image Width" and  "Image Height"
0
 
LVL 12

Expert Comment

by:Panagiotis S
ID: 36480559
so its on the flypage that you use maybe not as width and height but as the full image
0
 

Author Comment

by:starhu
ID: 36480569
This is my flypage, maybe this will help:

 
<?php if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
mm_showMyFileName(__FILE__);
 ?>

<?php //echo $buttons_header // The PDF, Email and Print buttons ?>

<br/>
<?php
if( $this->get_cfg( 'showPathway' )) {
 	echo "<div class=\"pathway\">$navigation_pathway</div>";
}
if( $this->get_cfg( 'product_navigation', 1 )) {
	if( !empty( $previous_product )) {
		 echo '<a class="previous_page" href="'.$previous_product_url.'">'.shopMakeHtmlSafe($previous_product['product_name']).'</a>';
		
	}
	if( !empty( $next_product )) {		
		echo '<a class="next_page" href="'.$next_product_url.'">'.shopMakeHtmlSafe($next_product['product_name']).'</a>';
		
		
	}
}
?>



<table border="0" style="width: 100%;" align="left" cellpadding="2">
  <tbody>
	<tr>
<?php  if( $this->get_cfg('showManufacturerLink') ) { $rowspan = 5; } else { $rowspan = 4; } ?>
	  <td  rowspan="<?php echo $rowspan; ?>" valign="top"><br/>
	    <div class="vm_detail_pict">
	  	<?php echo urldecode( $product_image ) ?><br/><br/><?php echo $this->vmlistAdditionalImages( $product_id, $images ) ?>
		</div>
		</td>
		
	  <td rowspan="1" colspan="2">
	  <h1><?php echo $product_name ?> <?php echo $edit_link ?></h1>
	  </td>
	</tr>
	<?php if( $this->get_cfg('showManufacturerLink')) { ?>
		<tr>
		  <td rowspan="1" colspan="2"><?php echo $manufacturer_link ?><br /></td>
		</tr>
	<?php } ?>
	<tr>
      <td valign="top" align="left">
      	<?php echo $product_price_lbl ?>
      	<?php echo $product_price ?><br />
		<a href="index.php?option=com_virtuemart&page=shop.registration" class="button">Legyen a partner&uuml;nk</a>
		</td>
      <td valign="top"><?php echo $product_packaging ?><br /></td>
	</tr>
	
	<!--
	<tr>
	  <td colspan="2"><?php echo $ask_seller ?></td>
	</tr>
	rowspan="1" colspan="2" 
	
	-->
		
	<tr>
	  <td style="font-size:15px; font-weight:bold; color: #3333FF; "><hr />
	  	<?php echo $product_s_desc ?>   <br/>
	  	<span style="font-style: italic;"><?php echo $file_list ?></span>
	  </td>
	</tr>		
		
	<tr>
	  <td style="font-size:7px; font-weight:bold; color: #000000; "><hr />
	  	<?php echo $product_description ?><br/>
	  	<span style="font-style: italic;"><?php echo $file_list ?></span>
	  </td>
	</tr>
	
	<tr>
	  <td><?php 
	  		if( $this->get_cfg( 'showAvailability' )) {
	  			echo $product_availability; 
	  		}
	  		?><br />
	  </td>
	  <td colspan="2"><br /> <!--  <?php echo $addtocart ?>  --> </td>
	</tr>
	<tr>
	  <td colspan="3"><?php echo $product_type ?></td>
	</tr>
	<tr>
	  <td colspan="3"><hr /><?php echo $product_reviews ?></td>
	</tr>
	<tr>
	  <td colspan="3"><?php echo $product_reviewform ?><br /></td>
	</tr>
	<tr>
	  <td colspan="3"><?php echo $related_products ?><br />
	   </td>
	</tr>
	<?php if( $this->get_cfg('showVendorLink')) { ?>
		<tr>
		  <td colspan="3"><div style="text-align: center;"><?php echo $vendor_link ?><br /></div><br /></td>
		</tr>
	<?php  } ?>
	<?php if( isset($paypalLogo)) : ?>
		<tr>
			<td colspan="3" align="center">
				<?php echo $paypalLogo ?>
			</td>
		</tr>
	<?php endif;?>
  </tbody>
</table>



<?php 

if( !empty( $recent_products )) { ?>
	<div class="vmRecent">
	<?php 
	  //echo $recent_products; 
	?>
	
	</div>

<?php 
}
if( !empty( $navigation_childlist )) { ?>
	<?php echo $VM_LANG->_('PHPSHOP_MORE_CATEGORIES') ?><br />
	<?php echo $navigation_childlist ?><br style="clear:both"/>
<?php 
} ?>

Open in new window

0
 

Accepted Solution

by:
starhu earned 0 total points
ID: 36480829
I found the solution:

<img src="./components/com_virtuemart/shop_image/product/<?php echo $product_full_image ?>" width="337" > 
0
 

Author Closing Comment

by:starhu
ID: 36508811
I found the solution
0
 
LVL 12

Expert Comment

by:Panagiotis S
ID: 36481053
where was the above?
0
 

Author Comment

by:starhu
ID: 36485420
This wasn't above. I found the solution after hours of trying:

"<img src="./components/com_virtuemart/shop_image/product/<?php echo $product_full_image ?>" width="337" >  "
0
 
LVL 12

Expert Comment

by:Panagiotis S
ID: 36485429
did you put that to your flypage ?
0
 

Author Comment

by:starhu
ID: 36485555
Yes
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question