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

#   Limit characters when user types in billing or delivery address

##

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

Less More

- Posts: 256
- Thank you received: 2
-
-

4 years 10 months ago [\#338794](#338794) by [dancingkazzaf](/forum/user/31984-dancingkazzaf "View dancingkazzaf's Profile")  *[Limit characters when user types in billing or delivery address](/forum/27-checkout/903850-limit-characters-when-user-types-in-billing-or-delivery-address#338794 "-- url of the page with the problem -- :   www.restorationuk.com/  -- HikaShop version -- : 4.4.5 -- Joomla version -- : 3.10.5 -- PHP version -- : 7.4.27 -- Browser(s) name and version -- : Chrome  Hello, We use Sagepay along with Hikashop but some of our payments cannot be verified by Sagepay due to the characters being too long on the billing or delivery addresses. Is there a way to limit characters a user can type in. Sagepay recommend maximum 50 characters.  Thanks.")* was created by *[dancingkazzaf](/forum/user/31984-dancingkazzaf "View dancingkazzaf's Profile")*

-- url of the page with the problem -- : [ www.restorationuk.com/](https://www.restorationuk.com/)
-- HikaShop version -- : 4.4.5
-- Joomla version -- : 3.10.5
-- PHP version -- : 7.4.27
-- Browser(s) name and version -- : Chrome

Hello, We use Sagepay along with Hikashop but some of our payments cannot be verified by Sagepay due to the characters being too long on the billing or delivery addresses. Is there a way to limit characters a user can type in. Sagepay recommend maximum 50 characters.

Thanks.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwMzg1MC1saW1pdC1jaGFyYWN0ZXJzLXdoZW4tdXNlci10eXBlcy1pbi1iaWxsaW5nLW9yLWRlbGl2ZXJ5LWFkZHJlc3M/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: 86587
- Thank you received: 14327
-
-

4 years 10 months ago [\#338796](#338796) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Limit characters when user types in billing or delivery address](/forum/27-checkout/903850-limit-characters-when-user-types-in-billing-or-delivery-address#338796 "-- url of the page with the problem -- :   www.restorationuk.com/  -- HikaShop version -- : 4.4.5 -- Joomla version -- : 3.10.5 -- PHP version -- : 7.4.27 -- Browser(s) name and version -- : Chrome  Hello, We use Sagepay along with Hikashop but some of our payments cannot be verified by Sagepay due to the characters being too long on the billing or delivery addresses. Is there a way to limit characters a user can type in. Sagepay recommend maximum 50 characters.  Thanks.")*

We do have some code in the Sagepay plugin to limit the data sent to Sagepay.
However, I looked at the code and it uses a limit of 100 characters, not 50. So I can only think that Sagepay might have changed that limit at some point ?
You can open the file plugins/hikashoppayment/sagepay/sagepay.php via FTP and you'll find the code: Code:

$address1 = ''; $address2 = ''; $address1 = @$order-&gt;cart-&gt;billing_address-&gt;address_street; if( strlen($address1) &gt; 100 ) { $address2 = substr($address1, 100, 100); $address1 = substr($address1, 0, 100); } $shipping_address = !empty($order-&gt;cart-&gt;shipping_address-&gt;address_firstname) ? $order-&gt;cart-&gt;shipping_address : $order-&gt;cart-&gt;billing_address; $ship_address1 = ''; $ship_address2 = ''; $ship_address1 = @$shipping_address-&gt;address_street; if( empty($ship_address1) ) { $ship_address1 = $address1; } if( strlen($ship_address1) &gt; 100 ) { $ship_address2 = substr($ship_address1, 100, 100); $ship_address1 = substr($ship_address1, 0, 100); }

There, You can see several times 100 mentioned. If you replace 100 by 50 everywhere there, it will restrict the address to 50 characters instead of 100.
Please let us know how it goes so that we can include the changes on our end too.

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

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

Less More

- Posts: 256
- Thank you received: 2
-
-

4 years 10 months ago [\#338849](#338849) by [dancingkazzaf](/forum/user/31984-dancingkazzaf "View dancingkazzaf's Profile")  Replied by *[dancingkazzaf](/forum/user/31984-dancingkazzaf "View dancingkazzaf's Profile")* on topic *[Limit characters when user types in billing or delivery address](/forum/27-checkout/903850-limit-characters-when-user-types-in-billing-or-delivery-address#338849 "-- url of the page with the problem -- :   www.restorationuk.com/  -- HikaShop version -- : 4.4.5 -- Joomla version -- : 3.10.5 -- PHP version -- : 7.4.27 -- Browser(s) name and version -- : Chrome  Hello, We use Sagepay along with Hikashop but some of our payments cannot be verified by Sagepay due to the characters being too long on the billing or delivery addresses. Is there a way to limit characters a user can type in. Sagepay recommend maximum 50 characters.  Thanks.")*

Hello,
Thankyou for getting back to me. That is strange they must have changed the limit recently then. I will get the plugin updated and see how I get on with orders.

Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwMzg1MC1saW1pdC1jaGFyYWN0ZXJzLXdoZW4tdXNlci10eXBlcy1pbi1iaWxsaW5nLW9yLWRlbGl2ZXJ5LWFkZHJlc3M/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.050 seconds

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