Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Easy question I think. Editting Product_info.php


DejaVu

Recommended Posts

Posted

I've found a replacement script I want to use on my site for the Image previews instead of the run of the mill popup.

 

If this is possible, I'll add a write up as to how to do it, but I first need some assistance fromsomeone who doesnt get confused by coding (Not Me, LOL!!)

 

Firstly, In product_info.php I found the popup script -

 

<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>

 

All I wish to do is remove THAT completely and implement what is needed into this -

<a class='expand_a' onclick='imagezoom(this, "http://url.to/full.size.image")'> 
<img src="http://url.to/thumbnail.image" class='expand_img' /> 
</a>

 

I realise the URL's in the thumbnail is the same. But I cant work out how to parse the code correctly, can someone have a go before I give myself headache.

 

Thanks in advance.

Posted

Been working on this for hours now and just cannot seem to get it right.

 

All I really need is the Image URL's from product_info.php put into the correct place. Can someone have a look and let me know how to parse this? It cant be too difficult is it?

Posted
<?php echo '<a class="expand_a" onclick="imagezoom(this, "'. tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '")">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5" class="expand_img"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>

Posted

Thats awesome, not quite the one I was after. But still pretty good nonetheless. Thanks toyicebear.

 

That will give me some more insight iton how to do it! :)

Posted
<?php echo '<a class="expand_a" onclick="imagezoom(this, "'. tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '")">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5" class="expand_img"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>

Not to sure what the problem is, but it's complaining of a syntax error.

Posted
<?php echo '<a class="expand_a" onclick="imagezoom(this, '. tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . ')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5" class="expand_img"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>

Posted

Still recieving an error. It's says

Error - Expected ')'

In IE6

 

Although, viewing the source it does appear correct...

<a class="expand_a" onclick="imagezoom(this, http://www.ticklesticks.co.uk/images/08531.jpg)"><img src="images/08531.jpg" border="0" alt="" title="" width="100" height="80" hspace="5" vspace="5" class="expand_img"><br>Click to enlarge</a><noscript>
<a href="http://www.ticklesticks.co.uk/images/08531.jpg" target="_blank"><img src="images/08531.jpg" border="0" alt="" title="" width="100" height="80" hspace="5" vspace="5"><br>Click to enlarge</a></noscript>

 

I have removed the alts from the images as they are inappropriate ! LOL

Posted
I don't get an error at all. Works fine for me.

I swapped the versions over! I currently have 2 working on the site.

 

This is a prefab one made by some here on OSCommerce (Controlled by CSS) -

http://www.ticklesticks.co.uk/product_info...products_id=864

 

This is the one I'm trying to get working exactly the same as THIS EXAMPLE.

http://www.ticklesticks.co.uk/product_info...products_id=864 It Dynamically zooms towards you onscreen.

 

Notice product_info2.php (the above link is shortened by the forum, check your status bar) this is the one I'm trying to get sorted. If you view the source, it's exactly the same as it's ment to be though (I could be wrong!).

 

Sorry, I should have said this before my previous post! Doh!

Archived

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

×
×
  • Create New...