function tep_get_formats_buy_now($products_id,$tax_id) { global $currencies; $formats_query = tep_db_query("select distinct pa.products_attributes_id, pa.options_values_price, pa.options_values_id, ov.products_options_values_name from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " ov where pa.options_values_id = ov.products_options_values_id and options_id = 1 and products_id = '" . $products_id . "' order by ov.products_options_values_name"); $column = 0; $row = 0; $box_contents = array(); $max_formats = 3; while($formats = tep_db_fetch_array($formats_query)) { $result = ''; $result .= tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); $result .= tep_draw_hidden_field('products_id', $formats['products_id']); $result .= tep_draw_hidden_field('id[1]',$formats['options_values_id']); $result .= '
' . $formats['products_options_values_name']. '
'.$currencies->display_price($formats['options_values_price'],tep_get_tax_rate($tax_id)).'
' . tep_template_image_submit('button_in_cart.gif', $formats['products_options_values_name'] . ' ' . IMAGE_BUTTON_BUY_NOW).'
'; if (tep_session_is_registered('customer_id')) $result .= '' . tep_image_button('button_add_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST) . '
'; $result .= ''; $box_contents[$row][$column] = array('align' => 'center' , 'params' => 'valign="top"', 'text' => $result); $column ++; if ($column >= 3) { $row ++; $column = 0; } } return new productListingBox($box_contents); }