close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Help with Image Size on Product_detail.php

Thread began 5/04/2011 8:20 pm by uncleremus200425754 | Last modified 6/15/2011 9:39 am by Jason Byrnes | 2244 views | 8 replies |

uncleremus200425754

Help with Image Size on Product_detail.php

Does anyone know how to resize the image on the product_detail.php page?

So far, i tried to edit the "$imgWidth = 300;"
on this page: webassist\plugins\catalog\details.php

Should there be a $imgHeight ? Changing the "300" width doesnt change anything.


Any suggestions? (See the snippet of code below)


************************************************************
<div class="imageWrapper">
<?php
$imgWidth = 300;
$imgSrc = "../../../" . ($WAGLOBAL_Images_Folder) . ((isset($row_WADAProducts['ProductImage']) && $row_WADAProducts['ProductImage'] != "default-product.png")?$row_WADAProducts['ProductImage']:$row_WADAProducts['ProductThumb']);
$imgSrc = abs2rel(rel2abs($imgSrc,dirname(__FILE__)),dirname($_SERVER['PHP_SELF']));
$WAResultsImage = new WA_Include('scripts/resize_image.php');
require($WAResultsImage->BaseName);
$WAResultsImage->Initialize(true);
?>
<img class="WADAResultThumb" border="0" src="<?php echo(abs2rel(rel2abs($WAResultsImage->Body,dirname($_SERVER['PHP_SELF'])),dirname(__FILE__))); ?>" id="ProductImage" />
</div>
****************************************************************

Sign in to reply to this post

Jason ByrnesWebAssist

in the webassist/plugins/catalog/css/products_detail.css file, the image widht is constrained to 300px in the following style:
.productDetailWrapper .image img {
width: 300px;
}


you will need to edit the css as well as the code for the image size.

Sign in to reply to this post

uncleremus20285299

Thanks jason, ill give that a shot later and let u know how it goes. Thanks for the quick response....

Sign in to reply to this post

uncleremus20285299

Actually, since i need my image to have a height of 300px with a contrained proportional width, can i change the css file to use height at 300px instead of width? Would i change that to match the page code as well?

Sign in to reply to this post

Jason ByrnesWebAssist

to constrain it by height,
change:
$imgWidth = 300;

to:
$imgHeight = 300;

and change the css:
.productDetailWrapper .image img {
width: 300px;
}

to:
.productDetailWrapper .image img {
height: 300px;
}

Sign in to reply to this post

uncleremus200425754

That worked perfectly, thank u jason!

Sign in to reply to this post

Jason ByrnesWebAssist

You're welcome.

Sign in to reply to this post

uncleremus20285299

Hey Jason, I've come another issue related to this thread:

I am admin on a website that sells musical instruments. The images look fine on the product results page: products_results.php

But, some of them get squeezed when viewed on the product detail page like this:
products_detail.php?ProductID=40

Now, i figured everything would be fine since all my photos are uploaded with a 300px height. The changes i have made (with your fine help, earlier in this thread) should constrain by 300 height now. Why are some of these images getting squeezed? Any idea how i would fix this?

Sign in to reply to this post

Jason ByrnesWebAssist

looks like your original image is 100 x 155. Make sure you're original images are larger than what will be displayed in the store.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...