-
PP Express shipping question
I had a situation pop up yesterday and I am not sure how to prevent it in the future. The scenario happened like this:
1. Customer clicks on regular checkout button and fills out each form in checkout process. In the shipping option, they enter an alternate address from billing.
2. Customer continues to PayPal where they enter credit card info. In the order review, PayPal has changed the shipping address back to the billing address. The customer did not understand they had to edit the shipping address again and the order goes through without the drop shipping address.
3. When I viewed the order in Zen-cart, the order details showed the same address for billing and shipping, and I would have had no idea they wanted the item shipped elsewhere.
It would seem the shipping information about the order is not being sent to PayPal, requiring the customer to enter information twice. So either I need to eliminate the regular checkout process and have my customers go directly to PayPal or ?
BTW, I have all the latest updates and patches.
-
Re: PP Express shipping question
I am wondering if the problem lies with the automatic account creation option? I currently have that turned on. Perhaps this option is over-riding the order details in Zen-Cart when it imports a new account. I may turn it off and see what happens.... Although it is a nice feature otherwise.
-
Re: PP Express shipping question
Hi tinypack.
Did you ever find an answer to this as I think the same thing has happend to me. How did you find out the shipping address?
My store is located in New Zealand. A customer from the UK placed an order and used PayPal Express checkout through the regular checkout process. The order in Zen Admin lists shipping and billing address as the same address (in the UK) but the customer was only charged for shipping within New Zealand. I know my shipping zones are setup correctly as I have tried checking out with a test account configured for the UK and I get the correct shipping options/prices on Step 1 of checkout process but did not complete the entire transaction.
So basically what I am saying is that either I have the same problem as you or there is some other problem with PayPal Express shipping options.
I need to figure this out quickly as there is a rather big difference in shipping costs between sending something locally and sending to the UK... bye bye profits :censored:
-
Re: PP Express shipping question
I only happened to discover the error because I talked to the customer. I haven't been able to work out the problem other than posting instructions on the checkout pages. Customers really should not have to enter the information twice, but that is how things currently work. I haven't found a setting in my paypal profile or payment module that will allow for drop shipping. My current paypal module settings are:
Enable this Payment Module
True
Sort order of display.
1
Payment Zone
--none--
Set Order Status
Processing [2]
Set Unpaid Order Status
Pending [1]
Set Refund Order Status
Pending [1]
Express Checkout: Require Confirmed Address
No
Express Checkout: Select Cheapest Shipping Automatically
No
Express Checkout: Skip Payment Page
Yes
Express Checkout: Automatic Account Creation
Yes
Payment Action
Auth Only
Transaction Currency
Only USD
-
Re: PP Express shipping question
Thanks for getting back to me tinypack.
Yes I agree it is very annoying to expect a customer to enter their shipping address twice and most won't do it (which creates more work for us - if we can even figure out that they changed their shipping address :unsure:).
I took a look at the PP Express Zencart modules code and Paypal's integration documentation (https://www.paypal.com/en_US/pdf/PP_...ationGuide.pdf - see the note at the top of page 36) and it looks like it is supposed to work when over-wridden but I am struggling to follow the flow of code in the payment module. I will take another look tomorrow when I am fresh and see if I can see why it isn't working the way it should.
Regards.
Duwane
-
Re: PP Express shipping question
Could someone with a fresh install of ZenCart 1.3.7.1 (with the latest PayPal patches from DrByte installed) please test and confirm if the address over-ride is working with PayPal Express checkout? I do not have enough web space left to upload onother copy of ZenCart for testing.
I have done test transactions with my website and it seems like if a user goes through the the standard checkout process and changes the shipping address in step 1 of checkout that the customers address from their PayPal account is being sent back as the shipping address. here is no record in ZenCart that the shipping address is different from the billing address. Taxes as also not calculated correctly, but the shipping costs seem to be correct. In other words it seems like the override I mentioned in the post above is not working and this is confusing ZenCart.
I am still looking over the code but cannot find any problems as yet....:frusty:
-
Re: PP Express shipping question
I too am seeing the same problem. First a disclaimer - I'm fairly new to all this. From my digging though, it seems that
* Registration in zencart goes to the address_book database
* paypal response comes back with the paypal address as a shipping address:
Request Parameters: {DoExpressCheckoutPayment} Array (
[ITEMAMT] => 8.50
[SHIPPINGAMT] => 1.00
[AMT] => 9.50
[L_NUMBER0] =>
[L_QTY0] => 1
[L_NAME0] => Ticket - Oct.20 11am Matinee
[L_AMT0] => 8.50
[L_TAXAMT0] => 0.00
[SHIPTONAME] => Test User
[SHIPTOSTREET] => Paypal billing
* paypal response goes to the 'orders' shipping_address database
* zen reports (email verifications, account activity reports, shipping labels, etc.) use the 'orders' database
To me, it would seem that paypal would be concerned with billing, while zen is concerned with shipping, but I'm inexperienced here and I'm only concerning myself with paypal express and I'm not offering any other payment options.
I'm thinking of digging into the code to figure out how to put that paypal response into the orders:billing_address instead of orders:shipping_address, or I might just put lots of comments onto the check-out pages (not ideal).
If anyone can tell me where I'm confused, or if this is a valid bug that can/will be patched, I'd be very grateful.
Thanks,
Carl
-
Re: PP Express shipping question
Should have mentioned that I'm at Zencart 1.3.7, I've installed the June 17 paypal patch and reinstalled the module. I'm running a new database as a practice before going live, and I'm in sandbox mode with the paypal developer sandbox.
-
Re: PP Express shipping question
Thanks carlvt88.
It seems that this may be a bug somewhere. A customer won't put their address in twice. Some will but they shouldn't be expected to (IMHO). PayPal says (according to their documentation) that you can override the customers PayPal address so it should work.
It might have something to do with our setups which is why I wanted someone with a fresh test install to check this. Preferably someone that knows the PayPal code well (DrByte :cool: pleeeeeze). It may only show up depending on some factors so if we can eliminate any bugs in a clean install then at least we know it is not out setup...
I will continue checking the code but as I said before I can't find anything yet.
-
Re: PP Express shipping question
I also forgot to add in support of what we are saying, that most shop owners would not notice this problem unless a customer complained that their goods were shipped to the wrong address. The only reason I noticed this was that my customer happend to be from another country and I could see that the shipping cost did not match what it should have been.
-
Re: PP Express shipping question
OK. I have done loads more testing in live mode (my poor credit card :blink:) as Sandbox environment kept coming up with errors and timing out. This is what I have found:
If I check out with a shipping address that is different from my PayPal account address, the address from my PayPal account is written to the database with the order details as the shipping address. This part I knew already. The interesting part is that once the transaction is complete there is a new entry in my address list with the PayPal account details.
This means that ZenCart is allowing the PayPal address sent back to override what the user sets as the shipping address during checkout. This does not seem right. The other interesting thing I noticed is that if you already have 5 entries in your address book, using PayPal Express as the payment method allows you to go over the 5 address limit :huh: I ended up with about 8 entries in my address book when in Zen Admin I have it set to only allow 5 max.
Now I will start looking at how to get ZenCart to ignore the address that PayPal sends back and write the address that the user has specified to the database as the shipping address.
-
Re: PP Express shipping question
Quote:
Originally Posted by
duwane
Now I will start looking at how to get ZenCart to ignore the address that PayPal sends back and write the address that the user has specified to the database as the shipping address.
So ... you mean ... when someone (esp not-yet-logged-in) starts Express Checkout, goes to PayPal, and *selects (or enters a new) shipping address*, you want Zen Cart to ignore that and just use whatever address is their primary ZC address ?
I haven't had a chance to test out all of what you're explaining to see where there's a discrepancy.
However, it should be using the Zen Cart address *only* if the customer specifically *changes* their address on the payment page *after* returning from PayPal.
-
Re: PP Express shipping question
Quote:
Originally Posted by
DrByte
So ... you mean ... when someone (esp not-yet-logged-in) starts Express Checkout, goes to PayPal, and *selects (or enters a new) shipping address*, you want Zen Cart to ignore that and just use whatever address is their primary ZC address ?
I haven't had a chance to test out all of what you're explaining to see where there's a discrepancy.
However, it should be using the Zen Cart address *only* if the customer specifically *changes* their address on the payment page *after* returning from PayPal.
Thanks for replying DrByte. I agree with you that you can't ignore the address if the user does not have a ZenCart account.
However the problem I am seeing is when the user does have a ZenCart account and goes through the 3 step checkout process. On step one they change the shipping address to something other than their default, select the shipping method and continue. On step 2 they select PayPal Express as the payment option. They go through step 3 and when they come back from PayPal they go straight to checkout success so there is no other chance for them to change the shipping address again and the address entered into the DB against the order is the address PayPal sends back (PayPal account address unless they change it again on the PayPal payment page).
The angle I was working on as a solution was if the user already has a shipping address specified i.e. if(isset($_SESSION['sendto'] then don't let the PayPal address sent back override it. That way if it is a user that does not have an account i.e. !$_SESSION['sendto'] it will still accept the PayPal details as the shipping address for the order.
Will this work or is this what is already supposed to be happening? I am just trying to find a way around this that won't break everything :smile: and avoiding extra instructions for the customer.
-
Re: PP Express shipping question
I received an order today with a different shipping address from billing and the order appeared correctly in Zen-Cart. The customer must have noticed that the ship to address had to be changed in PayPal too.
With my testing, the problem appears when a customer fills out the billing/payment info in PayPal, PayPal automatically fills in the shipping address with the billing address instead of receiving the correct ship to address from zen-cart. I think PayPal prefers to have the billing/ship to address the same. I know this reduces potential fraud, but many of my customers send my items as gifts and this difficulty could cause customer service problems. It also creates double entry work for the customer and it could easily be missed if they aren't paying attention.
I wish I could dive into the code to work this out, but unfortunately my coding skills are pretty messy.
-
Re: PP Express shipping question
Quote:
Originally Posted by
tinypack
I received an order today with a different shipping address from billing and the order appeared correctly in Zen-Cart. The customer must have noticed that the ship to address had to be changed in PayPal too.
The problem is that when a customer fills out the billing/payment info in PayPal, PayPal automatically fills in the shipping address with the billing address instead of receiving the correct ship to address from zen-cart. I think PayPal prefers to have the billing/ship to address the same. I know this reduces potential fraud, but many of my customers send my items as gifts and this difficulty could cause customer service problems. It also creates double entry work for the customer and it could easily be missed if they aren't paying attention.
I wish I could dive into the code to work this out, but unfortunately my coding skills are pretty messy.
There is a bit more to it though as the shipping calculation is also incorrect and is very noticeable when the customer is in another country :blink: The taxes are also calculated incorrectly (when the customer is from another country and shipping the order to the store's home country).
All this aside though it makes it really hard to know where the customer actually wants the order shipped to :smile:
-
Re: PP Express shipping question
I have made some progress and thought I would share it so you can add your opinions or advice.
If I change the code at round line 1917 of my includes/modules/payment/paypalwpp.php file from:
Code:
$_SESSION['sendto'] = $_SESSION['customer_default_address_id'];
// This is the address matching section
// try to match it first
// note: this is by no means 100%
$address_book_id = $this->findMatchingAddressBookEntry($_SESSION['customer_id'], $order->delivery);
// no match, so add the record
if (!$address_book_id) {
$address_book_id = $this->addAddressBookEntry($_SESSION['customer_id'], $order->delivery, false);
}
// set the address for use
$_SESSION['sendto'] = $address_book_id;
to this:
Code:
if(!isset($_SESSION['sendto']) || $_SESSION['sendto'] == ''){
$_SESSION['sendto'] = $_SESSION['customer_default_address_id'];
// This is the address matching section
// try to match it first
// note: this is by no means 100%
$address_book_id = $this->findMatchingAddressBookEntry($_SESSION['customer_id'], $order->delivery);
// no match, so add the record
if (!$address_book_id) {
$address_book_id = $this->addAddressBookEntry($_SESSION['customer_id'], $order->delivery, false);
}
// set the address for use
$_SESSION['sendto'] = $address_book_id;
}
then the address is added to the order correctly in the scenario we are having trouble with. I just added the first IF statement. The only problem that doing this creates (that I have found so far) is that if the customer changes their address on the PayPal screen it does not get added to the order.
What this means is that as long as the customer chooses the same shipping address during checkout as they do on the PayPal screens (if they change it) then we have a workaround :cool:
If someone could take a look and see what other implications this may have I would appreciate it. Also if there is a way to change my IF statement to allow the code to execute when the address is changed on the PayPal screens then this would work perfectly.
Any ideas?
-
Re: PP Express shipping question
I think I finally may have found a viable solution but I need some help getting the data into the PayPal tables properly. This solution is independent of the one I posted earlier and seems much cleaner and less risky.
In my travels around the PayPal developer’s handbooks I found a new API function which I had not seen before. This function is "NOSHIPPING". When I came across it I new it was the answer:lookaroun. Basically this API call removes the customer’s option to change their shipping address on the PayPal screen. The code I wrote only runs if their selected shipping address is not the same as their default one and their account is not a temporary one.
Find this code:
Code:
/**
* Ask PayPal for the token with which to initiate communications
*/
$response = $doPayPal->SetExpressCheckout(number_format($order_amount, 2), $return_url, $cancel_url, $options);
(line 1668 or so of my includes/modules/payment/paypalwpp.php)
Just ABOVE it add:
Code:
if(isset($_SESSION['sendto']) && isset($_SESSION['customer_default_address_id'])
&& $_SESSION['sendto'] != $_SESSION['customer_default_address_id'] && isset($_SESSION['customer_id'])){
//This user has selected a shipping address other than their default address book entry
$sql = "SELECT customers_paypal_ec
FROM " . TABLE_CUSTOMERS . "
WHERE customers_id = '".$_SESSION['customer_id']."' ";
$check_customer = $db->Execute($sql);
if (!$check_customer->EOF) {
if ($check_customer->fields['customers_paypal_ec'] != '1') {
//this is not a temporary account so hide the shipping detail on the PayPal screen
$options['NOSHIPPING'] = 1;
}
}
}
This seems to work really well as far as I can see except that in our scenario (customer choosing different shipping address) it does not enter all address details correctly into the PayPal table as there is no address response from PayPal. The shipping address is entered into the Zen orders tables correctly and shows the correct shipping address.
DrByte I would appreciate if you could take a look at the code above and let me know if it is a viable workaround/patch as there seems to be many threads dealing with the same issue as we are here. Most of the other threads don't have any real answers and some contain custom hacks that don't look too sound to me.
-
Re: PP Express shipping question
The NOSHIPPING option already does get set if the cart-contents are all virtual (ie: downloads, and not requiring shipping).
So, yes, it's possible to blindly disable all shipping address options from the PayPal interface; however there are some caveats to that ...
Consider the case where you have a new customer ... they don't have an account on your site, but they do have a PP account. If they select an address from their PP address book, then that'll automatically be set up in their Zen Cart account, meaning they won't have to create all their address details. If you disable the PP address book, then Zen Cart will not get those details ... and indeed may end up with unpredictable results due to blank data.
For existing customers, it wouldn't be as much of an issue ... but ... due to the nature of "Express", you don't know if the customer has an account or not until after they've logged into PayPal and provided an email address for lookup. And at that point they're already in PayPal, so you can't disable their address book options in PP. :lookaroun
-
Re: PP Express shipping question
Quote:
Originally Posted by
DrByte
Consider the case where you have a new customer ... they don't have an account on your site, but they do have a PP account. If they select an address from their PP address book, then that'll automatically be set up in their Zen Cart account, meaning they won't have to create all their address details. If you disable the PP address book, then Zen Cart will not get those details ... and indeed may end up with unpredictable results due to blank data.
Quote:
Originally Posted by
DrByte
you don't know if the customer has an account or not until after they've logged into PayPal and provided an email address for lookup. And at that point they're already in PayPal, so you can't disable their address book options in PP.
Thanks DrByte. I thought of that while writing this code and was under the impression that the code I wrote would not fire if the customer did not have an account (no $_SESSION['customer_id']) in their session and they also wouldn't have a $_SESSION['sendto'] or $_SESSION['customer_default_address_id']. Also I am doing a check to see if the account was created by the EC checkout process ($check_customer->fields['customers_paypal_ec'] != '1').
Any further thoughts? I am now trying to figure out where in the code the PayPal return data is written to the PayPal table but it got a bit late last night and mind fuzz set in :smile:
-
Re: PP Express shipping question
Mind fuzz ... yes, I know what you mean.
Admittedly, I didn't check your code closely enough to see your check for customer id being set in the session. Will have to review again when *my* mind is clear.
Quote:
I am now trying to figure out where in the code the PayPal return data is written to the PayPal table
*which* data are you referring to? There are a few places where data gets written. Best to search for TABLE_PAYPAL if it's the paypal table you're specifically looking for.
-
Re: PP Express shipping question
I think it is the PayPal DB table I am looking for as the address details don't show up in the left hand column of the PayPal grey table on the Admin order edit screen (Under the code comment that says: <!-- BOF: pp admin transaction processing tools --> in the Zen admin edit screens HTML source code). The shipping address up the top (ZenCart one) is correct and the address details get entered correctly into the orders table.
Also the address status is entered into the PayPal table as "None" which is why I am guessing that I need to change something before it gets written there by replacing the empty response from PayPal with the ZenCart shipping address before it gets written so the address details will be displayed correctly on the order edit screen in admin.
Phew, does that make any sense :wacko:
-
Re: PP Express shipping question
The actual final address details that are stored in the order come from the address book entries in Zen Cart. The paypal table doesn't store full address info. In fact, it only stores meta-data about the transaction, and is largely used only as a reference to understand IPN history about the transaction.
The "correct" address needs to not only exist in Zen Cart, but also be tied to the order ... before the order is completed ... ie: before the confirmation page.
-
Re: PP Express shipping question
Quote:
Originally Posted by
DrByte
The actual final address details that are stored in the order come from the address book entries in Zen Cart. The paypal table doesn't store full address info. In fact, it only stores meta-data about the transaction, and is largely used only as a reference to understand IPN history about the transaction.
The "correct" address needs to not only exist in Zen Cart, but also be tied to the order ... before the order is completed ... ie: before the confirmation page.
So if I understand you correctly, in this scenario we are talking about here, there is no real reason for me to worry about the address details not being entered into the PayPal table (seeing as it is only as a reference)? Is it not used anywhere else other than being displayed on the zenAdmin order edit screen? All the other details are still entered into the PayPal table and display correctly except for the address.
As I said before the ZenCart order itself looks 100% correct as far as billing, shipping and customer addresses so if we don't need the PayPal address for anything else then this may be a good workaround :unsure:
-
Re: PP Express shipping question
Quote:
Originally Posted by
duwane
So if I understand you correctly, in this scenario we are talking about here, there is no real reason for me to worry about the address details not being entered into the PayPal table (seeing as it is only as a reference)? Is it not used anywhere else other than being displayed on the zenAdmin order edit screen?
Correct .
-
Re: PP Express shipping question
WooHoo! :clap:
Thanks for all your help DrByte.
I will do a bit more testing to make sure all totals, etc are correct and feed back here if I find any problems.
-
Re: PP Express shipping question
Quote:
Originally Posted by
duwane
I think I finally may have found a viable solution but I need some help getting the data into the PayPal tables properly. This solution is independent of the one I posted earlier and seems much cleaner and less risky.
In my travels around the PayPal developer’s handbooks I found a new API function which I had not seen before. This function is "NOSHIPPING". When I came across it I new it was the answer:lookaroun. Basically this API call removes the customer’s option to change their shipping address on the PayPal screen. The code I wrote only runs if their selected shipping address is not the same as their default one and their account is not a temporary one.
Find this code:
Code:
/**
* Ask PayPal for the token with which to initiate communications
*/
$response = $doPayPal->SetExpressCheckout(number_format($order_amount, 2), $return_url, $cancel_url, $options);
(line 1668 or so of my includes/modules/payment/paypalwpp.php)
Just ABOVE it add:
Code:
if(isset($_SESSION['sendto']) && isset($_SESSION['customer_default_address_id'])
&& $_SESSION['sendto'] != $_SESSION['customer_default_address_id'] && isset($_SESSION['customer_id'])){
//This user has selected a shipping address other than their default address book entry
$sql = "SELECT customers_paypal_ec
FROM " . TABLE_CUSTOMERS . "
WHERE customers_id = '".$_SESSION['customer_id']."' ";
$check_customer = $db->Execute($sql);
if (!$check_customer->EOF) {
if ($check_customer->fields['customers_paypal_ec'] != '1') {
//this is not a temporary account so hide the shipping detail on the PayPal screen
$options['NOSHIPPING'] = 1;
}
}
}
This seems to work really well as far as I can see except that in our scenario (customer choosing different shipping address) it does not enter all address details correctly into the PayPal table as there is no address response from PayPal. The shipping address is entered into the Zen orders tables correctly and shows the correct shipping address.
DrByte I would appreciate if you could take a look at the code above and let me know if it is a viable workaround/patch as there seems to be many threads dealing with the same issue as we are here. Most of the other threads don't have any real answers and some contain custom hacks that don't look too sound to me.
I am having the same problem with paypal changing the shipping address on orders, I tried the solotion above and it made no difference, have there been any furthur developments with this issue?
Thanks
-
Re: PP Updating my shipping address
Hi everyone,
I have a similar problem and before I go through all the changes described here, I thought I would add one more piece of the problem. Not only does PayPal update my shipping addres, but I use paypal to print shipping labels (don't know of a better way). So it's important that I have the correct shipping address in both arenas. I don't want the customer to have to update it in both places, so is there a solution for this? Is there a module to avoid paypal shipping labels?
Thanks:(
-
Re: PP Express shipping question
For the moment I have replaced the regular zen-cart button with a 1x1 gif. I only offer PayPal express as a payment option. Customers now have no choice but to go through paypal to enter shipping information. Information is only entered and confirmed once. That has temporarily solved the problem and sped up the checkout process.
-
Re: PP Express shipping question
I think I like that solution as well. I use Paypal for my shipping labels and wouldn't want to have to double check to see if they entered the correct information. It would be better if the two systems talked to one another better, but hey, can't have everything!
V
-
Re: PP Express shipping question
Is there any solution for this problem yet. I've had quite a few customers not realising you have to change the address in Paypal and orders are going to the wrong address. I've tried everything in the thread, but had no joy.
If it can't be solved I'll have to revert back to the IPN module. :(
Many thanks
-
Re: PP Express shipping question
If your still having issues, you may want to look into 2checkout. I currently offer paypal express, 2checkout, and check/moneyorder. Only reason I added 2checkout is I have many customers that wont touch Paypal.
2checkout has recently added paypal as a payment option when checking out via 2checkout. In the two tests I have done the correct info is getting transmitted when using a different shipping/billing addresses. The seller only pays the 2checkout fees and not the paypal fees. In fact the seller doesn't even have to have a paypal account.
I would never had even known customers had that option if it weren't for me switching from a osc based cart to zen. It might be a solution to fix your problem.