Conditional logic not working for nested items in repeating group
Support › MB Conditional Logic › Conditional logic not working for nested items in repeating group
- This topic has 6 replies, 2 voices, and was last updated 4 years, 7 months ago by
Caballero.
-
AuthorPosts
-
September 22, 2020 at 6:23 PM #22029
Caballero
ParticipantHello!
Here is the code snippet:
https://pastebin.com/xNkLYDMvTo replicate issue:
Add two sections: Product info and then Pricing.
In Pricing section choose type of Table.
The problems is than in Plans there should be Features but they aren't showing.
Also the Enable Icons switch isn't toggling fields.
Is this expected behavior or a bug?
I tested the same structure in ACF and it's working there.Thanks!
September 22, 2020 at 10:44 PM #22036Long Nguyen
ModeratorHi,
I've tested your code on my local site but not see any problem. See this screen record https://www.loom.com/share/e1123f4c1f664c088ff50612ef4e9f9f.
Please make sure that the plugin MB Group (or Meta Box AIO) is activating, deactivate all plugins except Meta Box, Meta Box extensions, WooCommerce; switch to the default theme of WordPress (Twenty Twenty) and clear cache then check the problem again.
September 23, 2020 at 2:14 PM #22071Caballero
ParticipantHello!
I see that you only have added one section, if I add only one section the conditional logic is working as expected but problem starts when the section isn't the first section in the repeating group.
I have recorded video to help you understand my problem:
https://www.loom.com/share/de7dfc8950db4a928cd53a53cbc5a492
I'm not using WooCommerce product is CPT but that isn't important as you can add fields to page or post and the problem is persistent.
Meta Box AIO is activating. I have deactivated all plugins except MetaBox and MetaBox AIO updated to latest version. Cleared the cache and tested this on default theme, still not working.Thanks!
September 23, 2020 at 4:49 PM #22094Long Nguyen
ModeratorHi,
Thanks for pointing this out. The conditional logic only works with the field
group
, not the sub-field inside the group. So please use a field that has the same level (depth) to make the conditional works.Move the condition from field id
features
up to the field idplan
, the code should be https://pastebin.com/VZee1zU7. You can do the same for other fields/groups.September 23, 2020 at 5:38 PM #22095Caballero
ParticipantHello!
It's unfortunate to hear that this kind of behavior isn't expected as I didn't want to repeat the same field declarations for all possible outcomes of this solution (Now I have to and there is a lot of WET code). Also I wanted to avoid copying data if there is change in any of options. Only
type
switch would result in two separate groups with separate ID's...
Is it possible that in future you'll integrate functionality like this?
As I mentioned before ACF seems to support this kind of behavior and we decided to choose MetaBox over ACF because of your advertising of boundless features and endless possibilities.Thanks!
September 23, 2020 at 10:29 PM #22098Long Nguyen
ModeratorHi,
I'm going to pass this case for the developer team to research and cover it in the next update as soon as possible. Thank you.
September 24, 2020 at 2:47 PM #22133Caballero
ParticipantHello!
Thanks for supporting this feature request. We'll be waiting for update to roll out!
Regards,
Caballero team. -
AuthorPosts
- You must be logged in to reply to this topic.