[Skip to main content](#vessel-content)

#   No country code sent to PayPal - custom mods

##

- **[dyvel](/forum/user/39996-dyvel "View dyvel's Profile")**
- [![dyvel's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39996-dyvel "View dyvel's Profile") Topic Author
- [ Offline](/forum/user/39996-dyvel)

Less More

- Posts: 88
- Thank you received: 20
-
-

9 years 1 month ago [\#278901](#278901) by [dyvel](/forum/user/39996-dyvel "View dyvel's Profile")  *[No country code sent to PayPal - custom mods](/forum/27-checkout/892053-no-country-code-sent-to-paypal-custom-mods#278901 "-- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.5  Hi  Lately I discovered an issue, that PayPal gives users this error message when trying to pay: There is a problem with your shipping Address - please return to the merchant and update... PayPal seem to be more strict now.  I tracked the issue to this line (112) in the PayPal payment plugin (paypal.php).  Problem is, it's empty. So I inserted a debug function that send me an email with @order object, so I could inspect the issue. The array address&#95;country doesn't have a child called zone&#95;code&#95;2, so it makes sense it's empty.  I know this is because of some custom work I've done. Country zone field is disabled, as I'm setting it manually based on language selection on the site (user is not able to change country).  on the user-&gt;registration.php file, I'm setting country by this code:  I've looked up the data I need through a mysql call. Looking at the database table hikashop&#95;address, the user info is there, and also in the SESSION &#91;hikashop&#95;address&#95;data&#93;. I've compared data from setting country manually or through hikashop zone field selection. They were identical.  I did notice that on the last step page where the users address is displayed, there was a difference.  If I set the country using the zone field as you would normally, then the country is displayed on the nest step page where the address is confirmed. If I set it manually, it is not displayed on this page. So I'm missing something here, and I believe this is key to the error I'm getting not from PayPal.  Can you give any guidance / pointers?  Thanks in advance :-)")* was created by *[dyvel](/forum/user/39996-dyvel "View dyvel's Profile")*

-- HikaShop version -- : 3.1.1
-- Joomla version -- : 3.7.5

Hi

Lately I discovered an issue, that PayPal gives users this error message when trying to pay: There is a problem with your shipping Address - please return to the merchant and update... PayPal seem to be more strict now.

I tracked the issue to this line (112) in the PayPal payment plugin (paypal.php).
Code:

$vars['country'] = @$order-&gt;cart-&gt;$address_type-&gt;address_country-&gt;zone_code_2;

Problem is, it's empty. So I inserted a debug function that send me an email with @order object, so I could inspect the issue.
The array address_country doesn't have a child called zone_code_2, so it makes sense it's empty.

I know this is because of some custom work I've done. Country zone field is disabled, as I'm setting it manually based on language selection on the site (user is not able to change country).

on the user-&gt;registration.php file, I'm setting country by this code:
Code:

&lt;input type="hidden" id="address_country" name="data[address][address_country]" value="&lt;?php echo $result-&gt;zone_namekey; ?&gt;" /&gt;

I've looked up the data I need through a mysql call. Looking at the database table hikashop_address, the user info is there, and also in the SESSION [hikashop_address_data]. I've compared data from setting country manually or through hikashop zone field selection. They were identical.

I did notice that on the last step page where the users address is displayed, there was a difference.

If I set the country using the zone field as you would normally, then the country is displayed on the nest step page where the address is confirmed.
If I set it manually, it is not displayed on this page. So I'm missing something here, and I believe this is key to the error I'm getting not from PayPal.

Can you give any guidance / pointers?

Thanks in advance ![:-)](/media/kunena/emoticons/9.png ":-)")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5MjA1My1uby1jb3VudHJ5LWNvZGUtc2VudC10by1wYXlwYWwtY3VzdG9tLW1vZHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[GARANDET](/forum/user/40456-garandet "View GARANDET's Profile")**
- [![GARANDET's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/40456-garandet "View GARANDET's Profile")
- [ Offline](/forum/user/40456-garandet)

Less More

- Posts: 55
- Thank you received: 6
-
-

9 years 1 month ago [\#278930](#278930) by [GARANDET](/forum/user/40456-garandet "View GARANDET's Profile")  Replied by *[GARANDET](/forum/user/40456-garandet "View GARANDET's Profile")* on topic *[No country code sent to PayPal - custom mods](/forum/27-checkout/892053-no-country-code-sent-to-paypal-custom-mods#278930 "-- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.5  Hi  Lately I discovered an issue, that PayPal gives users this error message when trying to pay: There is a problem with your shipping Address - please return to the merchant and update... PayPal seem to be more strict now.  I tracked the issue to this line (112) in the PayPal payment plugin (paypal.php).  Problem is, it's empty. So I inserted a debug function that send me an email with @order object, so I could inspect the issue. The array address&#95;country doesn't have a child called zone&#95;code&#95;2, so it makes sense it's empty.  I know this is because of some custom work I've done. Country zone field is disabled, as I'm setting it manually based on language selection on the site (user is not able to change country).  on the user-&gt;registration.php file, I'm setting country by this code:  I've looked up the data I need through a mysql call. Looking at the database table hikashop&#95;address, the user info is there, and also in the SESSION &#91;hikashop&#95;address&#95;data&#93;. I've compared data from setting country manually or through hikashop zone field selection. They were identical.  I did notice that on the last step page where the users address is displayed, there was a difference.  If I set the country using the zone field as you would normally, then the country is displayed on the nest step page where the address is confirmed. If I set it manually, it is not displayed on this page. So I'm missing something here, and I believe this is key to the error I'm getting not from PayPal.  Can you give any guidance / pointers?  Thanks in advance :-)")*

Same here ? [ www.hikashop.com/forum/payment-methods/8...hant-and-update.html](https://www.hikashop.com/forum/payment-methods/892057-paypal-error-message-please-return-to-the-merchant-and-update.html)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5MjA1My1uby1jb3VudHJ5LWNvZGUtc2VudC10by1wYXlwYWwtY3VzdG9tLW1vZHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86316
- Thank you received: 14276
-
-

9 years 1 month ago [\#278918](#278918) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[No country code sent to PayPal - custom mods](/forum/27-checkout/892053-no-country-code-sent-to-paypal-custom-mods#278918 "-- HikaShop version -- : 3.1.1 -- Joomla version -- : 3.7.5  Hi  Lately I discovered an issue, that PayPal gives users this error message when trying to pay: There is a problem with your shipping Address - please return to the merchant and update... PayPal seem to be more strict now.  I tracked the issue to this line (112) in the PayPal payment plugin (paypal.php).  Problem is, it's empty. So I inserted a debug function that send me an email with @order object, so I could inspect the issue. The array address&#95;country doesn't have a child called zone&#95;code&#95;2, so it makes sense it's empty.  I know this is because of some custom work I've done. Country zone field is disabled, as I'm setting it manually based on language selection on the site (user is not able to change country).  on the user-&gt;registration.php file, I'm setting country by this code:  I've looked up the data I need through a mysql call. Looking at the database table hikashop&#95;address, the user info is there, and also in the SESSION &#91;hikashop&#95;address&#95;data&#93;. I've compared data from setting country manually or through hikashop zone field selection. They were identical.  I did notice that on the last step page where the users address is displayed, there was a difference.  If I set the country using the zone field as you would normally, then the country is displayed on the nest step page where the address is confirmed. If I set it manually, it is not displayed on this page. So I'm missing something here, and I believe this is key to the error I'm getting not from PayPal.  Can you give any guidance / pointers?  Thanks in advance :-)")*

Hi,

If you disable the custom field in order to add a hidden field instead, HikaShop won't take into account your custom field.
Only the custom fields that are supposed to be displayed will be taken into account, for security reasons.
So what you should do is that in the settings of the custom field, you should leave it configured as if you wanted it to display on the registration form.
Then, override the registration form view file displaying the custom fields (custom_fields, or custom_fields_boostrap I guess) and skip that custom field and display instead your hidden input with the correct name.
That way, HikaShop will take it into account when you click on the button to validate the form.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5MjA1My1uby1jb3VudHJ5LWNvZGUtc2VudC10by1wYXlwYWwtY3VzdG9tLW1vZHM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.098 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
