- Posts: 20
- Thank you received: 0
When registering groups, coupon discounts double
- dswatson83
- Topic Author
- Offline
- Junior Member
-
Less
More
13 years 6 months ago #12193
by dswatson83
When registering groups, coupon discounts double was created 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
-
Less
More
- Posts: 20
- Thank you received: 0
13 years 6 months ago #12204
by dswatson83
Replied by dswatson83 on topic Re: When registering groups, coupon discounts double
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.
- Tuan Pham Ngoc
- Offline
- Administrator
-
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) :
Change it to :
After that, it will work as expected !
Tuan
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
-
Less
More
- Posts: 20
- Thank you received: 0
13 years 5 months ago #12300
by dswatson83
Replied by dswatson83 on topic Re: When registering groups, coupon discounts double
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.
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
Support
Documentation
Information
Copyright © 2025 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.