Zen Cart Logo
Forums / All Other Contributions/Addons / PayPall Express - Shipping and Billings Address problems using WOZ addon

PayPall Express - Shipping and Billings Address problems using WOZ addon

Locked

Views: 2,894

Results 1 to 17 of 17
This thread is locked. New replies are disabled.
1 Jun 2010, 8:38 AM
#1
thomasjay avatar

thomasjay

New Zenner

Join Date:
Jul 2009
Posts:
14
Plugin Contributions:
0

PayPall Express - Shipping and Billings Address problems using WOZ addon

I have a problem with the billing and shipping address being different.

As you can see from this paypal screenshot the delivery address is clearly in Australia. Screen 1

When I go to the confirmation page (in zencart) the delivery address has become the billing address and the delivery address is some junk"United States" text. Screen 2

Going in the back end of zen cart you can see that there are 2 addresses stored for the customer. Screen 3

Where is this second address coming from?

How do I ensure the shipping address goes to the right fields?

Help Please.

1 Jun 2010, 9:34 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: PayPall Express - Shipping and Billings Address problems using WOZ addon

What version of Zen Cart?

3 Jun 2010, 12:23 AM
#3
thomasjay avatar

thomasjay

New Zenner

Join Date:
Jul 2009
Posts:
14
Plugin Contributions:
0

Re: PayPall Express - Shipping and Billings Address problems using WOZ addon

v1.3.9c

3 Jun 2010, 10:18 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: PayPall Express - Shipping and Billings Address problems using WOZ addon

If I do a fresh clean install of a new v1.3.9c site on my test server, what exactly do I need to do to recreate the problem you describe?

Thus far I've tried the following, which does not manifest the problem you describe:

  1. Fresh clean install with demo products and no addons or customizations.
  2. Enable Express Checkout and configure it.
  3. Add a product to my cart, such as the Die Hard DVD from the demo products.
  4. From shopping cart, click on the PayPal Express Checkout button.
  5. It takes me to PayPal's site, where I enter an Aussie address (I even used the one you included in your screenshots) and choose my funding source.
  6. It brings me back to my ZC site, and shows me the address I entered, as both billing and shipping address.
  7. I can carry on and complete checkout without incident.
3 Jun 2010, 11:35 AM
#5
thomasjay avatar

thomasjay

New Zenner

Join Date:
Jul 2009
Posts:
14
Plugin Contributions:
0

Re: PayPall Express - Shipping and Billings Address problems using WOZ addon

I am not sure what creates this problem.

I have played around with some of the templates but have no changed much else.

I have no idea where the second address comes from which is blank except for the United States country.

3 Jun 2010, 1:45 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: PayPall Express - Shipping and Billings Address problems using WOZ addon

I was really asking what exactly makes your site different from a brand new clean one? ie: what are all the settings you've changed? all the addons you've added? basically a list of step by step changes I'd need to make on my site to make it exactly like yours.

There was a fix made in 1.3.9 that stopped some cases where addresses would be given United States as a default. But I've never seen it show a blank address with just US as the country.

6 Jun 2010, 6:02 AM
#7
thomasjay avatar

thomasjay

New Zenner

Join Date:
Jul 2009
Posts:
14
Plugin Contributions:
0

Re: PayPall Express - Shipping and Billings Address problems using WOZ addon

I have installed the following add ons

Column Layout Grid

Wordpress for zen cart

I have also made some changes to the templates etc.

6 Jun 2010, 6:22 AM
#8
thomasjay avatar

thomasjay

New Zenner

Join Date:
Jul 2009
Posts:
14
Plugin Contributions:
0

Re: PayPall Express - Shipping and Billings Address problems using WOZ addon

Could it be that I am using express checkout without the shopper registering on the zen cart site?

Where is the data for the shipping address typically sourced.

It is strange that the paypal delivery address becomes the billing address and the delivery address becomes blank.

8 Jun 2010, 5:39 AM
#9
thomasjay avatar

thomasjay

New Zenner

Join Date:
Jul 2009
Posts:
14
Plugin Contributions:
0

Re: PayPall Express - Shipping and Billings Address problems using WOZ addon

Any idea where I should be looking at for this problem?

I really have no idea where to start trying to fix it.

15 Jun 2010, 6:21 PM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: PayPall Express - Shipping and Billings Address problems using WOZ addon

I'm still unable to figure out how to create your scenario on my clean install of v1.3.9c, or d.
Unless I can encounter the problem first-hand, I can't fix it for you.

19 Jun 2010, 1:59 AM
#11
thomasjay avatar

thomasjay

New Zenner

Join Date:
Jul 2009
Posts:
14
Plugin Contributions:
0

Re: PayPall Express - Shipping and Billings Address problems using WOZ addon

Are many painful hours of looking for the problem I finally found the culpurt

Wordpress addon for Zen Cart.

No idea why it would be breaking it by as soon as I uninstalled the woz it started working.

I do not need any advanced features of wordpress in by blog.

Is there a simple way to include the content of this page
http://weaselandfibb.com/blog/ with formatting within by index page?

