Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

A challenge for you PHP heads


Guest

Recommended Posts

I've tried several ways to write this so it is in the right syntax but just can't seem to get my head around the way to make it work.

 

I'm trying to re-write the way the image pop-up box works and here's what the HTML will look like when generated:

<a href="image_name.jpg" onClick="return openPopup('image_name.jpg','product_name');">

 

of course the image_name and product_name will be dynamically generated like it is now in the default version of OSC.

 

Here's the section of the code I'm trying to re-write so that it does the above:

<?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>'; ?>

 

Who's up for the challenge?

 

When finised this will make a great contribution (most of the heavy work is in the javascript file). Details to come...

Link to comment
Share on other sites

I've tried several ways to write this so it is in the right syntax but just can't seem to get my head around the way to make it work.

 

I'm trying to re-write the way the image pop-up box works and here's what the HTML will look like when generated:

<a href="image_name.jpg" onClick="return openPopup('image_name.jpg','product_name');">

 

of course the image_name and product_name will be dynamically generated like it is now in the default version of OSC.

 

Here's the section of the code I'm trying to re-write so that it does the above:

<?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>'; ?>

 

Who's up for the challenge?

 

When finised this will make a great contribution (most of the heavy work is in the javascript file). Details to come...

 

hope I did not miss a quote :

 

echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" Onclick="return openPopup(\'' . $product_info['products_image'] . '\', \'' . $product_info['products_name'] . '\');">' . 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>';

Treasurer MFC

Link to comment
Share on other sites

Amanda, Thanks for your quick response and for a great solution. I'm going to have to work on it a bit more to get it to do what I really wanted. It does provide me with the correctly generated html however and I thank you for solution.

Link to comment
Share on other sites

Amanda, Thanks for your quick response and for a great solution. I'm going to have to work on it a bit more to get it to do what I really wanted. It does provide me with the correctly generated html however and I thank you for solution.

 

looking forward to your contribution.

Treasurer MFC

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...