greasemonkey Posted June 29, 2015 Share Posted June 29, 2015 @@Harald Ponce de Leon I have a bug for the PayPal app - it is missing the parameter SHIPTOSTREET2 which is called 'suburb' in OsC. Looking back a previous versions of PayPal Express it look like its always been missing. I presume the difference in terminology has caused the omission - Address Line 2 (optional) in PayPal vs Suburb in OsC (I have always renamed Suburb in OsC to Address Line 2). If a customer adds or updates their address using the checkout with PayPal button - this 2nd address line or suburb line is omitted when entered into the order and DB (which for some delivery location is very critical). This can easily be fixed with the following changes to /ext/modules/payment/paypal/express.php Under $ship_address = tep_db_prepare_input($appPayPalEcResult['PAYMENTREQUEST_0_SHIPTOSTREET']); Add //added for address line 2 $ship_suburb = tep_db_prepare_input($appPayPalEcResult['PAYMENTREQUEST_0_SHIPTOSTREET2']); And under; $ship_address = tep_db_prepare_input($appPayPalEcResult['SHIPTOSTREET']); Add //added for address line 2 $ship_suburb = tep_db_prepare_input($appPayPalEcResult['SHIPTOSTREET2']); And changed this $check_query = tep_db_query("select address_book_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and entry_firstname = '" . tep_db_input($ship_firstname) . "' and entry_lastname = '" . tep_db_input($ship_lastname) . "' and entry_street_address = '" . tep_db_input($ship_address) . "' and entry_postcode = '" . tep_db_input($ship_postcode) . "' and entry_city = '" . tep_db_input($ship_city) . "' and (entry_state = '" . tep_db_input($ship_zone) . "' or entry_zone_id = '" . (int)$ship_zone_id . "') and entry_country_id = '" . (int)$ship_country_id . "' limit 1"); To //modified to add address line 2 $check_query = tep_db_query("select address_book_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and entry_firstname = '" . tep_db_input($ship_firstname) . "' and entry_lastname = '" . tep_db_input($ship_lastname) . "' and entry_street_address = '" . tep_db_input($ship_address) . "' and entry_suburb = '" . tep_db_input($ship_suburb) . "' and entry_postcode = '" . tep_db_input($ship_postcode) . "' and entry_city = '" . tep_db_input($ship_city) . "' and (entry_state = '" . tep_db_input($ship_zone) . "' or entry_zone_id = '" . (int)$ship_zone_id . "') and entry_country_id = '" . (int)$ship_country_id . "' limit 1"); Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted June 29, 2015 Share Posted June 29, 2015 I searched the paypal app, the files of 2.3.4 and those of 2.3.4 BS and couldn't find any mention of SHIPTOSTREET2. Are you sure that is not from an addon you installed? Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
greasemonkey Posted June 29, 2015 Author Share Posted June 29, 2015 sorry i forgot the array below 'entry_street_address' => $ship_address, add //add for address line 2 'entry_suburb' => $ship_suburb, Quote Link to comment Share on other sites More sharing options...
greasemonkey Posted June 29, 2015 Author Share Posted June 29, 2015 @@Jack_mcs I searched the paypal app, the files of 2.3.4 and those of 2.3.4 BS and couldn't find any mention of SHIPTOSTREET2. Are you sure that is not from an addon you installed? That was my point - SHIPTOSTREET2 has been omitted (and always has been) from PayPal Express. And I'm suggesting it shouldn't be omitted/missing - the fact it is missing is a bug. Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted June 29, 2015 Share Posted June 29, 2015 Ahh, OK. I thought you meant it was in the code. I see now you meant a variable from paypal. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
tgely Posted July 4, 2015 Share Posted July 4, 2015 @@Harald Ponce de Leon I have a bug for the PayPal app - it is missing the parameter SHIPTOSTREET2 which is called 'suburb' in OsC. Looking back a previous versions of PayPal Express it look like its always been missing. I presume the difference in terminology has caused the omission - Address Line 2 (optional) in PayPal vs Suburb in OsC (I have always renamed Suburb in OsC to Address Line 2). If a customer adds or updates their address using the checkout with PayPal button - this 2nd address line or suburb line is omitted when entered into the order and DB (which for some delivery location is very critical). This can easily be fixed with the following changes to /ext/modules/payment/paypal/express.php Under $ship_address = tep_db_prepare_input($appPayPalEcResult['PAYMENTREQUEST_0_SHIPTOSTREET']); Add //added for address line 2 $ship_suburb = tep_db_prepare_input($appPayPalEcResult['PAYMENTREQUEST_0_SHIPTOSTREET2']); And under; $ship_address = tep_db_prepare_input($appPayPalEcResult['SHIPTOSTREET']); Add //added for address line 2 $ship_suburb = tep_db_prepare_input($appPayPalEcResult['SHIPTOSTREET2']); And changed this $check_query = tep_db_query("select address_book_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and entry_firstname = '" . tep_db_input($ship_firstname) . "' and entry_lastname = '" . tep_db_input($ship_lastname) . "' and entry_street_address = '" . tep_db_input($ship_address) . "' and entry_postcode = '" . tep_db_input($ship_postcode) . "' and entry_city = '" . tep_db_input($ship_city) . "' and (entry_state = '" . tep_db_input($ship_zone) . "' or entry_zone_id = '" . (int)$ship_zone_id . "') and entry_country_id = '" . (int)$ship_country_id . "' limit 1"); To //modified to add address line 2 $check_query = tep_db_query("select address_book_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and entry_firstname = '" . tep_db_input($ship_firstname) . "' and entry_lastname = '" . tep_db_input($ship_lastname) . "' and entry_street_address = '" . tep_db_input($ship_address) . "' and entry_suburb = '" . tep_db_input($ship_suburb) . "' and entry_postcode = '" . tep_db_input($ship_postcode) . "' and entry_city = '" . tep_db_input($ship_city) . "' and (entry_state = '" . tep_db_input($ship_zone) . "' or entry_zone_id = '" . (int)$ship_zone_id . "') and entry_country_id = '" . (int)$ship_country_id . "' limit 1"); Thanks the report! Next please post into bug forum http://www.oscommerce.com/forums/tracker/issue-1219-paypal-app-express-checkout-by-greasemonkey/ Quote osCommerce based shop owner with minimal design and focused on background works. When the less is more.Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store. Link to comment Share on other sites More sharing options...
greasemonkey Posted July 4, 2015 Author Share Posted July 4, 2015 @@Gergely thank you for moving it over. Scott Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.