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

#   Apply 'Enter user address' function to already imported orders?

##

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

Less More

- Posts: 6
- Thank you received: 1
-
-

1 year 3 months ago [\#367838](#367838) by [UPL](/forum/user/83461-upl "View UPL's Profile")  *[Apply 'Enter user address' function to already imported orders?](/forum/37-import-export-csv-xls/909569-apply-enter-user-address-function-to-already-imported-orders#367838 "-- HikaShop version -- : 6.0.0 -- Joomla version -- : 5.3.2 -- PHP version -- : 8.2.28  Hello,  I have imported several orders via CSV, and each one is correctly assigned a user&#95;id. The user is properly linked in the backend, but the address data is not filled in.  When assigning a user manually to an order in the backend, a popup appears with the switch &quot;Enter user address&quot;, which fills in the user's address fields in the order.  Is there a way to apply this action in bulk or automatically to existing orders? That is, to have the user's address data applied to orders that already exist, as if the switch had been activated manually.  Thanks for your help.")* was created by *[UPL](/forum/user/83461-upl "View UPL's Profile")*

-- HikaShop version -- : 6.0.0
-- Joomla version -- : 5.3.2
-- PHP version -- : 8.2.28

Hello,

I have imported several orders via CSV, and each one is correctly assigned a user_id. The user is properly linked in the backend, but the address data is not filled in.

When assigning a user manually to an order in the backend, a popup appears with the switch "Enter user address", which fills in the user's address fields in the order.

Is there a way to apply this action in bulk or automatically to existing orders? That is, to have the user's address data applied to orders that already exist, as if the switch had been activated manually.

Thanks for your help.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy85MDk1NjktYXBwbHktZW50ZXItdXNlci1hZGRyZXNzLWZ1bmN0aW9uLXRvLWFscmVhZHktaW1wb3J0ZWQtb3JkZXJzP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86324
- Thank you received: 14286
-
-

1 year 3 months ago [\#367846](#367846) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Apply 'Enter user address' function to already imported orders?](/forum/37-import-export-csv-xls/909569-apply-enter-user-address-function-to-already-imported-orders#367846 "-- HikaShop version -- : 6.0.0 -- Joomla version -- : 5.3.2 -- PHP version -- : 8.2.28  Hello,  I have imported several orders via CSV, and each one is correctly assigned a user&#95;id. The user is properly linked in the backend, but the address data is not filled in.  When assigning a user manually to an order in the backend, a popup appears with the switch &quot;Enter user address&quot;, which fills in the user's address fields in the order.  Is there a way to apply this action in bulk or automatically to existing orders? That is, to have the user's address data applied to orders that already exist, as if the switch had been activated manually.  Thanks for your help.")*

Hi,

There is no ready made tool for this.
However, it should be fairly easy to configure a mass action (menu System&gt;Mass actions) to do that:
[ www.hikashop.com/support/documentation/167-massaction-form.html](https://www.hikashop.com/support/documentation/167-massaction-form.html)
You'll want to :
- use the "order" data
- use a filter on "order_billing_address_id" being equal to 0
- use an action "run MySQL query" with the query: Code:

UPDATE #__hikashop_order AS o LEFT JOIN #__hikashop_address AS a ON a.user_id = o.order_user_id AND a.address_type='billing' SET o.order_billing_address_id = a.address_id WHERE o.order_id = {order_id};

When you run that mass action, it will process all the orders (the first 500 if you leave the "limitation" value to 500. You can potentially increase that value to a few thousands, but more than that and the PHP process will likely crash in the middle. However, you can just process the mass action several times until all the orders are processed) and set the billing address of these orders to be one of the billing addresses of the user.
Then, rinse and repeat for "shipping" instead of "billing" if you also want to set the shipping address.

The following user(s) said Thank You: [UPL](/forum/user/83461-upl "View UPL's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM3LWltcG9ydC1leHBvcnQtY3N2LXhscy85MDk1NjktYXBwbHktZW50ZXItdXNlci1hZGRyZXNzLWZ1bmN0aW9uLXRvLWFscmVhZHktaW1wb3J0ZWQtb3JkZXJzP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) 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.046 seconds

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