Group calculations

  • Posts: 53
  • Thank you received: 0
10 years 2 months ago #193140

-- 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?

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
10 years 2 months ago #193149

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.

Please Log in or Create an account to join the conversation.

Time to create page: 0.063 seconds
Powered by Kunena Forum