Bug in Custom Field Calculation

  • Winston Baccus
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
6 years 1 month ago #132217 by Winston Baccus
Bug in Custom Field Calculation was created by Winston Baccus
Back with another complicated problem.

We are trying to set up a discount that kicks in when you register for a certain number of events. For example:


Once they sign up for at least 4 weeks of camp, the discount kicks in. I could find no way to automate this. Discount bundles don't work because we are asking them to sign-up one kid a time.

My solution was to create a custom field where they select how many weeks they are signing up for in total for their family:


I've run into a problem with the logic of the field. It seems to only apply itself to the first item in the cart and not the price of the cart as a whole.

If I have this in my cart:


It works fine as long as the fee subtraction doesn't go below that item:


Once the fee discount goes to -250, I get this:


If I add another item that costs $200 to my cart, I end up in situations like this where instead of subtracting from the total, it's ADDING to it:

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

More
6 years 1 month ago #132218 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Bug in Custom Field Calculation
Hello Winston

Unfortunately, custom fee field will only be applied to the whole cart, not for individual events in the cart. So I think you will have to find a different setup (look complicated and I don't have the solution right now)

Tuan

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

  • Winston Baccus
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
6 years 1 month ago #132236 by Winston Baccus
Replied by Winston Baccus on topic Bug in Custom Field Calculation
OK, I understand it's a complicated setup, but isn't it doing the exact opposite of what you're saying, it's not applying to the whole cart, it's only applying to an individual event?

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

  • Winston Baccus
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
6 years 1 month ago #132243 by Winston Baccus
Replied by Winston Baccus on topic Bug in Custom Field Calculation
Tuan,

I tried using the coupons instead and they don't seem to work correctly either. I have 11 items in my cart and when I apply a coupon that is set up to discount $250, I get this instead:





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

More
6 years 1 month ago #132244 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Bug in Custom Field Calculation
Hello Winston

When you use coupon code, the system will give discount for every item in cart (discount amount * quantity), so that won't work, too

If you use coupon code solution, I think you will still have to customize code in the file components/com_eventbooking/helper/registration.php , method calculateCartRegistrationFee so that the discount amount will be applied to whole registration, not to individual event in cart like how it works by default

Tuan

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

Moderators: Tuan Pham Ngoc