- Posts: 53
- Thank you received: 0
Group calculations
11 years 8 months ago #193140
by oharris
Group calculations was created by oharris
-- HikaShop version -- : 2.4
-- Joomla version -- : 2.5.28
-- PHP version -- : 5.4.37
I am preparing a registration form for a conference. There is one price for Members (USD 535) & another price for Non-Members (USD 610). However, one person can register a group of Members (minimum of 5 members), but a discounted rate (USD 515) is to be applied to each Member registered as a group.
How can I apply this discounted rate when a group of 5 or more member are registered?
-- Joomla version -- : 2.5.28
-- PHP version -- : 5.4.37
I am preparing a registration form for a conference. There is one price for Members (USD 535) & another price for Non-Members (USD 610). However, one person can register a group of Members (minimum of 5 members), but a discounted rate (USD 515) is to be applied to each Member registered as a group.
How can I apply this discounted rate when a group of 5 or more member are registered?
Please Log in or Create an account to join the conversation.
11 years 8 months ago #193149
by Xavier
Replied by Xavier on topic Group calculations
Hi,
There is no options for that by default, but via a plugin or potentially a third component that could be done.
If you create a new group, like "discount_group", add the price of USD 515 to the desired product and restrict the price access to the group previously created.
Then, when the customer register, he can be added to a group, so you have to do some checks to see in which group he is added, and use code to check how many users are in this group. If there is less than 4 users, so do nothing, but if there is 4 users, add all of them to the "discount_group", else if there is already more than 4 users, so just add the current user to the discount_group.
You can potentially create a plugin based on the function onBeforeUserCreate(&$element,&$do), onBeforeUserUpdate(&$element,&$do).
Hope this will help you.
There is no options for that by default, but via a plugin or potentially a third component that could be done.
If you create a new group, like "discount_group", add the price of USD 515 to the desired product and restrict the price access to the group previously created.
Then, when the customer register, he can be added to a group, so you have to do some checks to see in which group he is added, and use code to check how many users are in this group. If there is less than 4 users, so do nothing, but if there is 4 users, add all of them to the "discount_group", else if there is already more than 4 users, so just add the current user to the discount_group.
You can potentially create a plugin based on the function onBeforeUserCreate(&$element,&$do), onBeforeUserUpdate(&$element,&$do).
Hope this will help you.
Please Log in or Create an account to join the conversation.
Time to create page: 0.066 seconds