This is the module that I am using to help me create my webform. http://drupal.org/project/webform_conditional
It pretty much makes it so for the field "Where did you hear about us?:
if they selected Sales Rep a new field pops up sayins which Sales Rep informed you about us? (dropdown list of all sales rep names)
if they selected Service Center a new field pops up sayins which Service Center did you visit? (dropdown list of all service centers)
In total my webform is 3 fields, but only one of them shows in the beginning which is "Where did you hear about us?" The others appear depending on whether they are selected or not in "Where did you hear about us?".
When I view this webform under Administration > Webforms the conditionals work perfectly and last 2 fields are hidden.
After using "UberCart Webform Checkout Panes Module" to add my webform to the checkout pane, it adds it and lets me select the weight and everything, but it isn't carrying over my conditionals. I see all 3 fields of the form displayed.
Could someone please tell me why this may be happening and if there is a possible fix for it? My assumptions are that "Webform Conditional" is an extra module for webform, so the checkout panes module doesn't account for it when it carries the form over to the checkout pane. Or it isn't reading the code from the conditionals at the proper time?
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | webformmovehere.jpg | 152.55 KB | WebmistressM |
| #10 | checkoutsettings.jpg | 52.96 KB | WebmistressM |
Comments
Comment #1
arski commentedHey,
Well yes, quite obviously Webform Conditional is an extra module that I haven't heard of yet and hence this module won't necessarily support it straight away. I'll look into it when I have some time to see how complicated a fix would be. Will let you know how it goes.
Cheers
Comment #2
HunterT commentedThanks a lot
Comment #3
tedbow@arski,
Hi I am the creator of Webform Conditional. I think this would be a complicated fix. Your module creates the webform components individually and doesn't use drupal_get_form, correct? I am using hook_form_alter to make my changes.
I haven't actually installed your module, just looked at the code a little bit so sorry if my question misses the point of your module. Why isn't the module creating the webform the same way the Webform module does. Like this:
I think my module would work in this case but like I said I don't much about your module.
Thanks,
Ted
Comment #4
arski commentedhmm, good pointer.. to be honest I didn't have any time at all to integrate webform_conditional yet. But you're right, there's probably no reason why this module shouldn't be calling drupal_get_form on the webform_client_form_$node->nid (what it's doing now is directly calling webform_client_form which is functionally the same as it's the callback for all webform_client_form_$node->nid forms, but avoiding the drupal form hooks obviously).
I'll look into it and see if I can switch the code to use drupal_get_form. I must admit the module was not mine originally and I suppose I never took the time to check every little bit of the old working code to make sure it's "nice" ;)
Cheers,
Martin
Comment #5
arski commentedHey again,
just a small update - I basically know how this can be achieved as I've done something similar in http://drupal.org/project/uc_cck_pane, however, this is a very big change and I don't really have that much time for it now. (In short, I can't use drupal_get_form as that returns a fully rendered form as a html string, while I need an array that I can insert in the big checkout form - that's just how UC checkout form works.)
I've rolled out another stable 6.x release now and the plan is to have this implemented for the next release, but I can't promise anything time-wise at this stage. It would possibly help if more people were interested in this, and of course if you can step in with some coding work, then that would be more than welcome too.
Cheers
Comment #6
linksync commentedsubscribing - this would be great enhancement to an already great module.
Comment #7
rikki_iki commentedsubscribing.
Comment #8
mattcasey commentedsubscribing
Comment #9
benjohnstone commented+1
Comment #10
WebmistressM commentedI too am looking for a bit more control in regards to how you get your webform to appear in the checkout pane. For example, I wish to create a webform that is only relevant to a particular payment method. Simply put, if the customer does not choose to pay by Paypal, than they will have to issue a check. However, it would speed things up immensely if I could include a "pay by check" (SSL secure) webform in the checkout pane.
Getting that form to show up on the checkout pane with this module is no problem. Its just that I cannot have control over including that form inside the payment methods section, specifically under the "Check" option.
Comment #11
arski commentedHi,
your request is only very remotely related to the op who asked for support for a particular existing module. Please do not post things in an issue just because the topics are slightly similar. What you're asking for is plugging one pane inside another, which can only be done using hook_pane_alter on the payment pane and which is definitely outside the scope of this module.
Another solution that might be interesting for you is having the webform pane appear/disappear based on the payment method selection, but as far as I know that can only be done with a page reload or js, and equally both these things are outside of the scope of this module.
Basically your request is general to the management and altering of any UC pane and not webform panes specifically.
Comment #12
WebmistressM commentedHonestly, I dont think we always know exactly what we need every time we get to the point that we realize we might need to ask for help, so I may have misplaced this post, yes. It seemed like conditionals is what I am seeking, as my overall desire is to have "whether it displays or not" dependant on whether something else on the checkout pane is clicked.
With the way that Ubercart is almost an entity in itself, I guess that is where the confusion lied. Thanks for getting back to me.
Comment #13
arski commentedHi again,
So I've committed some changes to the module that now generate the webform in a way that calls hook_form_alter implementations.
Unfortunately, since there are a lot of structural differences, the JS code from webform_conditional doesn't quite work out of the box. I think the main issues are the field and form #id's that it expects to get. For example, the fields are no more
webform-component-[FIELDID]but instead
webform-component-webform-nid[NID]--0--[FIELDID]Also, there is no more individual
formtag for the webform pane, instead, there is one big form for the whole checkout, and the webform is inside a fieldset with id's such aswebform_nid[NID]-paneIf you could adjust your code to make things more dynamic that would be great - I don't know though if hook_form_alter has enough information to figure out that the webform is loaded inside a checkout pane though. If not, let me know what kind of fix would be useful.
Cheers
PS. Commit will be in -dev within the next 12 hours as usual.
Comment #14
chinita7 commentedAre these two modules already compatible as of now ?
Comment #15
arski commenteddoubtful, please read the previous post for the status. basically awaiting some support from the other module's devs.
Comment #16
chinita7 commentedThe similar issue in webform conditional module is here http://drupal.org/node/1063962
Comment #17
arski commentedWaiting for something to happen in webform_conditional - can't do much until it does.
Comment #18
tedbow@arski attached patch for webform_conditional with possible solution here - http://drupal.org/node/1063962#comment-6036002
Can we keep discussion as it relates to the patch on that issue?
Thanks
Comment #19
arski commentedOK, I'll check it out. Thanks!
Comment #20
arski commentedLooking good at first glance. Conditionals are working. But the webform is not submitting at checkout, so a small glitch still in there somewhere. Should be fixed soon. Short sentences ftw.
Comment #21
arski commentedOK, update committed to the 6.x branch. Pending a small addition to the patch in #1063962: Conditional actions do not work within UberCart checkout panes module? this should be complete.
Switching to 7.x.
Comment #22
arski commentednote to self, D7 patch was just provided in #1063962: Conditional actions do not work within UberCart checkout panes module? - need to test and implement same functionality.
Comment #23
arski commentedthat patch needed work, waiting for a final fix.
Comment #24
debo7debo commentedDid anyone find a solution to this yet? I've run into this problem again on my second site needing the conditionals to work in checkout.
Comment #25
arski commentedAs I mentioned before, the issue is fixed here, but requires an update from Webform Conditionals issue as referenced above.
Comment #26
debo7debo commented@arski - oh sorry. I have 7.x-3.9 installed, the fix was committed to that version or dev?
Comment #27
arski commentedThere is a fix for this module in dev, but it won't work until #1063962: Conditional actions do not work within UberCart checkout panes module? (Webform conditional module itself) is fixed too - that's what I meant.
Comment #28
debo7debo commentedOk I see. You think I should download dev in the mean time or just stick with the stable release?