Here's an old code sample for 4.0/4.1 that might get you started:
In include/login.php, replace:
PHP Code:
if (!func_is_cart_empty($cart)) {
with:
PHP Code:
if ($login_type == "C") {
func_header_location($redirect_to."/pages.php?pageid=29");
} elseif (!func_is_cart_empty($cart)) {