I'm using conditional fields to make a dependency between an options field with radio buttons and multiple markup fields with descriptions of the options. When it works, the relevant markup field appears when an option is selected. Only one markup field is visible at a time.
The conditional fields module won't evaluate dependencies if #field_parents is left as an empty array in commerce_registration_information_checkout_form()
.
The conditional fields module also needs to be patched for this to work because there is no information about the entity or bundle in the form. I have submitted a patch in the conditional fields issue queue: #1786232: support for markup fields
I will provide the patch for this issue shortly.
Comment | File | Size | Author |
---|---|---|---|
#1 | commerce_registration-setting_field_parents_for_conditional_fields-1787046-1.patch | 702 bytes | arosboro |
Comments
Comment #1
arosboro CreditAttribution: arosboro commentedHere is the patch
Comment #3
jpontani CreditAttribution: jpontani commentedCommitted to latest dev.
Comment #5
tmsimont CreditAttribution: tmsimont commentedThis doesn't seem to address a situation where there are 2 registrations on the checkout pane. This will only fix the problem for the first of the 2. The second registration on the pane (if there are 2 in the cart) fails to work with conditional fields.
Comment #6
tmsimont CreditAttribution: tmsimont commentedrelated: #1833924: The CR checkout pane form misuses the Field API when handling entity fields, causing numerous issues
Comment #7
tmsimont CreditAttribution: tmsimont commentedNevermind about #5 -- the patch in #6 replaces the need for the patch here in #1, and the issue with multiple registrations is related to a different issue in Conditional Fields: #1803568: Multiple calls to field_attach_form() causes conflicts