Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How do I create a <a href product link to this code


johnnybebad

Recommended Posts

Posted

Hi,

 

I have this code which forms part of the competition (prize draw) terms and conditions I am working on.

 

The code below shows my database query and the current information displayed, what I would like to do is create a product link to the image and product description, if anyone can point me in the right direction I would be very grateful.

 

Thanks

Johnny

 

  <tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
	  </tr>
<?php
  $competition_prize_query = tep_db_query("select p.products_id, p.products_image, p.products_model, p.products_price, p.products_tax_class_id, pd.products_name, pd.products_description from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and p.products_id ='" . (int)PRIZE_ID . "' and pd.language_id = '" . (int)$languages_id . "' limit 1");
  $products_price = $currencies->display_price($prizes['products_price'], tep_get_tax_rate($prizes['products_tax_class_id']));
  if (tep_db_num_rows($competition_prize_query) >0) {
	$prizes = tep_db_fetch_array($competition_prize_query);
 }
?> 
		<td class="main" width=50% align="right" valign="top"><?php echo tep_image(DIR_WS_IMAGES . $prizes['products_image'], $prizes['products_name'], SMALL_IMAGE_WIDTH*2, SMALL_IMAGE_HEIGHT*2); ?></td>
	  <td class="main" width=50% align="left" valign="top"><?php echo '<b>' . $prizes['products_name'] . '</B><BR>' . $prizes['products_description'] . '</B><BR>' . '<b>Model : </b>' . $prizes['products_model'] . '</B><BR>' . '<b>Value : </b>' . $products_price = $currencies->display_price($prizes['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])); ?></td></td>

Getting better with mods but no programmer am I.

Posted

Hi,

 

Think i have got something that works, can anyone advise if this is correct/ best practice coding please.

 

<td class="main" width=50% align="right" valign="top"><?php echo'<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $prizes['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $prizes['products_image'], $prizes['products_name'], SMALL_IMAGE_WIDTH*2, SMALL_IMAGE_HEIGHT*2); ?></a></td>

 

 

Thanks

Johnny

Getting better with mods but no programmer am I.

Posted

'<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $prizes['products_id'] ) . '">';

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Archived

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

×
×
  • Create New...