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

#   Customer Group termination

##

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

Less More

- Posts: 332
- Thank you received: 6
-
-

10 years 3 months ago -  10 years 3 months ago [\#248521](#248521) by [LukeDouglas](/forum/user/29032-lukedouglas "View LukeDouglas's Profile")  *[Customer Group termination](/forum/33-customers/886154-customer-group-termination#248521 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.5.36 -- Browser(s) name and version -- : FF,Chrome - both most recent  I have it setup that when an order is confirmed that they are added to a particular ACL group. Works fine. However, is there anyway to set a time-limit to 60 days? I know there is a HikaSerial Group Association plugin but does this take into account the 'End Date' field of the HikaShop Coupon that was generated and when that 'End Date' has passed, then they are removed from the group?")* was created by *[LukeDouglas](/forum/user/29032-lukedouglas "View LukeDouglas's Profile")*

-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.6.2
-- PHP version -- : 5.5.36
-- Browser(s) name and version -- : FF,Chrome - both most recent

I have it setup that when an order is confirmed that they are added to a particular ACL group. Works fine. However, is there anyway to set a time-limit to 60 days? I know there is a HikaSerial Group Association plugin but does this take into account the 'End Date' field of the HikaShop Coupon that was generated and when that 'End Date' has passed, then they are removed from the group?

Last edit: 10 years 3 months ago by [LukeDouglas](/forum/user/29032-lukedouglas "View LukeDouglas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84ODYxNTQtY3VzdG9tZXItZ3JvdXAtdGVybWluYXRpb24/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")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

10 years 2 months ago [\#248524](#248524) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Customer Group termination](/forum/33-customers/886154-customer-group-termination#248524 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.5.36 -- Browser(s) name and version -- : FF,Chrome - both most recent  I have it setup that when an order is confirmed that they are added to a particular ACL group. Works fine. However, is there anyway to set a time-limit to 60 days? I know there is a HikaSerial Group Association plugin but does this take into account the 'End Date' field of the HikaShop Coupon that was generated and when that 'End Date' has passed, then they are removed from the group?")*

Hi,

If you want to do so, you need a subscription system.
And HikaShop is not a subscription system but it have some integrations with some (see "integrations" in the doc).

Regards,

---

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

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

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

Less More

- Posts: 332
- Thank you received: 6
-
-

10 years 2 months ago [\#248568](#248568) by [LukeDouglas](/forum/user/29032-lukedouglas "View LukeDouglas's Profile")  Replied by *[LukeDouglas](/forum/user/29032-lukedouglas "View LukeDouglas's Profile")* on topic *[Customer Group termination](/forum/33-customers/886154-customer-group-termination#248568 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.5.36 -- Browser(s) name and version -- : FF,Chrome - both most recent  I have it setup that when an order is confirmed that they are added to a particular ACL group. Works fine. However, is there anyway to set a time-limit to 60 days? I know there is a HikaSerial Group Association plugin but does this take into account the 'End Date' field of the HikaShop Coupon that was generated and when that 'End Date' has passed, then they are removed from the group?")*

Jerome,

As you may remember, I tried to get the AWOCoupon to work but it couldn't meet our needs and that was one thing that it couldn't do. I do not want to go through another application like Community Builder as I have done one site with it and, while it is great, it is just too much for what we need. I think I'll just see what I can actually develop myself or have the client to simply mark in her calendar to manually remove them from their ACL group while I look for a better solution.

Just thinking 'out loud' but I'm wondering if I could create a plugin that could be run daily via a cron job to check coupons for expiration dates. When it finds a coupon who's expiration date has passed, then find the order that the coupon was used, see the product that was purchased (there are only two) and based on that, then find the customer record in the ACL table with the pertinent ACL group and delete it. That sound's logical to me. Does it sound like a good routine to you?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84ODYxNTQtY3VzdG9tZXItZ3JvdXAtdGVybWluYXRpb24/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: 86584
- Thank you received: 14325
-
-

10 years 2 months ago [\#248586](#248586) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Customer Group termination](/forum/33-customers/886154-customer-group-termination#248586 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.5.36 -- Browser(s) name and version -- : FF,Chrome - both most recent  I have it setup that when an order is confirmed that they are added to a particular ACL group. Works fine. However, is there anyway to set a time-limit to 60 days? I know there is a HikaSerial Group Association plugin but does this take into account the 'End Date' field of the HikaShop Coupon that was generated and when that 'End Date' has passed, then they are removed from the group?")*

Hi,

It sure sounds like a good solution if you can code.
You can even use the onHikashopCronTrigger trigger of plugins of the group "hikashop" in your plugin:
[ www.hikashop.com/support/documentation/6...nHikashopCronTrigger](https://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.html#onHikashopCronTrigger)
So that it will be plugged onto the cron of HikaShop.

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

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

Less More

- Posts: 332
- Thank you received: 6
-
-

10 years 2 months ago -  10 years 2 months ago [\#248595](#248595) by [LukeDouglas](/forum/user/29032-lukedouglas "View LukeDouglas's Profile")  Replied by *[LukeDouglas](/forum/user/29032-lukedouglas "View LukeDouglas's Profile")* on topic *[Customer Group termination](/forum/33-customers/886154-customer-group-termination#248595 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.5.36 -- Browser(s) name and version -- : FF,Chrome - both most recent  I have it setup that when an order is confirmed that they are added to a particular ACL group. Works fine. However, is there anyway to set a time-limit to 60 days? I know there is a HikaSerial Group Association plugin but does this take into account the 'End Date' field of the HikaShop Coupon that was generated and when that 'End Date' has passed, then they are removed from the group?")*

Nicholas,

As you know HikaShop like the back of your hand, :lol: , see if what I have outlined should work as a plugin.

1. onHikashopCronTrigger(&amp;amp;$resultsTrigger)
1. Check #\_hikashop\_discount.discount\_end field and see if time has expired
2. Find order that discount code was used:
1. \#\_hikashop\_discount.discount\_code = #\_hikashop\_order.order\_discount\_code
3. Find product(s) id's that are in that order:
1. \#\_hikashop\_order.order\_id = #\_hikashop\_order\_product.order\_id
2. Store #\_hikashop\_order.order\_user\_id
4. Find product(s) that were in that order:
1. \#\_hikashop\_order\_product.product\_id = #\_hikashop\_product.product\_id
2. Store #\_hikashop\_product.product\_group\_after\_purchase
5. Use stored #\_hikashop\_order.order\_user\_id and #\_hikashop\_product.product\_group\_after\_purchase variables to find assigned group
1. \#\_hikashop\_order.order\_user\_id = #\_user\_usergroup\_map.user\_id
\#\_hikashop\_product.product\_group\_after\_purchase = #\_user\_usergroup\_map.group\_id
6. If found, delete #\_user\_usergroup\_map record

If this looks fine to you, where would be the best place to put this 'custom' plugin PHP file?

Last edit: 10 years 2 months ago by [LukeDouglas](/forum/user/29032-lukedouglas "View LukeDouglas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMzLWN1c3RvbWVycy84ODYxNTQtY3VzdG9tZXItZ3JvdXAtdGVybWluYXRpb24/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: 86584
- Thank you received: 14325
-
-

10 years 2 months ago [\#248621](#248621) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Customer Group termination](/forum/33-customers/886154-customer-group-termination#248621 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.2 -- PHP version -- : 5.5.36 -- Browser(s) name and version -- : FF,Chrome - both most recent  I have it setup that when an order is confirmed that they are added to a particular ACL group. Works fine. However, is there anyway to set a time-limit to 60 days? I know there is a HikaSerial Group Association plugin but does this take into account the 'End Date' field of the HikaShop Coupon that was generated and when that 'End Date' has passed, then they are removed from the group?")*

Hi,

That looks fine to me yes.
I would recommend to make a new plugin for that.
So the files will be in plugins/hikashop/XXX/ where XXX is the name of your custom plugin.
You'll have a PHP file with your plugin class and the onHikashopCronTrigger function in it, and a XML file defining the plugin.
You can base yourself on other plugins in plugins/hikashop

Also, the joomla documentation on how to write plugins:
[ docs.joomla.org/Portal:Plugin\_Development](http://docs.joomla.org/Portal:Plugin_Development)

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

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