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

#   Hikashop (New row in a table after payment)

##

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

Less More

- Posts: 1
- Thank you received: 0
-
-

10 years 3 months ago [\#246155](#246155) by [SrKant](/forum/user/44242-srkant "View SrKant's Profile")  *[Hikashop (New row in a table after payment)](/forum/2-general-talk-about-hikashop/885709-hikashop-new-row-in-a-table-after-payment#246155 "Hi all. I need just one specific thing. When a costumer has finished the payment of the item, I want to add a new row in the table user&#95;usergroup&#95;map automatically. So i need to do an insert into this...")* was created by *[SrKant](/forum/user/44242-srkant "View SrKant's Profile")*

Hi all. I need just one specific thing. When a costumer has finished the payment of the item, I want to add a new row in the table user_usergroup_map automatically. So i need to do an insert into this table of the database with the id of the costumber and a number of the group. Could someone help me? I would be very grateful. What php I need to change and how.

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzg4NTcwOS1oaWthc2hvcC1uZXctcm93LWluLWEtdGFibGUtYWZ0ZXItcGF5bWVudD90bXBsPW1hcmtkb3du) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86289
- Thank you received: 14265
-
-

10 years 3 months ago [\#246170](#246170) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Hikashop (New row in a table after payment)](/forum/2-general-talk-about-hikashop/885709-hikashop-new-row-in-a-table-after-payment#246170 "Hi all. I need just one specific thing. When a costumer has finished the payment of the item, I want to add a new row in the table user&#95;usergroup&#95;map automatically. So i need to do an insert into this...")*

Hi,

So what you're saying is that you want to add a user group to the user after the purhcase of a product.
If you want to do it for a specific product, you can use the "user group after purchase" setting of the product edition page in the Business edition to configure that.
If you want to do it regardless of what is bought, then a simple mass action via the menu System&gt;Mass action with a trigger "when an order is updated", a filter for confirmed orders, and an action to add a user group will also allow you to do it without any code modification.

And if you really want to do it with code, I recommend not hacking directly in the core files of HikaShop, but instead, create a custom plugin of the group "hikashop" implementing the "onAfterOrderUpdate" trigger so that you can add your PHP code in there. That way, you won't loose your modification each time you update HikaShop.
You can read more about that in our developer documentation:
[ www.hikashop.com/support/documentation/6...r-documentation.html](https://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.html)

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

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

[](#top)
