When registering groups, coupon discounts double

  • dswatson83
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
13 years 6 months ago #12193 by dswatson83
I just noticed when registering a group, the discount seems to double. I have a $45 class and when a person registers 2 people, it increases the price to $90. But if I give them a coupon for $45, it doubles the coupon value or counts it twice. This is a problem and I need it fixed. I either need to disable group registrations for the coupon or I need this to not work this way. How can I give away a single class if they can just register for group and apply the discount to 3 people. Thanks.

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

  • dswatson83
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
13 years 6 months ago #12204 by dswatson83
I was able to modify the code to get it to do what I was looking for but I still think it would be nice to be able to control individually how a coupon would affect group registration and whether it should double or only apply to a single product.

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

More
13 years 6 months ago #12223 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: When registering groups, coupon discounts double
Hi

By default, when you make a group registration, the coupon discount will be multiply by number of registrants. If you just want this discount to affect one registrant only, find the code below in the file components/com_eventbooking/views/confirmation/view.html.php (from line 320 to line 326) :
Code:
if ($coupon) { if ($coupon->coupon_type == 0) { $discount = $discount + $totalAmount*$coupon->discount/100 ; } else { $discount = $discount + $numberRegistrants*$coupon->discount ; } }

Change it to :
Code:
if ($coupon) { if ($coupon->coupon_type == 0) { $discount = $discount + $totalAmount*$coupon->discount/100 ; } else { $discount = $discount + $coupon->discount ; } }

After that, it will work as expected !

Tuan

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

  • dswatson83
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
13 years 5 months ago #12300 by dswatson83
I've got that part working well but something I noticed (and it's probably an error) is that if you use a coupon during a group registration, it only counts you as using the coupon once where you should be using it as many times as people registering.
Where can I change how the coupon counts how many times it has been used so I can have it count used+numberregisterd.

Also, when it checks the coupon to see if it is valid, it only checks if the coupon has at least 1 more use, even with group registration. It should probably check if the times>=used+number registering.
Thanks.

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

Moderators: Tuan Pham Ngoc