27 Sep 2010, 3:11 AM
#12
pkfrizzlefry avatar

pkfrizzlefry

New Zenner

Join Date:
Mar 2005
Posts:
5
Plugin Contributions:
0

Re: PayPall Express - Shipping and Billings Address problems using WOZ addon

Yes having the same issue since i installed WOZ, it seemed like such a nice contribution till these errors

I was getting 10571 missing address1

After like 12 hours i finally figured out it was WOZ (since i installed multiple contribs)

The file thats causing this issue is init_woz.php

Add something like this to the top of it (so the WP() doesnt get executed on payment processing)

I replaced

if (defined('WOZ_CONFIG_STATUS') && WOZ_CONFIG_STATUS == 'true')

with

if (defined('WOZ_CONFIG_STATUS') && WOZ_CONFIG_STATUS == 'true' && $_GET['main_page']=='wordpress')

And it all jives now...wish i figured it out earlier!!

Good luck

Pete

4 Oct 2010, 4:01 AM
#13
shutterdrone avatar

shutterdrone

New Zenner

Join Date:
Oct 2010
Posts:
3
Plugin Contributions:
0

Re: PayPall Express - Shipping and Billings Address problems using WOZ addon

We had the same issue with our store, unfortunately we couldn't make the change noted, because having the wordpress side-bars are essential to our site layout (they provide documentation, news, videos, and such that are essential to informing our customers), and making that change breaks the sidebars.*

Notably, I had no choice but to rapidly fix it, as most (about 70%) of our paypal express orders were failing for this reason.

I can't really tell you why all of them don't fail, this is the part that has me completed confused.

(the following is related to paypalwpp.php)

Namely, the issue seems to be that when paypal returns the shipping address (and it always returns the shipping address, it seems), the variable $order is damaged in such a way that ec_step2() cannot populate the order info. This results in it finding that the override address does not match the order address (thinks it was changed at paypal), and since addAddressBookEntry() does not check if its a valid address, adds a blank address, and sets the sendto id to the blank address book entry.

Then, you know what happens when the final step goes back to paypal...

Here's what to look for in the logs to validate this:

Oct-04-2010 02:04:56 (1286157896)
ec_step2_finish - 1
START: paypal_ec_payer_info= Array
(
    [payer_id] => xxxxxxxx
    [payer_email] => useremail
    [payer_salutation] =>
    [payer_gender] =>
    [payer_firstname] => Joe
    [payer_lastname] => User
    [payer_business] =>
    [payer_status] => verified
    [ship_country_code] => US
    [ship_address_status] => Unconfirmed
    [ship_phone] =>
    [order_comment] =>
    [ship_name] => Joe User
    [ship_street_1] => 111 Fake Street
    [ship_street_2] =>
    [ship_city] => Houston
    [ship_state] => TX
    [ship_postal_code] => 77009
    [ship_country_name] => United States
)

=================================

Oct-04-2010 02:04:56 (1286157896)
ec_step2_finish - 2
country_id = 223 United States US
address_format_id = 2
state_id = 57 (original state tested: TX)
country1->fields['countries_id'] = 223
country2->fields['countries_id'] = 223
$order->customer =
=================================

Oct-04-2010 02:04:56 (1286157896)
S2 1:
1
=================================

Oct-04-2010 02:04:56 (1286157896)
addAddressBookEntry - 1
address to add:

=================================

Oct-04-2010 02:04:56 (1286157896)
addAddressBookEntry - 2
added address #186
SESSION[sendto] is now set to 186
=================================

Oct-04-2010 02:04:56 (1286157896)
S2 2:
186
=================================

Now, the odd part for me was that findMatchingAddressEntry() validates its input data, so won't search for a blank address, but addAddressBookEntry() does not! This means every time a user encounters this issue, they add a new blank address to their book.

So, I added the following line to paypalwpp.php, just inside the addAddressBookEntry() function:

    if ($address_question_arr['street_address'] == '') return false;

Additionally, I commented out the part that later tries to load the overridden address from the before_process() function:

/*
      if ($order->delivery['street_address'] != $_SESSION['paypal_ec_payer_info']['ship_street_1'] && $_SESSION['paypal_ec_payer_info']['ship_street_1'] != '') {

        $this->zcLog('compare addresses:', $order->delivery['street_address'] . ":" . $_SESSION['paypal_ec_payer_info']['ship_street_1']);

        $_GET['markflow'] = 2;
        if (($address_arr = $this->getOverrideAddress()) !== false) {
          $this->zcLog('Forcing Override',  print_r($address_arr, true));
          // set the override var
          $options['ADDROVERRIDE'] = 1;
          // set the address info
          $options['SHIPTONAME']    = $address_arr['entry_firstname'] . ' ' . $address_arr['entry_lastname'];
          $options['SHIPTOSTREET']  = $address_arr['entry_street_address'];
          if ($address_arr['entry_suburb'] != '') $options['SHIPTOSTREET2'] = $address_arr['entry_suburb'];
          $options['SHIPTOCITY']    = $address_arr['entry_city'];
          $options['SHIPTOZIP']     = $address_arr['entry_postcode'];
          $options['SHIPTOSTATE']   = $address_arr['zone_code'];
          $options['SHIPTOCOUNTRYCODE'] = $address_arr['countries_iso_code_2'];
        }
      }
*/

