Solved

Joomla - Virtuemart - set the image width for normal pictures

Posted on 2011-09-04
14
598 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
  • 8
  • 6
14 Comments
 
LVL 12

Expert Comment

by:panagiotiss
Comment Utility
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
Comment Utility
"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:panagiotiss
Comment Utility
ok but the div is inside a td of 33% width and that the problem
0
 

Author Comment

by:starhu
Comment Utility
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:panagiotiss
Comment Utility
look at the admin of virtuemart
0
 

Author Comment

by:starhu
Comment Utility
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:panagiotiss
Comment Utility
so its on the flypage that you use maybe not as width and height but as the full image
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:starhu
Comment Utility
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
Comment Utility
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
Comment Utility
I found the solution
0
 
LVL 12

Expert Comment

by:panagiotiss
Comment Utility
where was the above?
0
 

Author Comment

by:starhu
Comment Utility
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:panagiotiss
Comment Utility
did you put that to your flypage ?
0
 

Author Comment

by:starhu
Comment Utility
Yes
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

First of all, we will need Jumi component or Sourcerer plugin for this to work. We need either of these because the main focus here is custom development outside of the standard modules or articles within Joomla. You can find Jumi here...it's my …
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now