Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Change "click to enlarge" link to link to product_info.php


ddp

Recommended Posts

Hi all

 

I'm trying to change the functioning of product image on the product_reviews_info.php page. It functions as a popup enlargment of the image and has "click to enlarge" under the image.

 

Instead of opening up a pop up window I wanted to have the image link to the product_info.php page for the product in question.

 

I figured out the batch of code that needs to be modified:

 

<td align="center" class="smallText">
<?php
 if (tep_not_null($review['products_image'])) {
?>
<script language="javascript"><!--
document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $review['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $review['products_image'], addslashes($review['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 . $review['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $review['products_image'], $review['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
</noscript>
<?php
 }

 echo '<p><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now') . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a></p>';
?>
			</td>

However not being a coder (all I have learned about php is from working with osc) I'm not sure what to change it too.

Any help would be most welcome.

Backup before making changes. Backup before making changes! Backup before making changes!!

 

You did do a backup? eh?

Link to comment
Share on other sites

Hi all

 

I'm trying to change the functioning of product image on the product_reviews_info.php page. It functions as a popup enlargment of the image and has "click to enlarge" under the image.

 

Instead of opening up a pop up window I wanted to have the image link to the product_info.php page for the product in question.

 

I figured out the batch of code that needs to be modified:

 

 

try this

<td align="center" class="smallText">
<?php
 if (tep_not_null($review['products_image'])) {

echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $review['products_id']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $review['products_image'], $review['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>';

 }

 echo '<p><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now') . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a></p>';
?>
			</td>

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Thanks a ton for the code. :rolleyes:

That got me very close.

I took out the text link as it did not make sense to be there and changed the target of the link to self from blank and it is working perfectly.

 

Here is the edited code I used.

 <td align="center" class="smallText">
<?php
 if (tep_not_null($review['products_image'])) {

echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $review['products_id']) . '" target="_self">' . tep_image(DIR_WS_IMAGES . $review['products_image'], $review['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '</a>';

 }

 echo '<p><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now') . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a></p>';
?>
			</td>

The code makes more sense to me now thanks for the lesson.

Backup before making changes. Backup before making changes! Backup before making changes!!

 

You did do a backup? eh?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...