Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product_info update


Guest

Recommended Posts

Hi

 

I want to add an extra field between the Product Name and Product Price, I worked out where it has to go and have put a table cell there and inputed some text to make sure this is correct place.

 

I have created the field in the products table and called it products_weightdisplay, what I need is depending on the product to have a choice of three text fields that will relate the price either to a kilo price, a pack price and another one.

 

I've hunted through the contributions and forums and can't find anything that totally matches my requirements.

 

Any help is greatly appreciated.

Link to comment
Share on other sites

If this helps this is what I have tried so far:-

<?php
 } else {
   $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, [color="#FF0000"]p.products_weightdisplay[/color], p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
   $product_info = tep_db_fetch_array($product_info_query);

   tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

   if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
     $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
   } else {
     $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
   }

   if (tep_not_null($product_info['products_model'])) {
     $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';
   } else {
     $products_name = $product_info['products_name'];
[color="#FF0000"]$products_weightdisplay = $product_info['products_weightdisplay'];[/color]

   }
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading" valign="top"><?php echo $products_name; ?></td>
[color="#FF0000"]<td class="pageHeading" valign="top"><?php echo $products_weightdisplay ?>kp</td>[/color]
           <td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>
         </tr>
       </table></td>
     </tr>

 

You can see the coding I have added in red and my placement identifier kp in the last red part.

Link to comment
Share on other sites

I don't seem to be getting any information from the database from my products_weightdisplay query, can anyone spot where I am going wrong!!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...