Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Large image in PRODUCT_INFO.PHP


john peter

Recommended Posts

Posted
I'm looking to do something like this as well, but I am just starting out with os-commerce.

 

I looked at the product_info.php file, but it doesn't look anything like the file described earlier in this thread - in fact taking a fragment from the earlier post and using it to search the file in my installation frequently comes up finding nothing.

 

Any ideas?

 

 

I'm having the same problem!

  • 10 months later...
  • Replies 51
  • Created
  • Last Reply
Posted

In case anyone is as confused by all of this as I was, and is reading through it all over and over again (like I did) - here's an extremely simple way to do this from all the above:

 

In catalog/product_info.php find:

 

<script language="javascript"><!--

document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');

//--></script>

<noscript>

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], /*SMALL_IMAGE_WIDTH*/200, /*SMALL_IMAGE_HEIGHT*/, 'hspace="5" vspace="5"') . '<br></a>'; ?>

</noscript>

[code]

 

and replace with :

[code]

<?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], '250', '250', 'hspace="5" vspace="5"'); ?>[code]

 

No need to install anything or change anything else. The '250', '250' is the width and height definition of the larger image. If you want your image standardised by either height or width (so that it scales properly), leave the other definition out. A set width of 250 where the image automatically scales to the correct height would then be coded '250', '',

 

and vice versa.

 

The above fix will give you a large image on the products page, with no "click to enlarge" and works like a charm.

 

Thanks to everyone who contributed to figuring this out!

 

Thank you so much! This worked perfectly for me.

 

Once i had changed this coding, the text on my product info page was out of alignment. If this happens to you and you don't know how to fix it, this is what worked for me:

 

Open the stylesheet.css, on approximately line 566, find :

 

.prod_info {float:left;padding:3px 1px 1px 1px;margin:0px 150px 0px 0px;}

 

This is what my code looks like now, yours may be different. But what i did was alter the Right value for the margin from 40px to become 150px, so the text starts further over to the right on the product info page, therefore correcting any issues with overlapping. It was trial and error to find the best value.

 

I hope this is helpful to someone. Thanks again everyone for your great posts, my site thanks you!

Sam

--osC newbie.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...