
Originally Posted by
4jDesigns
1.) I have 'forced logoff' set to true so that I am not left with any 'logged in / logged off' issues. I have 'order status' set to true so the customer and receive the link in their order confirmation email and so they do, which all of this works great and fine. But my concern I have is that when the customer is directed to their order_status page and then go to 'Login' link they are directed to 'My Account' page i.e. 'logged in / logged off' issue. I understand that an account has actually been created regardless to keep the order details, but is there a way that the customer could be directed to normal login page so that they are not under the impression they do have an actual account?
Ok so I have come up with a possible solution for my own question
In my 'includes/modules/pages/login/header_php.php find the lines:
Code:
// if the customer is logged in already, redirect them to the My account page
if (isset($_SESSION['customer_id']) and $_SESSION['customer_id'] != '') {
zen_redirect(zen_href_link(FILENAME_ACCOUNT, '', 'SSL'));
}
And change it to:
Code:
// if the customer is logged in already, redirect them to the My account page
if ((isset($_SESSION['customer_id']) and $_SESSION['customer_id'] != '') && ($check_customer->fields['COWOA_account'] == '0')) {
zen_redirect(zen_href_link(FILENAME_ACCOUNT, '', 'SSL'));
}
This now fixes my issue with COWOA customers being directed to 'My Account' page when clicking link 'Login'.
-----------------------------------------
As well, and I'm not sure if it is the wrong or right thing to do, but If a guest had added a product to a cart, then uses the 'order status' link in a previous email at the same time, they get to see the order status as well as 'items in their basket' (as per their current session), but if they continue to checkout via COWOA, they skip 'Billing' and go straight to 'Shipping' without having to add their details, which obviously screws up the process.
From what I understand, its because the cart thinks they are 'logged in' but not really as they don't have an actual account, so what I have done until a better solution comes along is this:
In 'includes/modules/pages/order_status/header_php.php' find this line:
Code:
$zco_notifier->notify('NOTIFY_HEADER_START_ORDER_STATUS');
Then underneath it place this:
Code:
if (($check_customer->fields['COWOA_account'] == '1') && ($_SESSION['cart']->count_contents() > 0)) {
unset ($_SESSION['cart']);
}
This will basically clear the cart of items if the user was using COWOA checkout and has items added in cart from a previous session. From what I believe this should only happen if the user as a guest has items in the basket and uses the 'order status' link in a previous order confirmation from a COWOA checkout.
Note: these are only my solution, so they may be wrong or right and any feedback regarding would be greatly appreciated.
Thanks,
Jay
Bookmarks