Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adding form to checkout_success.php


ivalea

Recommended Posts

Posted

Hi all - I am trying to modify checkout_success.php to have customer update their contact info based upon which product they purchased. I will be using the model number to specify this.

I've already modified the query on line 44 to this:

 

$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']);
}

 

So right underneath where the customer would check the box if they want product updates on the product they purchased I need an if statement that would basically say...

if the model number of the product they purchased = m1, m2, m3 or m4 then show form.php

else show nothing.

 

form.php would be a form that they would fill out of basic contact info to sign up for something. This info would then be sent to a new table in the db and be used to create a pdf later on.

 

My problem is that I am having trouble writing the if statement. Basically, how would it be written? Any help would be greatly appreciated. Thanks!

Posted

Okay so now I have this on line 44:

$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']);
}
 }

 

and have added this on line 97:

 echo '<p>';
 if ($products_array['model'] == 'm1'){
  echo 'This is a test.</p>';
}else{
echo '</p>';
}

 

Nothing is showing up on the checkout_success.php even if correct model number was purchased. Any thoughts?

Archived

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

×
×
  • Create New...