Validation check in Cart Colorbox

  • Christoph
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 1 month ago - 7 years 1 month ago #114326 by Christoph
Validation check in Cart Colorbox was created by Christoph
Hello,

There is another new EB customize quest, well worth of the thought. If a user selects an event and the ticket shows up in the colorboxed cart (cart/mini.php) the events stored in the cart (the one just selected for the cart and those already in the cart) get validated wether they are of the same kind, precisely category A or B. And if the user mixes tickets from category A and B, a message should show up, actually not to mix it. If tickets only from A or B are in the cart, that is fine so the Checkout button would still be active.
Otherwise a message will appear to inform the user that this does not work and the checkout button should get an inform symbol while deactivated.

Something like:
Code:
load colorbox mini.php categoryFamilyProblem = false Checkout Button = true validateSameCategoryFamily () for each (events in cart ) load event categories into array () if (any of (values of each array) are not at least of (one of the same category)) categoryFamilyProblem = true Checkout Button = false echo "Please check wether your events are not for the definite same single participant. Kindly revise your order and book events separately for each participant." else categoryFamilyProblem = false Checkout Button = true onClick EventRemoveButton validateCategoryFamily ()

That would be logic. In EB, which functions and references do I need to translate this into code I'm happy to thinker with? May be worth to be shared - it if it works.

Thank you,
Chris
Last edit: 7 years 1 month ago by Christoph. Reason: spelling

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

More
7 years 1 month ago #114331 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Validation check in Cart Colorbox
Hi Chris

There is no function like this in Events Booking. So if you want to have it works like that, you will need to customize the code yourself

As you figured out, you need to look at the code in the file components/com_eventbooking/view/cart/tmpl/mini.php and modify it. In that file, you have list of events stored in $this->items . You will need to find a way to get categories of the event and implement the logic you want here

Tuan

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

  • Christoph
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 1 month ago #114385 by Christoph
Replied by Christoph on topic Validation check in Cart Colorbox
Ok, thank you Tuan,

I ll give it try and let you know.

Regards,
Chris

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

Moderators: Tuan Pham Ngoc