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

#   Hikashop Users default address

##

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

Less More

- Posts: 10
- Thank you received: 0
-
-

13 years 10 months ago [\#83524](#83524) by [Carvalho](/forum/user/12305-carvalho "View Carvalho's Profile")  *[Hikashop Users default address](/forum/3-bug-report/77058-hikashop-users-default-address#83524 "Hi,  I'm new here so if this wasn't the right place to post this question, please let me know.  I'm facing one little problem and don't know how or where to solve it (part of the code).  I've written a plugin to extend the order submission, after the creation of the order i do some processing. And for this I have one user to test the order creation with the 'address&#95;user&#95;id' nº 3 (see attachment).  And my assumption at first was that one user can have many addresses but theres one that is the default one, and i was assuming that only one published address can be 'default'.  In one test i made, i had to change one field in the billing address of the user, and hikashop added a new record.  But i got to the situation on the picture i sent you, where i have one address that was added by hikashop when i updated it, but it didn't updated the 'default' field to 1 (like i thought it would). So i get one unpublished address that is the default one, and the last address record not default. And my code expects that the default one must be published..  So, can you point me to a solution to this problem?  I hope i was clear on the explanation.  Thank you, Pedro Carvalho")* was created by *[Carvalho](/forum/user/12305-carvalho "View Carvalho's Profile")*

Hi,

I'm new here so if this wasn't the right place to post this question, please let me know.

I'm facing one little problem and don't know how or where to solve it (part of the code).

I've written a plugin to extend the order submission, after the creation of the order i do some processing. And for this I have one user to test the order creation with the 'address_user_id' nº 3 (see attachment).

And my assumption at first was that one user can have many addresses but theres one that is the default one, and i was assuming that only one published address can be 'default'.

In one test i made, i had to change one field in the billing address of the user, and hikashop added a new record.

But i got to the situation on the picture i sent you, where i have one address that was added by hikashop when i updated it, but it didn't updated the 'default' field to 1 (like i thought it would). So i get one unpublished address that is the default one, and the last address record not default. And my code expects that the default one must be published..

So, can you point me to a solution to this problem?

I hope i was clear on the explanation.

Thank you,
Pedro Carvalho

- [ ![addressesDB.png](/forum/attachment/7760) ](/forum/attachment/7760 "addressesDB.png") [ ](/forum/attachment/7760?download=1 "addressesDB.png")

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Away](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26398
- Thank you received: 4078
-
- [](http://obsi.dev)
-

13 years 10 months ago [\#83657](#83657) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Hikashop Users default address](/forum/3-bug-report/77058-hikashop-users-default-address#83657 "Hi,  I'm new here so if this wasn't the right place to post this question, please let me know.  I'm facing one little problem and don't know how or where to solve it (part of the code).  I've written a plugin to extend the order submission, after the creation of the order i do some processing. And for this I have one user to test the order creation with the 'address&#95;user&#95;id' nº 3 (see attachment).  And my assumption at first was that one user can have many addresses but theres one that is the default one, and i was assuming that only one published address can be 'default'.  In one test i made, i had to change one field in the billing address of the user, and hikashop added a new record.  But i got to the situation on the picture i sent you, where i have one address that was added by hikashop when i updated it, but it didn't updated the 'default' field to 1 (like i thought it would). So i get one unpublished address that is the default one, and the last address record not default. And my code expects that the default one must be published..  So, can you point me to a solution to this problem?  I hope i was clear on the explanation.  Thank you, Pedro Carvalho")*

Hi,

It should be require to modify one or two SQL request but I have to know which modification you did to have such result.
There are several cases where the default address is reset (when HikaShop does not see any published default address), so it is possible that, somewhere, it is possible to modify an address without calling these requests.

So with a little bit more information, we could fix this problem ![:)](/media/kunena/emoticons/3.png ":)")

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

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