Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Need help with short code


MAD King

Recommended Posts

Posted

Hi,

 

I couldnt get it. May someone of you Programmers can help me.

 

I am trying to put this two codes together:

 

<?php
$currentid = $HTTP_GET_VARS['products_id'];
$family_query = tep_db_query("select products_family from " . TABLE_PRODUCTS . " where products_id='" . $HTTP_GET_VARS['products_id'] . "'");
$results = tep_db_fetch_array($family_query);
if ($results['products_family']=== '')
{ ?>
			<td class="main" align="right"><?php echo 'Menge: ' . tep_draw_input_field('quantity', '1', 'SIZE=2 maxlength=2') . tep_draw_separator('pixel_trans.gif', '5', '1') . tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART, 'align=absmiddle'); ?></td></form>
<?php
}
?>

 

<?php
 $products_sold_out = '';
$stock_left = tep_get_products_stock($products_id) - $products_quantity;
$products_sold_out = stock_left;
if ($stock_left > 0) {
$submit_button = tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART);
} else {
$submit_button = tep_image(DIR_WS_LANGUAGES . $language . '/images/buttons/button_sold_out.gif', 'Sold Out', IMAGE_BUTTON_SOLD_OUT);
 }
?>
			<td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . $submit_button; ?></td>

 

Thank you

Archived

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

×
×
  • Create New...