Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
mailchimp pane is not displayed on my checkout page.
And after I click on "continue" button of the ckeckout page I got this error on the shipping page:
Notice: Undefined index: commerce_mailchimp in commerce_mailchimp_pane_checkout_form_validate() (line 89 of /home/drupalpro/websites/cart.com/sites/all/modules/commerce_mailchimp/includes/commerce_mailchimp.checkout_pane.inc).
Warning: Invalid argument supplied for foreach() in commerce_mailchimp_pane_checkout_form_validate() (line 89 of /home/drupalpro/websites/cart.com/sites/all/modules/commerce_mailchimp/includes/commerce_mailchimp.checkout_pane.inc).
I think I properly configured the pane. See the attachment.
Comment | File | Size | Author |
---|---|---|---|
#10 | Schermafbeelding 2013-10-16 om 17.23.40.png | 95.31 KB | silkogelman |
#8 | commerce_mailchimp-throws-notices-checkout-form-submission-no-lists-defined-1967836-8.patch | 2.51 KB | DYdave |
mailchimp-pane.png | 62.73 KB | heyyo |
Comments
Comment #1
lsolesen CreditAttribution: lsolesen commentedExperiencing the same thing. Did you solve your issue?
Comment #2
heyyo CreditAttribution: heyyo commentedIn fact this bug occurs only if I'm connected with my admin account and If my admin account has already subscribed to the list.
Comment #3
lsolesen CreditAttribution: lsolesen commented@heyyo - ah, ok. I will check that out. Seems a little odd though.
Comment #4
tr33m4n CreditAttribution: tr33m4n commentedAlso experiencing this problem... Any updates?
Comment #5
lsolesen CreditAttribution: lsolesen commentedFor the pane to show, lists should be added in the mailchimp configuration. When administering the mailchimp pane in the checkout flow, there should be custom settings for the pane available. If there is not, no lists has been created.
It would be great if the module would report this :)
Comment #6
Petr IllekI've all the setup ok and function for first time. So new customers can subscribe to the newsletter without any warning. But this error occurs for already subscribed users.
Comment #7
rszrama CreditAttribution: rszrama commentedI got bit by this, too, and the module should definitely be fixed to accommodate scenarios when the checkout pane is not shown (i.e. no lists are available).
I also agree that the checkout pane settings form could be more helpful, too. I didn't know what I had to do until I realized that even though the MailChimp module detected my list in my MC account, I still had to define it and link it locally. Thus I was confused as to why the checkout pane wasn't showing up in my first attempts at checkout. Maybe where the settings would be it should have a message along the lines of,
"This checkout pane will not be displayed until you have configured a MailChimp list."
And link that "configured a MailChimp list" to the lists page.
Comment #8
DYdave CreditAttribution: DYdave commentedHi Ryan,
Thanks a lot for sharing your feedback on the module and reporting back on these issues.
Your comment was particularly helpful in terms of setting a proper direction to solve these issues.
I took a closer look at the problem and it would seem indeed a little bit more efforts could round up a bit further the edges of this useful module.
If I may, I would like to bounce back on your ideas and propose a patch against commerce_mailchimp-7.x-1.x at e0a57df, as an attempt to improve Commerce MailChimp's Checkout Pane configuration form UI (let users know a bit more about what they should do) and fix the notices during checkout form submission.
File attached as: commerce_mailchimp-throws-notices-checkout-form-submission-no-lists-defined-1967836-8.patch.
Quick comments about the modifications on the Checkout Pane configuration form:
I first started by testing with
$form['#prefix']
, but the message would display between global and Pane specific fieldsets settings, which I found not obvious/clear enough.Then, I tried with
$form['commerce_mailchimp_no_list']['#markup] = t('TEXT MESSAGE');
, which was a bit better, since the markup/message displayed in the Pane specific settings, which would make sense, but I personally still found it a bit too obscure (you'd still need to read and dig a bit down the page, definitely something that a "speedy" user would miss).So I thought to really make it very obvious we might as well go for a
drupal_set_message
of the Warning type, just to be very clear to users.The patch does both: Add a message in the Pane specific settings and a Warning message at the top of the page.
Otherwise, for the notices, it would seem that skipping the validation if
$form_state['values']['commerce_mailchimp']
is empty would resolve the problem and prevent from raising these errors (at least according to the tests I've made).I would greatly appreciate to have your testing/reporting, reviews, feedbacks, comments, objections, questions, issues or concerns on the attached patch.
Please let me know if you would have any other ideas for the modification of the Checkout Pane form settings UI or the wording of the messages, I would be glad to re-roll and come up with an updated version that would take into account any of your suggestions/ideas.
Feel free to let me know if you would have any questions, comments or suggestions about the code, patch, suggested approach or any other aspects discussed in this ticket, I would be very happy to explain in more details.
Thanks in advance to everyone for your testing, reporting, reviews, comments and feedbacks.
Cheers!
Comment #9
silkogelman CreditAttribution: silkogelman commentedI agree with everything in #7. This definitely should be fixed and could be more user friendly.
A workaround for the checkout error until this is fixed might be to set the 'Subscription Options' pane to disabled.
Update: while I was typing this comment, DYdave made a patch and posted #8! (woot). I'm testing it as we speak.
Comment #10
silkogelman CreditAttribution: silkogelman commentedThis seems to be working very well.
No more error during checkout, and the pane's configuration screen shows helpful info:
I can't judge the code as I am not a coder, but from what I can judge from the UI I'd say this issue's mission is accomplished.
Thanks guys, and thanks for the patch DYdave! This DEFINITELY makes this module more user friendly.
Awesome work.
Comment #11
DYdave CreditAttribution: DYdave commentedThanks a lot Sil for your prompt feedback on *all* the tickets updated recently.
Great Testing/Reporting work! (Screenshots are a great idea!!)
All these changes were rather small from a developer's perspective and with everyone's comments/suggestions/ideas I managed creating the patches much quicker than testing them :-).
However, no matter how small these changes may be, I sincerely hope they help further refine, round up the edges to hopefully become more user friendly, gain more trust and make a bigger difference to non tech savvy people.
Unfortunately, many people would give up rather quickly "just" because of a WSOD, Fatal error, or say "I can't make it work", when it would all come down to a few characters of code (developers' perspective).
With a little bit more users, community work and coming down the list of issues, I'm sure we would all be looking forward to seeing a stable version of the module released.
Feel free to let me know at anytime if you would have any more questions from a coding perspective, UI/wording or the overall approach, I would certainly be glad to provide more information or come up with a re-roll of the patch.
Thanks again to everyone for the great feedback, reviews, ideas and testing/reporting!
Cheers!
Comment #12
donquixote CreditAttribution: donquixote commentedSeems to work (after very short testing).
Not a big deal, but
I would usually prefer
Less indentation, easier to read imo.
Comment #13
fox mulder CreditAttribution: fox mulder commentedHi!
I experienced same problem. I was created a new user through admin/people/create than I was masqueraded to this user and did shopping.
On checkout/ORDER_ID page the subscription checkbox did not appear (it's OK I am subscribed now), but when I was clicked Next, than I become the "Undefined index: commerce_mailchimp in commerce_mailchimp_pane_checkout_form_validate(..." notice.
The solution #12 works great
Comment #14
Drupal Bros CreditAttribution: Drupal Bros commentedAgreed, this is a good solution. The module is better with this patch than without it.
Comment #15
pachabhaiya CreditAttribution: pachabhaiya commentedI had experienced the same issue. patch #8 works perfect for me.
Comment #16
Anybody+1 for a new version! :)
Comment #17
torgosPizzaPatch works, please consider rolling it into -dev! (Though I might also make sure that $lists = mailchimp_get_lists(); is not an empty array as well...)
Comment #18
Jim.M CreditAttribution: Jim.M commentedLooks like this one was fixed as part of code changes related to the new mailchimp library version.
DYdave+