I have two different products that I need to send customers to two different checkout_success pages. Is there a way for me to build an intermediary page (before "define_checkout_success") that will check the product_id and do one of two things depending on the result?
example:
I have two products:
1 is a digital magazine (digital meaning online version) that requires a username and password.
1 is a print magazine that requires nothing (we simply ship the magazine to them).
If the customer purchases the digital version, they should go to define_checkout_success_digital.php which I have already created. That page sends their username and password to our third party fulfillment company and returns a login page for the customer to login.
If it's a print product they should redirect to define_checkout_success_print. In which case I simply have some text that displays shipping times and what not.
If they purchase both they should still go to define_checkout_success_digital.
I'm sooo stuck.
Any ideas would be greatly appreciated.
Matt
btw - here is the code I tried. it's obviously not working:
PHP Code:<?PHP
error_reporting(E_ALL);
// ini_set('display_errors','On');
require 'db.inc.php';
$db = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD) or
die ('Unable to connect. Check your connection parameters.');
// Retrieve all the data from the "zen_cart.pm_customers" table
$result = mysql_query("SELECT * FROM zen_cart.pm_customers WHERE customers_id=" . $_SESSION['customer_id']) or
die(mysql_error());
// store the record of the "zen_cart.pm_customers" table into $row
$row = mysql_fetch_array($result);
$result = mysql_query("SELECT * FROM zen_cart.pm_products WHERE products_id=" . $row['products_id']) or
die(mysql_error());
if ($row['products_id'] == "4")
{
//go to define_checkout_success_digital
header ("location: "/digital/includes/languages/english/html_includes/classic/define_checkout_success_digital.php"");
}
else
{
//else go to define_checkout_success_print
header ("location: "/digital/includes/languages/english/html_includes/classic/define_checkout_success_print.php"");
}
?>



