Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Borders on New Products Images


xolite

Recommended Posts

Hello all,

 

 

would anyone have any ideas how to get past the image wrapper found in /includes/html_output.php, i am trying to add css borders or border="1" however since the images are controlled globally, it naturally borders every single image. I am trying to put a border around "New Products" on the index only. And for the life of me, i cannot figure out a way except an entire re-write of new_products.

 

If anyone has a easier solution, i would love to hear it.

 

 

Cheers!

Link to comment
Share on other sites

Hello all,

would anyone have any ideas how to get past the image wrapper found in /includes/html_output.php, i am trying to add css borders or border="1" however since the images are controlled globally, it naturally borders every single image. I am trying to put a border around "New Products" on the index only. And for the life of me, i cannot figure out a way except an entire re-write of new_products.

 

If anyone has a easier solution, i would love to hear it.

Cheers!

 

 

You are going to have to re-write the new_products.php to suit your needs - I put borders on by adding a new css class and adding a new table in the output.

 

This is just an example of my output from the array

 

$info_box_contents[$row][$col] = array('align' => '',
									   'params' => '',
									   'text' =>'
<td>
<table class="newProductsBox" height="140" width="230"><tr><td>
<td width="12" align="center" valign="top"></td>
<td align="center" valign="top"><br>'. $theImgLink .'
<td width="120" valign="top">
<table width="100%" height="112px"  border="0" cellpadding="4">
  <tr>
	<td align="left" valign="top"><span class="newProductsBoxA">' . $new_products['products_name'] .'</span><br>
  <span class="newProductsBoxB">Item Number ' . $new_products['products_id'] . '</span><br>
  <h2 class="newProductsBoxP">' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])) .'</h2>
  '. $theLink .'
  </tr>
</table></td>
  </td></tr></table>
</td>
');

 

Hopefully that helps you get the concept, span tags rock - now the only thing this does not do is make it just for the index page, your will have to add a referring url clause to an if statement to evaluate if it is coming on the write page or not.

Nothing unreal exists

Link to comment
Share on other sites

You are going to have to re-write the new_products.php to suit your needs - I put borders on by adding a new css class and adding a new table in the output.

Way over the top dude. The tep_image function takes an optional fifth parameter. Just add your border in here wherever the function is called. The bit below is from /modules/new_products.php. THe bold red bit is the bit of code I added to get a 2px solid red border on all my new product images:

 

$info_box_contents[$row][$col] = array('align' => 'center',

'params' => 'class="smallText" width="33%" valign="top"',

'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'style="border:2px solid red;"') . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])));

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...