- Posts: 9
- Thank you received: 0
Custom fields by category missing in cart
- CLAW Corp
- Topic Author
- Offline
- New Member
-
Less
More
6 years 7 months ago #127826
by CLAW Corp
Custom fields by category missing in cart was created by CLAW Corp
I'm new to EB, so if there's something I'm missing or not understanding regarding configuration, please let me know -- much appreciated.
I'm having problems when configured for "Assign Custom Fields to category instead of to events" set to "Yes". Whenever multiple items are in the cart, the custom fields for the first event in the cart are the only ones to appear in the cart form.
I've tracked it down to ./components/com_eventbooking/helper/registration.php. For registrationType == 4 (cart?), only the FIRST item is used (483: $cartEventId = (int) $items[0];). As an experiment, I changed this to create an IN join (e.g., event_id IN (2,4,6), around line 488) for all items in the cart, which seems to work in a few sample registrations I did. The database looks fully populated for all events, rather repetitively, but with that I can live. I get all the custom fields displayed and data recorded this way.
Was there a reason that in category mode that only the first event is used and might there be ramifications further down the road with registration management that is the reason for the first-item only approach?
I'm having problems when configured for "Assign Custom Fields to category instead of to events" set to "Yes". Whenever multiple items are in the cart, the custom fields for the first event in the cart are the only ones to appear in the cart form.
I've tracked it down to ./components/com_eventbooking/helper/registration.php. For registrationType == 4 (cart?), only the FIRST item is used (483: $cartEventId = (int) $items[0];). As an experiment, I changed this to create an IN join (e.g., event_id IN (2,4,6), around line 488) for all items in the cart, which seems to work in a few sample registrations I did. The database looks fully populated for all events, rather repetitively, but with that I can live. I get all the custom fields displayed and data recorded this way.
Was there a reason that in category mode that only the first event is used and might there be ramifications further down the road with registration management that is the reason for the first-item only approach?
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
6 years 7 months ago #127830
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom fields by category missing in cart
Hello
If you are using shopping cart, it's not possible to use different custom fields different categories/events.
The reason is because in shopping cart, users can add multiple events to cart and if each event has it own set of custom fields, the system won't know which custom fields to display. That's why it can only get custom fields from first event in the cart
Tuan
If you are using shopping cart, it's not possible to use different custom fields different categories/events.
The reason is because in shopping cart, users can add multiple events to cart and if each event has it own set of custom fields, the system won't know which custom fields to display. That's why it can only get custom fields from first event in the cart
Tuan
Please Log in or Create an account to join the conversation.
- CLAW Corp
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 9
- Thank you received: 0
6 years 7 months ago #127893
by CLAW Corp
Replied by CLAW Corp on topic Custom fields by category missing in cart
Clearly, the system CAN display cross-category fields with the change I've suggested. My question is: what are the consequences, to the best of your knowledge, of this code change?
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
6 years 7 months ago #127898
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom fields by category missing in cart
Honestly, I could not guess this case. I think you will need to test the whole registration process and make sure it's all working as expected
Also, check the registration record created in the backend and make sure it contains all necessary data, too
Tuan
Also, check the registration record created in the backend and make sure it contains all necessary data, too
Tuan
Please Log in or Create an account to join the conversation.
Moderators: Tuan Pham Ngoc
Support
Documentation
Information
Copyright © 2026 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.