Skip to main content

Add a field for Paypal Address

More
14 years 8 months ago #37568 by kurisuti
Is it possible to add a text field during check out so that a user can enter their Paypal email address?
Right now, it just shows Paypal as a payment option, but then after a a customer checks out the order is charged to whatever email they have on file for the joomla community (which is usually not linked to their Paypal).

So I guess two questions:

1. Can I add a field during checkout for users to give me their Paypal email address?

2. Can I make their Paypal email address override their regular email they have registered on the community so that the Paypal invoice/request gets sent to their Paypal address??

Thank you!!

Please Log in or Create an account to join the conversation.

More
14 years 8 months ago #37693 by nicolas
Hi,

1. Yes, you can create a custom field for that via the menu Display->Custom fields.

2. That's possible of you edit the paypal plugin code to use that custom field information instead of the normal user email. But that requires some knowledge in PHP.

Please Log in or Create an account to join the conversation.

More
14 years 8 months ago - 14 years 8 months ago #37736 by kurisuti
Thanks for the quick reply!

Added the custom field.
For the plugin would I just need to edit paypal.php where it says $vars["email"]=$user->user_email; and replace it with the custom field email?
Last edit: 14 years 8 months ago by kurisuti.

Please Log in or Create an account to join the conversation.

More
14 years 8 months ago #37824 by nicolas
Yes, that's it.
If you added a custom field of the table "address", it should be in $order->cart->$address_type->CUSTOM_FIELD_COLUMN_NAME
The following user(s) said Thank You: kurisuti

Please Log in or Create an account to join the conversation.

More
14 years 8 months ago #38083 by kurisuti
So I would change

$vars["email"]=$user->user_mail;

to

$vars["email"]=$user->customfieldtitle;


Correct?

Please Log in or Create an account to join the conversation.

More
14 years 8 months ago #38177 by nicolas
If you created a custom field of the table "user", then yes.
If it's a custom field of the table "address", then no, it would be:
$vars["email"]= $order->cart->$address_type->CUSTOM_FIELD_COLUMN_NAME;

Please Log in or Create an account to join the conversation.

Time to create page: 0.166 seconds
Powered by Kunena Forum