ivalea Posted October 2, 2006 Share Posted October 2, 2006 Hi all - I'm working with oscommerce and am trying to modify my checkout_success page to basically display a form if the customer purchased a certain model number.right now here is my select statement:[code]$products_array = array(); $products_query = tep_db_query("select products_id, products_name, products_model from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$orders['orders_id'] . "' order by products_name"); while ($products = tep_db_fetch_array($products_query)) { $products_array[] = array('id' => $products['products_id'], 'text' => $products['products_name'], 'model' => $products['products_model']); } }[/code]And this is what I have to display the form:[code]if ($products_array['model'] == 'm1'){ include(form.php); }else{ echo ''; }[/code]The problem is that even when the correct model is purchased that part of the page is still blank - not even so much as an error code. Any thoughts on how I can get this working?Thanks! :) Quote Link to comment Share on other sites More sharing options...
keithschm Posted October 2, 2006 Share Posted October 2, 2006 wherein checkout_success.php are you putting the code? Quote Link to comment Share on other sites More sharing options...
ivalea Posted October 2, 2006 Author Share Posted October 2, 2006 on line 97 - right after this code which displays the checkbox to receive notifications on items just purchased:[code]$products_displayed = array(); for ($i=0, $n=sizeof($products_array); $i<$n; $i++) { if (!in_array($products_array[$i]['id'], $products_displayed)) { echo tep_draw_checkbox_field('notify[]', $products_array[$i]['id']) . ' ' . $products_array[$i]['text'] . '<br>'; $products_displayed[] = $products_array[$i]['id']; } } echo '</p>'; } else { echo TEXT_SEE_ORDERS . '<br><br>' . TEXT_CONTACT_STORE_OWNER; }[/code] Quote Link to comment Share on other sites More sharing options...
keithschm Posted October 2, 2006 Share Posted October 2, 2006 try this[code]$products_array = array();$products_query = tep_db_query("select products_id, products_name, products_model from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$orders['orders_id'] . "' order by products_name"); while ($products = tep_db_fetch_array($products_query)) { $model = $products['products_model']; }if ($model == 'm1'){ include(form.php); }else{ echo ''; }[/code]edit had typo Quote Link to comment Share on other sites More sharing options...
ivalea Posted October 2, 2006 Author Share Posted October 2, 2006 Thanks much Keith - that seemed to do the trick! - Irene :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.