Order does not seem to be recognized as COWOA when using PayPal Express Checkout
I'm using COWOA exclusively. No accounts at all. My payment modules are PayPal Webite Payments Pro and PayPal Express Checkout. When an order is placed using a credit card, the order confirmation email does NOT show the "Order Details" link, which is exactly correct and I think the COWOA module actually hides this, since there is no account info to go back to.
BUT if a customer pays with PayPal Express Checkout, the order confirmation email DOES HAVE the Order Details link in it.
I've searched everything I can think of in developer's tool kit and I'm not finding anything that is of any help. I do know that admin/orders.php was modified by COWOA and it looks like it actually put in an IF that doesn't display the details if the order is COWOA.
Code:
if(!$check_status->fields['COWOA_order']) {
$message .= EMAIL_TEXT_INVOICE_URL . ' ' . zen_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n\n";
}
Based on some other stuff I'm seeing, I think that maybe if a customer pays with PayPal Express Checkout, that the COWOA "switch" isn't getting set?
Anyone have any experience with this? Any ideas?
Re: Order does not seem to be recognized as COWOA when using PayPal Express Checkout
Since you are using COWOA exclusively, you will never want that link to be output, right?
Try commenting out the $message line and see what that does.
Re: Order does not seem to be recognized as COWOA when using PayPal Express Checkout
I identified that I can comment out this line
Code:
<a href="$INTRO_URL_VALUE">$INTRO_URL_TEXT</a>
in email/email_template_checkout.html, but I think that will only take care of html emails, right? Not text emails?
The thing is, that's not the only problem: the order confirmation screen has all the stuff in it about a temp acct being set up, and a logoff button, which does NOT show when using credit card payment and COWOA.
So I was looking for a more 'elegant' solution than just commenting everything out. And I'd also like to actually understand what's going on.
I do think that for some reason, that COWOA switch is not being thrown when you pay with PayPal Express Checkout. It all works beautifully when payment is through PayPal Website Payments Pro.
Re: Order does not seem to be recognized as COWOA when using PayPal Express Checkout
OK. I figured this out. Here's my solution:
The problem was that the session variable $_SESSION['COWOA'] was not getting set to 'true'. This is usually done in includes/modules/custom/no_account.php. But when doing PayPal Express checkout, you're going right from the shopping cart to PayPal ... you never visit the no_account.php page.
My solution was to define the session variable in the shopping cart page: includes/templates/custom/templates/tpl_shopping_cart_default.php
I added this :
Code:
<?php $_SESSION['COWOA'] = true; ?>
just after this block of code:
Code:
<?php
if ($flagHasCartContents) {
?>
It is IMPORTANT TO NOTE that this works for me because I am ALWAYS having the customer do COWOA. If you had a situation where you were allowing both accounts and COWOA, you'd need some logic somewhere to determine if the customer was logged in before he/she hit the PayPal Express Checkout button. If they were logged in, you would not want to set $_SESSION['COWOA'] to true. When the customer clicks on the PayPal Express Checkout button, it goes here: https://www.meatormotion.com/mmstore...er.php?type=ec
so you could probably throw some logic in that file BUT IT IS A CORE FILE so I would try to find some other way. I did not pursue this any further since what I have works for me.
Cheers.
Re: Order does not seem to be recognized as COWOA when using PayPal Express Checkout
Good work identifying the switch and where to set it. It shouldn't be too hard for someone who needs the alternate functionality to add the logic for it.