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

#   Changing user groups before completing a sale

##

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

Less More

- Posts: 259
- Thank you received: 22
-
-

12 years 1 month ago [\#174724](#174724) by [rodfarrell](/forum/user/5859-rodfarrell "View rodfarrell's Profile")  *[Changing user groups before completing a sale](/forum/33-customers/872165-changing-user-groups-before-completing-a-sale#174724 "-- HikaShop version -- : 2.3.0  I have another requirement thrown at me from left field. My client wants to charge no shipping to customers who provide an employee number.  Ignoring how we verify the input for now, I'm thinking this would most likely be a custom address field so it is stored for future reference and possibly change the user group to one that gets free shipping when the field is completed. Does anyone have any alternate suggestions or see any insurmountable issues with this approach?")* was created by *[rodfarrell](/forum/user/5859-rodfarrell "View rodfarrell's Profile")*

-- HikaShop version -- : 2.3.0

I have another requirement thrown at me from left field. My client wants to charge no shipping to customers who provide an employee number.

Ignoring how we verify the input for now, I'm thinking this would most likely be a custom address field so it is stored for future reference and possibly change the user group to one that gets free shipping when the field is completed. Does anyone have any alternate suggestions or see any insurmountable issues with this approach?

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

12 years 1 month ago [\#174750](#174750) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Changing user groups before completing a sale](/forum/33-customers/872165-changing-user-groups-before-completing-a-sale#174750 "-- HikaShop version -- : 2.3.0  I have another requirement thrown at me from left field. My client wants to charge no shipping to customers who provide an employee number.  Ignoring how we verify the input for now, I'm thinking this would most likely be a custom address field so it is stored for future reference and possibly change the user group to one that gets free shipping when the field is completed. Does anyone have any alternate suggestions or see any insurmountable issues with this approach?")*

Hi,

Yes you can indeed use an address custom field, then you will have to create a plugin based on the function "onBeforeAddressCreate(&amp;$element,&amp;$do)" and do some PHP check regarding the custom field value, and if checks are ok you change the user group.

Here is some documentation for the plugins:
[ hikashop.com/support/support/documentati...r-documentation.html](https://hikashop.com/support/support/documentation/62-hikashop-developer-documentation.html)

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

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

Less More

- Posts: 259
- Thank you received: 22
-
-

11 years 11 months ago [\#182829](#182829) by [rodfarrell](/forum/user/5859-rodfarrell "View rodfarrell's Profile")  Replied by *[rodfarrell](/forum/user/5859-rodfarrell "View rodfarrell's Profile")* on topic *[Changing user groups before completing a sale](/forum/33-customers/872165-changing-user-groups-before-completing-a-sale#182829 "-- HikaShop version -- : 2.3.0  I have another requirement thrown at me from left field. My client wants to charge no shipping to customers who provide an employee number.  Ignoring how we verify the input for now, I'm thinking this would most likely be a custom address field so it is stored for future reference and possibly change the user group to one that gets free shipping when the field is completed. Does anyone have any alternate suggestions or see any insurmountable issues with this approach?")*

I've just come back to this and realised my approach needs to change. What I really need to do is add two required text fields to the manual shipping plugin (or more accurately to a new plugin copied from the manual plugin). Essentially i need an employee number to be entered tyo allow a reduced shipping amount.

As Custom Fields are not available for shipping plugins, what would be the best way to do this?

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

11 years 11 months ago [\#182845](#182845) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Changing user groups before completing a sale](/forum/33-customers/872165-changing-user-groups-before-completing-a-sale#182845 "-- HikaShop version -- : 2.3.0  I have another requirement thrown at me from left field. My client wants to charge no shipping to customers who provide an employee number.  Ignoring how we verify the input for now, I'm thinking this would most likely be a custom address field so it is stored for future reference and possibly change the user group to one that gets free shipping when the field is completed. Does anyone have any alternate suggestions or see any insurmountable issues with this approach?")*

Hi,

Add a custom order field, this way when on the checkout he can fill the field, and in the plugin you can check the content of the fields, if values are correct so change the user group.

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

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

Less More

- Posts: 259
- Thank you received: 22
-
-

11 years 11 months ago [\#182948](#182948) by [rodfarrell](/forum/user/5859-rodfarrell "View rodfarrell's Profile")  Replied by *[rodfarrell](/forum/user/5859-rodfarrell "View rodfarrell's Profile")* on topic *[Changing user groups before completing a sale](/forum/33-customers/872165-changing-user-groups-before-completing-a-sale#182948 "-- HikaShop version -- : 2.3.0  I have another requirement thrown at me from left field. My client wants to charge no shipping to customers who provide an employee number.  Ignoring how we verify the input for now, I'm thinking this would most likely be a custom address field so it is stored for future reference and possibly change the user group to one that gets free shipping when the field is completed. Does anyone have any alternate suggestions or see any insurmountable issues with this approach?")*

Hi Xavier, unfortunately this is not an option because we only want the fields to apply to 1 of the two shipping methods available. An ideal option would be a custom field attached to a shipping method but Hikashop doesn't support that at the moment so the alternative is to add the fields directly to the shipping plugin.

Background - The site has two user groups (representing two corporate clients, each with multiple cost centres with their own accounts). Free shipping is being offered to employees of one of these customers for personal shopping only but as they will either be logging in using the employers login or creating a new account defaulting to the same user group we need the employee and cost centre codes to be completed only for those employee purchases - hence an employee "free shipping" plugin to be validated on the custom fields that only apply to that shipping method.

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

11 years 11 months ago [\#182972](#182972) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Changing user groups before completing a sale](/forum/33-customers/872165-changing-user-groups-before-completing-a-sale#182972 "-- HikaShop version -- : 2.3.0  I have another requirement thrown at me from left field. My client wants to charge no shipping to customers who provide an employee number.  Ignoring how we verify the input for now, I'm thinking this would most likely be a custom address field so it is stored for future reference and possibly change the user group to one that gets free shipping when the field is completed. Does anyone have any alternate suggestions or see any insurmountable issues with this approach?")*

Hi,

Or use as said a custom order field, but add some javascript to hide it based on the shipping method selection.
If desired shipping method, display the field, else hide it, and do all the checks in the plugin.

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

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