Every now and then, we receive an order processed through PayPal Express and the shipping address is missing. We've conversed with Paypal and they sent me an interesting reply which I've pasted into this posting. I've attempted a fix based on the technicians comments and I was wondering what you thought of my "fix". Here is some background, and the email from the tech is below. Thanks for your guidance. ps. I could not find a posting from anyone else about this problem (with my version of ZC).
Version: 1.3.9h (upgraded a few weeks ago).
Site has been customized a lot, however, I've never modified the payment modules (until now). I try to only modify using the template system (no core files) whenever possible.
Problem seemed to have started a couple weeks after the upgrade. Only happens less than 5% of the time.
Here is the email from the PayPal Tech:
===========================
"After reviewing the logs within your PayPal account I was able to notice the variable (NOSHIPPING) was not provided in the order which makes a shipping address optional. Due to using Zen cart this should be a setting that is easily configured within the module. If possible please reach out to your website developer to make this change and all future payments will allow you to view the shipping address.
If you have any further questions, please feel free to respond to this ticket. To do so, please follow the response directions located near the start of this message.
Thank you,
Matt
Merchant Technical Support
Merchant L1 Specialist"
============================
So, I decided to look for a 'variable' of NOSHIPPING and I found some code in includes/modules/payment/paypalwpp.php . I added this one line at line 1462 (where commented).
if ($_SESSION['cart']->get_content_type() == 'virtual' && isset($_SESSION['customer_id']) && $_SESSION['customer_id'] > 0) {
$this->zcLog('ec-step1-addr_check', "cart contents is virtual and customer is logged in ... therefore options['NOSHIPPING']=1");
$options['NOSHIPPING'] = 1;
} else {
//MStein - 05/28/2011 - added Noshipping=0 because paypal was not sending us shipping address sometimes
$options['NOSHIPPING'] = 0;
$this->zcLog('ec-step1-addr_check'
================================
I tested 2 transactions in production mode. One with paypal express and the other with regular paypal wpp. Both worked OK. I've checked my paypal logs and sure enough, the NOSHIPPING option is found in the log like this:
[NOSHIPPING] => 0
It seems having this line in there prevents Paypal from 'optionally' leaving out the shipping address.
Does this sound like a good course of action? Thanks again.


Reply With Quote
