-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Repeatable Fields #10
Comments
Another solution for it - http://stackoverflow.com/questions/17175534/clonned-select2-is-not-responding |
@bryceadams - I'm curious to know if you've forked + hacked your own solution? Yet? Given Select2's popularity I'm surprised it does this. That said, I too need it to work with a repeater / group. I'm not really worried about fixing it per se. I just don't want to do so if someone else already has it sorted. |
hey @AlchemyUnited, not yet, no time. would be awesome if you could look at this and i'll definitely contribute to what you come up with. |
fyi - I have this sorted out (read: proof of concept / alpha) but it entails changes to CMB2, as well as a tweak or two to this plugin. Let me test a bit more and issue the necessary pull requests, etc. |
excellent! |
@bryceadams - here ya go... I have PRs in with this plugin as well as CMB2. if you what to test prior to those merges these are the forks I'm working with. https://github.com/AlchemyUnited/CMB2 << added some triggers to the UI js. https://github.com/AlchemyUnited/cmb-field-select2 << destroys and such based on the triggers. If you can test that would be a big help. All seem ok with me but but I've been solving more than I've been testing :) |
Thanks for your work on this @AlchemyUnited. I see the necessary events have been accepted into CMB2. I will go ahead and test/merge your pull request shortly. |
great work on this @AlchemyUnited! |
Merry Christmas!!! Something tells me there are still a couple things to fix - that no one anticipated - but we're on our way!! Keep me posted about any issues. I'll be happy - time permitting to clean them up. |
Hey @AlchemyUnited! How about passing a function which returns an array of options for the field? I've dowloaded your forked version of the cmb-field-select2 and got it working (almost). I'm using the select2 field within a CMB2 repeatable group, and although it renders the field with the options returned by my custom function with an array of woocommerce variable products, it does not seem to be saving any values. It surprisingly works though if I set up a CMB2 default select field, and then pass the function to it. By doing that, I end up with a properly populated select field with the product variations and their ID's as the value of each However, when I try to set up the Any chances my function is causing the issue? Here it is:
And here's the field set up:
In the front end, each repeatable group is rendered as a price box, and for each selected product variation from the select2 field, a buy button is displayed right beside the price, that then triggers woocommerce's ajax function and adds a single (variable) product to the cart. It all happens on a custom post type single page. However, without the ids values grabbed from the select2 field, the buy button function fails. Thanks in advance. |
@monecchi - I'm a bit backed up atm but if you want me to take a swing at it let me know and we'll figure out how to pass your fork over to me. |
Thanks @AlchemyUnited. I'd really appreciate it! I've enhanced the previous comment with more details. I've tried a few different cmb-field-select2 forks, as a few others select2 field types for CMB2, but all those expects an array of options to be manually set such as Anyway, no rush for this though, I've decided to fallback to CMB2 default select field until I could get it solved. Regards. |
@monecchi - Okay. But this sounds like a challenge. And a useful one if solved. Where is your fork? Or maybe I'll give it a fresh crack and then we've can trade notes? |
@AlchemyUnited @monecchi A massive thanks to @AlchemyUnited for the repeatable field work. It took a while to get around to looking at this in detail. I've pushed a new release which incorporates this work. I'd appreciate any assistance testing this across more sites. It has worked well for me with the exception of a couple of issues which I've noted in a known issues/limitations section in the documentation. |
Hey @mustardBees, thank you so much for pushing the new version. I can confirm it works beautifully now! No issues with my query/get_posts function so far. @AlchemyUnited thank you for your great contribution with the repeatable field work. You guys rock!!! |
When select2 is cloned, there are issues with the data saving. Discussed here and a bit related - humanmade/Custom-Meta-Boxes#73
Can test by using a
pw_select
type in a repeatable group field.The text was updated successfully, but these errors were encountered: