cancel
Showing results for 
Search instead for 
Did you mean: 

Newsletter subscription success message inside div

SOLVED

Newsletter subscription success message inside div

Hi i need help, currently i can see a success message come in a common location. Can i change this so that i can get success message inside a div just below the newsletter subscription text box?

then on success the message is displayed here

People who help will get kudos for every helpful comment.

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Newsletter subscription success message inside div

I found the blog of the one who wrote newsletter ajax for magento2 [ Magento 2 Newsletter Subscription via Ajax ].

I followed the steps and had to make some changes accordingly. I have used the extension only for the plugin folder and the xml configuration, rest all i copied to my theme folders.

It works now. Thank you  @Tom Robertshaw for the extension you suggested 

 

 

 

View solution in original post

8 REPLIES 8

Re: Newsletter subscription success message inside div

To do this, you're going to want to implement an AJAX newsletter subscribe so that the request gets sent off with javascript so that the page doesn't reload.

 

I've had a look around and there's not a lot around this at the moment but you could try this extension to see if it does the job https://github.com/medinadato/Magento2_Newsletter

----
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution" as appropriate. Thanks!

Re: Newsletter subscription success message inside div

I used that extension and i got this error

1 exception(s):
Exception #0 (Exception): Warning: simplexml_load_string(): namespace error : Namespace prefix xsd for type on argument is not defined in 

Can you please suggest something else?

Re: Newsletter subscription success message inside div

There's one open issue on that extension at the moment which appears to be what you are experiencing. https://github.com/medinadato/Magento2_Newsletter/issues/1 You could try the other user's suggested fix. 

----
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution" as appropriate. Thanks!

Re: Newsletter subscription success message inside div

Honestly that comment is not at all the solution.
if you notice the comment says to replace the line with the same line.

 

Re: Newsletter subscription success message inside div

Updated the ticket with what I think the resolution is: https://github.com/medinadato/Magento2_Newsletter/issues/1#issuecomment-359360346

----
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution" as appropriate. Thanks!

Re: Newsletter subscription success message inside div

yes you were right about the issue. Thank you for that. Now there is no error but still the ajax is not working. Page reloads and shows json array.

Re: Newsletter subscription success message inside div

I'm afraid that I can't debug the module over the forums. If you are unable to get this working, you'll need to get a magento developer to look into it. It was just one module around, it may end up not being practical to use. I don't think I can help further here.

----
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution" as appropriate. Thanks!

Re: Newsletter subscription success message inside div

I found the blog of the one who wrote newsletter ajax for magento2 [ Magento 2 Newsletter Subscription via Ajax ].

I followed the steps and had to make some changes accordingly. I have used the extension only for the plugin folder and the xml configuration, rest all i copied to my theme folders.

It works now. Thank you  @Tom Robertshaw for the extension you suggested