Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Trying to Merge Two Contributions


narcolepticdriver

Recommended Posts

Hi, for reference here's my site: www.stroller-roller.com. I originally wanted to have two separate images for each product in my website; a small one for the thumbnail and then a large one for the enlarged image. So, according to the EZ Big Image contrib...

================================================================

"You first have to create a new Dir named "big" (for exemple) in the

images dir (catalog/images/big) (pictures in english?). You have to copy there the big pictures of

your products because it don't do it automaticaly. Sorry! The name of your little and of your big image must be exactly the same.

 

The second thing to do is to replace this:

 

echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name']);

 

by this:

 

 

$dir_ws_images_big = DIR_WS_IMAGES . "big/";

echo tep_image($dir_ws_images_big . $products['products_image'], $products['products_name']);

 

 

in the body code section in popup_image.php that you find in the "catalog" directory.

 

That change the path for your picture and you can see the big one."

 

=================================================================

 

...so, I did that and it worked just fine. Then I came across another contrib that would allow users to hover the mouse over the thumbnail and see a larger image. As you can see it works great, but the enlarged image I'm getting is pixelated because it's enlarging my small thumbnail picture. Ideally I'd like to keep my small thumbnails and have the hover image taken from my images/big directory. I'm sure it's possible, I just need a little guidance! Here's the change I made using the CSS Hover contrib:

 

=================================================================

 

In file 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, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>

</noscript>

 

Replace this with:

 

<div id="pic"><a class="p1" href="#" onClick="java script:return false"><?php echo('<img src=' . DIR_WS_IMAGES . $product_info['products_image'] . ' width="' . SMALL_IMAGE_WIDTH . '" height="' . SMALL_IMAGE_HEIGHT . '">'); ?><?php echo('<img src=' . DIR_WS_IMAGES . $product_info['products_image'] . ' width="' . SMALL_IMAGE_WIDTH . '" height="' . SMALL_IMAGE_HEIGHT . '" class="large">'); ?></a></div>

Link to comment
Share on other sites

Replace this with:

 

<div id="pic"><a class="p1" href="#" onClick="java script:return false"><?php echo('<img src=' . DIR_WS_IMAGES . $product_info['products_image'] . ' width="' . SMALL_IMAGE_WIDTH . '" height="' . SMALL_IMAGE_HEIGHT . '">'); ?><?php echo('<img src=' . DIR_WS_IMAGES . $product_info['products_image'] . ' width="' . SMALL_IMAGE_WIDTH . '" height="' . SMALL_IMAGE_HEIGHT . '" class="large">'); ?></a></div>

 

I'm really no good at PHP but I do know HTML. I would say your problem stems from the hover link not being directed to the proper subfolder, it is going to the main image folder. I would try somthing like this -

 

<div id="pic"><a class="p1" href="#" onClick="java script:return false"><?php echo('<img src=' . DIR_WS_IMAGES_BIG . $product_info['products_image'] . ' width="' . SMALL_IMAGE_WIDTH . '" height="' . SMALL_IMAGE_HEIGHT . '">'); ?><?php echo('<img src=' . DIR_WS_IMAGES_BIG . $product_info['products_image'] . ' width="' . SMALL_IMAGE_WIDTH . '" height="' . SMALL_IMAGE_HEIGHT . '" class="large">'); ?></a></div>

 

What you need to do is point the hover link to the big image subfolder.

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Link to comment
Share on other sites

I'm really no good at PHP but I do know HTML. I would say your problem stems from the hover link not being directed to the proper subfolder, it is going to the main image folder. I would try somthing like this -

 

<div id="pic"><a class="p1" href="#" onClick="java script:return false"><?php echo('<img src=' . DIR_WS_IMAGES_BIG . $product_info['products_image'] . ' width="' . SMALL_IMAGE_WIDTH . '" height="' . SMALL_IMAGE_HEIGHT . '">'); ?><?php echo('<img src=' . DIR_WS_IMAGES_BIG . $product_info['products_image'] . ' width="' . SMALL_IMAGE_WIDTH . '" height="' . SMALL_IMAGE_HEIGHT . '" class="large">'); ?></a></div>

 

What you need to do is point the hover link to the big image subfolder.

 

It looks like you're on the right track. What you say makes sense. Check out my site again. There are no more images being shown, neither thumbnails nor large images. Any idea why?

Link to comment
Share on other sites

Wait, nevermind, I got it! Thanks so much for your help. You got me thinking enough to figure it out myself. For anyone's reference this is the code I used:

 

<div id="pic"><a class="p1" href="#" onClick="java script:return false"><?php $dir_ws_images_big = DIR_WS_IMAGES . "big/";

echo('<img src=' . DIR_WS_IMAGES . $product_info['products_image'] . ' width="' . SMALL_IMAGE_WIDTH . '" height="' . SMALL_IMAGE_HEIGHT . '">'); ?><?php echo('<img src=' . $dir_ws_images_big . $product_info['products_image'] . ' width="' . SMALL_IMAGE_WIDTH . '" height="' . SMALL_IMAGE_HEIGHT . '" class="large">'); ?></a></div>

 

Much appreciation~

Mark

Link to comment
Share on other sites

...now, if only I could figure out how to stretch the height of the larger image... >_<

 

I'm glad you figured it out.

That's pretty much what I end up doing... looking at the code and then trial & error until I get it right, LOL. :blush:

 

I just looked at your Stroller 12 and the hover image looks good. I'm assuming you figured out how to change the height of that?

If not I'll take a guess that might help get you thinking along the right direction again. :rolleyes:

 

I'm going to have to guess that the hover size is called out in the CSS (stylesheet) with the class - large.

The class - P1 has something to do with it but I think that just relates to the popup hyper link???

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Link to comment
Share on other sites

I just looked at your Stroller 12 and the hover image looks good. I'm assuming you figured out how to change the height of that?

If not I'll take a guess that might help get you thinking along the right direction again. :rolleyes:

 

I'm going to have to guess that the hover size is called out in the CSS (stylesheet) with the class - large.

The class - P1 has something to do with it but I think that just relates to the popup hyper link???

 

You got it. I wish I could say I figured this out for myself, but I contacted the contributor himself, and he told me to find the solution on the stylesheet. This trial and error thing is a fun way of learning, though. :thumbsup:

 

-Mark

Link to comment
Share on other sites

You got it. I wish I could say I figured this out for myself, but I contacted the contributor himself, and he told me to find the solution on the stylesheet. This trial and error thing is a fun way of learning, though. :thumbsup:

 

-Mark

 

Great Mark, glad to hear you are getting things resolved.

 

When I first started editing the code to my osC files I didn't have a clue about PHP or what to look for.

Now I can spot a few things, I refer to some books, and sometimes make a mess of things, LOL.

 

I'd rather learn/know what is going on behind the scenes of my shop than buy some ready made package and call/pay for support. :thumbsup:

 

You are right though, this trial and error thing is a fun way of learning. ;)

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...