Tips and Tricks HQ Support Portal › Forums › Simple PayPal Shopping Cart › Simple Shopping Cart Tweaks › Automatically require users to be logged in? › Reply To: Automatically require users to be logged in?
I’m sorry, I really have almost no idea how to do this. Everywhere I try and add code it is telling me I’ve made a fatal error and it deactivates the plugin on me. Would it be too much trouble if you could add it to my code? I’m fairly certain this is the if block, correct? It’s not that big of a deal, it’s just a personal pet peeve I would have with orders from unregistered users. Thank you very much so if you can!
if ($_POST)
{
$count = 1;
$products = $_SESSION;
if (is_array($products))
{
foreach ($products as $key => $item)
{
if ($item == $_POST)
{
$count += $item;
$item++;
unset($products[$key]);
array_push($products, $item);
}
}
}
else
{
$products = array();
}
if ($count == 1)
{
if (!empty($_POST[$_POST]))
$price = $_POST[$_POST];
else
$price = $_POST;
$product = array(‘name’ => stripslashes($_POST), ‘price’ => $price, ‘quantity’ => $count, ‘shipping’ => $_POST, ‘cartLink’ => $_POST, ‘item_number’ => $_POST);
array_push($products, $product);
}
sort($products);
$_SESSION = $products;
$checkout_url = “http://www.mydomain.com/checkout”;
$redirection_parameter = ‘Location: ‘.$checkout_url;
header($redirection_parameter);
exit;
}