Souljah67
Forum Replies Created
-
Forum: Plugins
In reply to: [Newsletter Sign-Up] First name also added to last name in MailChimpI had this same issue. In my sign up I only have First Name and Email Address and it was adding the First Name to the Last Name as well.
This is the way I fixed it and not sure if it is the proper way but it worked for me, but save a copy of your original file just in case.
In the frontend/NewsletterSignUp.php file on line 507 just delete this line of code:
$request['merge_vars']['LNAME'] = substr($name,strpos($name,' '));
Let me know if that worked for you.
I am not using the widget but I had the same problem with the normal version of the sign up and this is how I fixed it adding the placeholder text as the First name on MailChimp. By no means am I saying this is the proper way to do it, it’s just the way I figured out to fix it.
In the frontend/NewsletterSignUp.php file on line 261 I changed this code:
if(isset($this->options['mailinglist']['subscribe_with_name']) && $this->options['mailinglist']['subscribe_with_name'] == 1 && isset($opts['name_required']) && $opts['name_required'] == 1 && empty($name)) {
to this:
if(isset($this->options['mailinglist']['subscribe_with_name']) && $this->options['mailinglist']['subscribe_with_name'] == 1 && isset($opts['name_required']) && $opts['name_required'] == 1 && ($name== "First Name")) {
I added && ($name== “First Name”) to the end of the statement and my placeholder text was First Name so just change that to your name and try it out. Save a copy of your original file just in case.
Let me know if it worked for you.
I tried what you posted above and it got rid of the syntax error but nothing shows up in the text field boxes now on both IE and Firefox.
You mentioned using JavaScript do I have to have a JS at the top of the class-form.php page? Or should this work by just replacing the default code with the code you provided above?
Thanks for the quick reply.