Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 03-18-2020 01:16:59

sdn
Member
From: UK
Registered: 05-29-2007
Posts: 825

Disable Delivery Address Changes for PayPal Orders

is it possible to stop customers from altering the delivery address on just PayPal checkouts so their only option is to have goods delivered to a PayPal verified address with seller protection?

For example, suppress the "Deliver to a Different Address" link.

Last edited by sdn (03-18-2020 01:17:54)


Simon

Offline

 

#2 03-18-2020 08:08:30

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19485
Website

Re: Disable Delivery Address Changes for PayPal Orders

Edit the file {private}/apps/ecom/ECOM/includes/coshipinfo.php.  At the bottom of the file you will see all the links being printed for shipping address changes starting with a return statement for backend displays:

Code:

// +--
// | Don't print links for BackEnd requests.
// +--

if (!(empty($isbackend))) {return 1;}

Right below that, add:

Code:

if ($cosess['gateway_select'] == 'paypalproe') {return 1;}

That should suppress the links on the checkout page when PayPal Website Payments Pro Express (express checkout) is selected.


Nick Hendler

Offline

 

#3 03-18-2020 10:21:40

sdn
Member
From: UK
Registered: 05-29-2007
Posts: 825

Re: Disable Delivery Address Changes for PayPal Orders

Great, that works but the "Update Billing Information" link is still there. Is there any way to also remove that one?


Simon

Offline

 

#4 03-19-2020 08:31:29

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19485
Website

Re: Disable Delivery Address Changes for PayPal Orders

sdn wrote:

Great, that works but the "Update Billing Information" link is still there. Is there any way to also remove that one?

In {private}/apps/ecom/ECOM/includes/cobillinfo.php, right below:

Code:

if (!(empty($isbackend))) {return 1;}

Add:

Code:

$cosess = $this->globals('ecom.checkout_cosess');
if ($cosess['gateway_select'] == 'paypalproe') {return 1;}

And that would suppress the billing info change links in checkout for PayPal Website Payments Pro Express Checkout orders.


Nick Hendler

Offline

 

#5 03-20-2020 05:45:23

eramusic
Member
From: Constanta
Registered: 03-20-2020
Posts: 2
Website

Re: Disable Delivery Address Changes for PayPal Orders

Thanks for the support!
I had the same problem!

Best regards!

Offline

 

#6 03-24-2020 03:45:03

sdn
Member
From: UK
Registered: 05-29-2007
Posts: 825

Re: Disable Delivery Address Changes for PayPal Orders

The second piece of code did not remove the "Update Billing Information" link. It removes the "Deliver to a Different Address" link only. The problem with "Update Billing Information" link is that you can also change the delivery address when doing a guest checkout. If you are logged into an account it only shows the billing address fields.

However, it highlights a problem outlined in post #12 onwards at https://forum.kryptronic.com/viewtopic.php?id=33881
My test account populated the delivery address with a one-time address and the new code stopped me from changing it so I have removed the new code. One problem solved and a new worse one created.

Still, plenty of time to think about it now we are all in COVID-19 lockdown in the UK. Pray that it does not take hold in the US…

Can the cart be made to use the information provided by PayPal to populate the Billing and Delivery address fields for Express checkouts rather than reverting back to previous session data? Is there a reason it does not do that anyway?

Last edited by sdn (03-24-2020 09:17:08)


Simon

Offline

 

#7 03-24-2020 11:51:48

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19485
Website

Re: Disable Delivery Address Changes for PayPal Orders

My test account populated the delivery address with a one-time address and the new code stopped me from changing it

Why did you want to change the address you logged with the order at PayPal?


Nick Hendler

Offline

 

#8 03-25-2020 07:07:49

sdn
Member
From: UK
Registered: 05-29-2007
Posts: 825

Re: Disable Delivery Address Changes for PayPal Orders

When logged into an account and doing a PayPal Express checkout, the debug output shows that the delivery address is being pulled from "CORE_Session::sessupdate: BULK session update:" and not the SOAP address information provided by PayPal in "ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/". The delivery address was not the one last used though.

When logged out of the account, the billing and delivery address match the PayPal SOAP data.

I have also noticed that if you update the delivery address, you break out of the Express checkout process and revert to a conventional checkout with PayPal standard and card payment radio buttons and a "Continue" button rather than the "Process Payment" button to complete the Express checkout which is going to confuse people.

Last edited by sdn (03-25-2020 07:08:49)


Simon

Offline

 

#9 03-25-2020 08:59:11

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19485
Website

Re: Disable Delivery Address Changes for PayPal Orders

I'm looking into this.  This may be a *feature* from the session changes made during update 9.0.2.  The behavior you describe is not correct.  I'll give it a good going over.


Nick Hendler

Offline

 

#10 04-03-2020 07:40:07

sdn
Member
From: UK
Registered: 05-29-2007
Posts: 825

Re: Disable Delivery Address Changes for PayPal Orders

Could the code be amended so that it populates both the billing and delivery address fields with the same information? I assume this code does just the billing address fields?

Code:

$addbook = $this->globals('core_session.addbook'); if ((empty($addbook)) || (!(is_array($addbook)))) {$addbook = array();}
$hash           = md5(serialize($addy));
$addbook[$hash] = $addy;
$sessiondata['addbook']         = $addbook;
$sessiondata['addbook_billing'] = $hash;

Last edited by sdn (04-03-2020 07:41:22)


Simon

Offline

 

#11 04-06-2020 07:57:18

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19485
Website

Re: Disable Delivery Address Changes for PayPal Orders

That code is adding an address book entry for the billing address.  Where did you grab that from?  The PayPal Express module?


Nick Hendler

Offline

 

#12 04-06-2020 09:00:30

sdn
Member
From: UK
Registered: 05-29-2007
Posts: 825

Re: Disable Delivery Address Changes for PayPal Orders

Yes, paypalproe.php


Simon

Offline

 

#13 04-07-2020 07:18:28

sdn
Member
From: UK
Registered: 05-29-2007
Posts: 825

Re: Disable Delivery Address Changes for PayPal Orders

forum hijacking service more like


Simon

Offline

 

#14 04-07-2020 09:46:42

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19485
Website

Re: Disable Delivery Address Changes for PayPal Orders

That's what that code is doing - PayPal only sends over a shipping address so that's copied over to the billing address and an address book entry is made with that address.


Nick Hendler

Offline

 

Board footer