This means we'll never get in our cart the new address if a user changes it in paypal, but we just tell 'em to make sure they enter the right one in the shipping address.

We force logins to checkout, namely because each sell is fairly large, and we'll live with a slightly lower conversion rate, because ultimately drive-by's are just support nightmares for what we're selling.

I hope this helps someone else who needs to deal with WOZ and Paypal express!

** - of course, with this issue, we're going to have to hard-code the sidebars soon and only use WOZ when one of the pages is clicked on, I just needed to get everything working with minimal impact to the site until I can get some time to fix it all correctly.*

4 Oct 2010, 4:18 AM
#14
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: PayPall Express - Shipping and Billings Address problems using WOZ addon

shutterdrone:

Notably, I had no choice but to rapidly fix it, as most (about 70%) of our paypal express orders were failing for this reason.

I can't really tell you why all of them don't fail, this is the part that has me completed confused.Perhaps a comparison between the logs for the failing vs non-failing transactions might be useful?
Namely what is the value returned from PayPal for ADDRESSSTATUS ?
If it's returned as "NONE" then Zen Cart treats it as a blank address because it has no choice since no address info is supplied. It would be very useful if you confirm whether that's the case in the situations where it "fails".> shutterdrone:

(and it always returns the shipping address, it seems)Yes, that's how PayPal works.> shutterdrone:

the variable $order is damaged in such a way that ec_step2() cannot populate the order info.In addition to the comparison of the logs, I think it's crucial that you research that more.
The rest of your "fix" is merely a bandage to that issue.

4 Oct 2010, 4:18 PM
#15
shutterdrone avatar

shutterdrone

New Zenner

Join Date:
Oct 2010
Posts:
3
Plugin Contributions:
0

Re: PayPall Express - Shipping and Billings Address problems using WOZ addon

DrByte:

Perhaps a comparison between the logs for the failing vs non-failing transactions might be useful?
Namely what is the value returned from PayPal for ADDRESSSTATUS ?
If it's returned as "NONE" then Zen Cart treats it as a blank address because it has no choice since no address info is supplied. It would be very useful if you confirm whether that's the case in the situations where it "fails".

.In addition to the comparison of the logs, I think it's crucial that you research that more.
The rest of your "fix" is merely a bandage to that issue.

Oh, I absolutely understand that this is just a band-aid. I just ran out of time debugging, as we had just launched the site a few days earlier, and were getting hammered with support issues over paypal.

I'll be digging more into the logs over the next few days, but the only difference I saw up and to that point was that it didn't get blank values for the order variable in before_process() or ec_step2(). Need to add more debugging hooks in there to see what's different, but the paypal CURL initial responses looked the same as when it fails.

Ultimately, I think attempting to load the wordpress modules directly into the zen cart space is a bad, bad idea. It would've been better to use RSS to handle the communication, or some other syndication use.

I'm still confused as to how it could have damaged the $order variable in such a way that ec_step2() cannot even populate it (and why I get no PHP errors concerns me too..), but PHP is not a language I am very familiar with, yet, I just need to hook in a var_dump in there and see what happened to $order. It's a VERY common variable in the wordpress files, and part of the reason I don't think it's a good idea to just go hooking up two pieces of code managed by two different groups blindly.

Ultimately, I'm just going to eliminate the WOZ sidebars with hard-coded or re-coded ones to prevent WOZ from loading the WP files when not needed. It is not necessary to load the WP modules just to get a list of categories or pages as WP provides plenty of ways of querying that information.

I would, however, recommend adding that sanity check to addAddressBookEntry(), considering that it also exists in findMatchingAddressEntry(), and they should probably both ignore invalid input, rather than just one of them.

5 Oct 2010, 4:19 PM
#16
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: PayPall Express - Shipping and Billings Address problems using WOZ addon

shutterdrone:

Ultimately, I think attempting to load the wordpress modules directly into the zen cart space is a bad, bad idea.
I couldn't agree more.

5 Oct 2010, 11:07 PM
#17
shutterdrone avatar

shutterdrone

New Zenner

Join Date:
Oct 2010
Posts:
3
Plugin Contributions:
0

Re: PayPall Express - Shipping and Billings Address problems using WOZ addon

DrByte:

I couldn't agree more.

Yup, it turns out it breaks all kinds of stuff - like the shipping estimator for guest users, amongst other things.

BTW, the patches above are not a good idea - the ramification was that it sends out an invoice with blank ship to address, and the orders have blank ship to's.

The only real solution was to make it such that it only loaded WOZ when the target was actually a wordpress page (like a previous user indicated), and hand-code the wordpress sidebars, as the WOZ sidebars obviously don't work without loading wordpress code.

Additionally, there are major CSS issues with WOZ, and the module should really be coded to only load anything when wordpress is the target. I had to modify it to stop loading different files when it wasn't necessary before we launched the store to eliminate issues between WP and ZC. We just didn't predict the paypal issues.