You could write a function to validate the product and the customer to check if they have ordered before and if not then prevent checkout ...
If you look in the header_php.php of the checkout pages, you will see where the validation of the cart is done ... you can add in your validation there as well ...
The checkout_shipping for example:
/includes/modules/pages/checkout_shipping/header_php.php
shows the validation as:
Code:
// Validate Cart for checkout
$_SESSION['valid_to_checkout'] = true;
$_SESSION['cart']->get_products(true);
if ($_SESSION['valid_to_checkout'] == false) {
$messageStack->add('header', ERROR_CART_UPDATE, 'error');
zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
}
You can add your own validation beneath that to check if the customer has had a previous order and if the product is in the cart ... if not, set a message and return them to the cart to remove it or, you can remove it for them ...
You might also add a validation to the shopping_cart page on the product for when a customer is not logged in or not allowed to checkout with the product ... this could also be done on the product_info page as well ...
Easy smeazy, eh?