jimmyfortune Posted November 21, 2011 Share Posted November 21, 2011 hi guys, below you find my code for the also_purchased_products.php file. For some reason it displays the price without VAT and I can't find the issue. Can anyone help? Thanks! <?php /* $Id: also_purchased_products.php,v 1.21 2003/02/12 23:55:58 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ if (isset($HTTP_GET_VARS['products_id'])) { $orders_query = tep_db_query("select p.products_id, p.products_image, p.products_model, p.products_price, s.status as specstat, specials_new_products_price from " . TABLE_ORDERS_PRODUCTS . " opa, " . TABLE_ORDERS_PRODUCTS . " opb, " . TABLE_ORDERS . " o, " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where opa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and opa.orders_id = opb.orders_id and opb.products_id != '" . (int)$HTTP_GET_VARS['products_id'] . "' and opb.products_id = p.products_id and opb.orders_id = o.orders_id and p.products_status = '1' group by p.products_id order by o.date_purchased desc limit " . MAX_DISPLAY_ALSO_PURCHASED); $num_products_ordered = tep_db_num_rows($orders_query); if ($num_products_ordered >= MIN_DISPLAY_ALSO_PURCHASED) { ?> <!-- also_purchased_products //--> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => TEXT_ALSO_PURCHASED_PRODUCTS); new contentBoxHeading($info_box_contents); $row = 0; $col = 0; $info_box_contents = array(); while ($orders = tep_db_fetch_array($orders_query)) { $orders['products_name'] = tep_get_products_name($orders['products_id']); /* BEGIN EASY CALL FOR PRICE v1.0 */ if (($orders['specials_new_products_price'] == CALL_FOR_PRICE_VALUE) && ($orders['products_price'] == CALL_FOR_PRICE_VALUE)){ $p_buy_now = '<a href="products_new.php">'.tep_image_button('button_continue_shopping1.gif', IMAGE_BUTTON_CONTINUE).'</a>'; } elseif(($orders['specials_new_products_price'] == CALL_FOR_PRICE_VALUE) && ($orders['products_price'] < CALL_FOR_PRICE_VALUE)) { $p_buy_now = '<a href="products_new.php">'.tep_image_button('button_continue_shopping1.gif', IMAGE_BUTTON_CONTINUE).'</a>'; } elseif(($orders['specials_new_products_price'] == "") && ($orders['products_price'] > CALL_FOR_PRICE_VALUE)) { $p_buy_now = '<a href="'.tep_href_link("products_new.php","action=buy_now&products_id=".$orders['products_id']).'">'.tep_image_button('button_add_to_cart2.gif', '', ' class="btn1"').'</a>'; } elseif(($orders['specials_new_products_price'] == CALL_FOR_PRICE_VALUE) && ($orders['products_price'] > CALL_FOR_PRICE_VALUE)) { $p_buy_now = '<a href="products_new.php">'.tep_image_button('button_continue_shopping1.gif', IMAGE_BUTTON_CONTINUE).'</a>'; } else { $p_buy_now = '<a href="'.tep_href_link("products_new.php","action=buy_now&products_id=".$orders['products_id']).'">'.tep_image_button('button_add_to_cart2.gif', '', ' class="btn1"').'</a>'; } /* END EASY CALL FOR PRICE v1.0 */ if($orders['specstat']) { $info_box_contents[$row][$col] = array('align' => 'left', 'params' => ' style="width:25%;"', 'text' => ''.tep_draw_prod2_top().' <table cellpadding="0" cellspacing="0" border="0"> <tr><td class="name name2_padd"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $orders['products_id']) . '">' . $orders['products_name'] . '</a></td></tr> <tr><td class="pic2_padd">'.tep_draw_prod_pic_top().'<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $orders['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $orders['products_image'], $orders['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'.tep_draw_prod_pic_bottom().'</td></tr> <tr><td class="price2_padd"><div class="fl_left"><b>'.PRICE.':</b></div><div class="fl_right">' . $currencies->display_price_with_model($orders['specials_new_products_price'], tep_get_tax_rate($orders['products_tax_class_id']),1,$orders['products_model']) . '</div></td></tr> <tr><td class="button2_padd button2_marg">'.$p_buy_now/*.''.$p_details*/.'</td></tr> </table> '.tep_draw_prod2_bottom().''); } else { $info_box_contents[$row][$col] = array('align' => 'left', 'params' => ' style="width:25%;"', 'text' => ''.tep_draw_prod2_top().' <table cellpadding="0" cellspacing="0" border="0"> <tr><td class="name name2_padd"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $orders['products_id']) . '">' . $orders['products_name'] . '</a></td></tr> <tr><td class="pic2_padd">'.tep_draw_prod_pic_top().'<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $orders['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $orders['products_image'], $orders['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'.tep_draw_prod_pic_bottom().'</td></tr> </table> '.tep_draw_prod2_bottom().''); } $col ++; if ($col > 3) { $col = 0; $row ++; } } new contentBox($info_box_contents); ?> <!-- also_purchased_products_eof //--> <?php } } ?> Link to comment Share on other sites More sharing options...
jimmyfortune Posted November 22, 2011 Author Share Posted November 22, 2011 anyone? Link to comment Share on other sites More sharing options...
jimmyfortune Posted November 27, 2011 Author Share Posted November 27, 2011 what a great forum this is!!! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.