Jump to content

Email Order Confirmation


HanneSThEGreaT

Recommended Posts

I tried this as well :

 

if (isset($_POST['ordered'])) {
// We can assign $_POST['product'] to a variable to make it easier to type out
$prod = $_POST['product'];
// Throw a little intro to see how many they checked
echo 'You selected ' , count($_POST['ordered']) , ' products.';
// Now we loop through it and get the IDS that were selected
// Foreach lets you select the $key and the $value for each iteration of the loop //
foreach ($_POST['ordered'] as $key=>$id) {
	echo '<p/>
	ProdName: ' , $prod[$id]['name'] , '<br/>
	ProdPrice: ' , $prod[$id]['price'] , '<br/>
	ProdQty: ' , $prod[$id]['qty'] , '
	<hr/>';


	$TOT += $prod[$id]['price'] * $prod[$id]['qty'];


}

	$TOT2 = $TOT + 55;

	$data=serialize($_POST['ordered']); 
		$encoded=htmlentities($data);
		echo '<input type="hidden" name="order" value="'.$encoded.'">';

	echo	'<input type="hidden" value ="'. $TOT .'">';
	echo	'<input type="hidden" value =". $TOT2 .'">';
}


?>

Link to comment
Share on other sites

Aha! This seems to work on order.php :

 

      echo '<input type="hidden" name="'.$prod[$id]['name'].'" value="'.$prod[$id]['name'].'">';

      echo '<input type="hidden" name="'.$prod[$id]['price'].'" value="'.$prod[$id]['price'].'">';
      
      echo '<input type="hidden" name="'.$prod[$id]['qty'].'" value="'.$prod[$id]['qty'].'">';

 

Now on orderform.php, should I just loop through this array again? let me try that...

Link to comment
Share on other sites

I tried this now ( a bit more optimised ) :

 

		$strOrder .= "<p/>ProdName: " . $prod[$id]['name'] . "<br/>ProdPrice: " . $prod[$id]['price'] . "<br/>ProdQty: " . $prod[$id]['qty'] . "<hr/>";

//     echo '<input type="hidden" name="'.$prod[$id]['name'].'" value="'.$prod[$id]['name'].'">';

//     echo '<input type="hidden" name="'.$prod[$id]['price'].'" value="'.$prod[$id]['price'].'">';
      
//      echo '<input type="hidden" name="'.$prod[$id]['qty'].'" value="'.$prod[$id]['qty'].'">';

	$TOT += $prod[$id]['price'] * $prod[$id]['qty'];


}

	$TOT2 = $TOT + 55;

	echo	'<input type="hidden" Name="TOT" value ="'. $TOT .'">';
	echo	'<input type="hidden" name="TOT2" value =". $TOT2 .'">';

	echo 	'<input type="hidden" name="Order" value=". $strOrder . '">';

 

and on orderform.php I included the same logic as was in the email. But now my order.php doesn't show anything!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.